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,
},
},
},
});

View File

@@ -178,6 +178,7 @@ export const UPDATE_JOB_LINE = gql`
status
removed
convertedtolbr
convertedtolbr_data
}
}
}

View File

@@ -1907,6 +1907,7 @@ export const QUERY_JOB_CLOSE_DETAILS = gql`
profitcenter_part
prt_dsmk_p
convertedtolbr
convertedtolbr_data
}
}
}

View File

@@ -2385,6 +2385,7 @@
- bett_type
- cert_part
- convertedtolbr
- convertedtolbr_data
- created_at
- db_hrs
- db_price
@@ -2449,6 +2450,7 @@
- bett_type
- cert_part
- convertedtolbr
- convertedtolbr_data
- created_at
- db_hrs
- db_price
@@ -2524,6 +2526,7 @@
- bett_type
- cert_part
- convertedtolbr
- convertedtolbr_data
- created_at
- db_hrs
- db_price

View File

@@ -0,0 +1,4 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."joblines" add column "convertedtolbr_data" jsonb
-- not null default jsonb_build_object();

View File

@@ -0,0 +1,2 @@
alter table "public"."joblines" add column "convertedtolbr_data" jsonb
not null default jsonb_build_object();

6670
yarn.lock

File diff suppressed because it is too large Load Diff