IO-1972 Converted to labor display.

This commit is contained in:
Patrick Fic
2022-07-18 11:39:23 -07:00
parent 05de47c833
commit c048f21674
7 changed files with 3347 additions and 3348 deletions

View File

@@ -66,10 +66,8 @@ export function JobLineConvertToLabor({
const newAdjustments = _.cloneDeep(
existingAdjustments.data.jobs_by_pk.lbr_adjustments
);
newAdjustments[mod_lbr_ty] =
(newAdjustments[mod_lbr_ty] || 0) +
calculateAdjustment({ mod_lbr_ty, job, jobline });
const adjustment = calculateAdjustment({ mod_lbr_ty, job, jobline });
newAdjustments[mod_lbr_ty] = (newAdjustments[mod_lbr_ty] || 0) + adjustment;
const jobUpdate = client.mutate({
mutation: UPDATE_JOB,
@@ -83,7 +81,13 @@ export function JobLineConvertToLabor({
mutation: UPDATE_JOB_LINE,
variables: {
lineId: jobline.id,
line: { convertedtolbr: true },
line: {
convertedtolbr: true,
convertedtolbr_data: {
mod_lbr_ty: mod_lbr_ty,
mod_lb_hrs: adjustment,
},
},
},
});