IO-2089 Incorporate Lbr Adjustments into scoreboard.

This commit is contained in:
Patrick Fic
2023-01-02 14:48:10 -08:00
parent f6bf1ce793
commit f8e74d9bad
2 changed files with 12 additions and 0 deletions

View File

@@ -166,6 +166,16 @@ export default function ScoreboardAddButton({
painthrs: 0,
}
);
//Add Labor Adjustments
v.painthrs = v.painthrs + (job.lbr_adjustments.LAR || 0);
v.bodyhrs =
v.bodyhrs +
Object.keys(job.lbr_adjustments)
.filter((key) => key !== "LAR")
.reduce((acc, val) => {
return acc + job.lbr_adjustments[val];
}, 0);
form.setFieldsValue({
date: new moment(),
bodyhrs: Math.round(v.bodyhrs * 10) / 10,

View File

@@ -855,6 +855,7 @@ export const QUERY_JOB_CARD_DETAILS = gql`
owner_owing
special_coverage_policy
suspended
lbr_adjustments
available_jobs {
id
}
@@ -1910,6 +1911,7 @@ export const QUERY_JOB_CLOSE_DETAILS = gql`
kmin
kmout
qb_multiple_payers
lbr_adjustments
joblines(where: { removed: { _eq: false } }, order_by: { line_no: asc }) {
id
removed