From 39998a279ef4353569cafc7e1ef7e286ede9a9cb Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 9 Feb 2022 10:34:52 -0800 Subject: [PATCH 1/6] Autohouse Fixes. --- server/data/autohouse.js | 48 +++++++++++++++++++------------- server/graphql-client/queries.js | 2 +- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/server/data/autohouse.js b/server/data/autohouse.js index 1a442485a..2297ac21f 100644 --- a/server/data/autohouse.js +++ b/server/data/autohouse.js @@ -123,12 +123,12 @@ exports.default = async (req, res) => { } } - // for (const xmlObj of allxmlsToUpload) { - // fs.writeFileSync(`./logs/${xmlObj.filename}`, xmlObj.xml); - // } + for (const xmlObj of allxmlsToUpload) { + fs.writeFileSync(`./logs/${xmlObj.filename}`, xmlObj.xml); + } - // res.json(allxmlsToUpload); - // return; + res.json(allxmlsToUpload); + return; let sftp = new Client(); sftp.on("error", (errors) => @@ -227,7 +227,7 @@ const CreateRepairOrderTag = (job, errorCallback) => { InsuredorClaimantFlag: null, }, VehicleInformation: { - Year: job.v_model_yr || "", + Year: parseInt(job.v_model_yr.match(/\d/g).join(""), 10) || "", Make: job.v_make_desc || "", Model: job.v_model_desc || "", VIN: job.v_vin || "", @@ -575,10 +575,12 @@ const CreateRepairOrderTag = (job, errorCallback) => { .add(Dinero(job.job_totals.totals.federal_tax)) .toFormat(AHDineroFormat), SalesTaxTotalCost: 0, - GrossTotal: Dinero(job.job_totals.totals.net_repairs).toFormat( + GrossTotal: Dinero(job.job_totals.totals.total_repairs).toFormat( AHDineroFormat ), - DeductibleTotal: job.ded_amt || 0, + DeductibleTotal: Dinero({ + amount: Math.round((job.ded_amt || 0) * 100), + }).toFormat(AHDineroFormat), DepreciationTotal: Dinero( job.job_totals.totals.custPayable.dep_taxes ).toFormat(AHDineroFormat), @@ -588,7 +590,9 @@ const CreateRepairOrderTag = (job, errorCallback) => { CustomerPay: Dinero(job.job_totals.totals.custPayable.total).toFormat( AHDineroFormat ), - InsurancePay: 0, + InsurancePay: Dinero(job.job_totals.totals.total_repairs) + .subtract(Dinero(job.job_totals.totals.custPayable)) + .toFormat(AHDineroFormat), Deposit: 0, AmountDue: 0, }, @@ -634,7 +638,7 @@ const CreateRepairOrderTag = (job, errorCallback) => { DetailLine: job.joblines.length > 0 ? job.joblines.map((jl) => - GenerateDetailLines(jl, job.bodyshop.md_order_statuses) + GenerateDetailLines(job, jl, job.bodyshop.md_order_statuses) ) : [generateNullDetailLine()], }, @@ -718,7 +722,10 @@ const CreateCosts = (job) => { return { PartsTotalCost: Object.keys(billTotalsByCostCenters).reduce((acc, key) => { - return acc.add(billTotalsByCostCenters[key]); + if (key !== defaultCosts.PAS && key !== defaultCosts.PASL) + return acc.add(billTotalsByCostCenters[key]); + + return acc; }, Dinero()), PartsOemCost: (billTotalsByCostCenters[defaultCosts.PAN] || Dinero()).add( billTotalsByCostCenters[defaultCosts.PAP] || Dinero() @@ -728,7 +735,9 @@ const CreateCosts = (job) => { billTotalsByCostCenters[defaultCosts.PAM] || Dinero(), PartsRecycledCost: billTotalsByCostCenters[defaultCosts.PAL] || Dinero(), PartsOtherCost: billTotalsByCostCenters[defaultCosts.PAO] || Dinero(), - SubletTotalCost: billTotalsByCostCenters[defaultCosts.PAS] || Dinero(), + SubletTotalCost: + billTotalsByCostCenters[defaultCosts.PAS] || + Dinero(billTotalsByCostCenters[defaultCosts.PASL] || Dinero()), BodyLaborTotalCost: ticketTotalsByCostCenter[defaultCosts.LAB] || Dinero(), RefinishLaborTotalCost: ticketTotalsByCostCenter[defaultCosts.LAR] || Dinero(), @@ -781,10 +790,15 @@ const StatusMapping = (status, md_ro_statuses) => { // default: return "UNDEFINED" }; -const GenerateDetailLines = (line, statuses) => { +const GenerateDetailLines = (job, line, statuses) => { const ret = { BackOrdered: line.status === statuses.default_bo ? "1" : "0", - Cost: (line.billlines[0] && line.billlines[0].actual_cost.toFixed(2)) || 0, + Cost: + (line.billlines[0] && + (line.billlines[0].actual_cost * line.billlines[0].quantity).toFixed( + 2 + )) || + 0, //Critical: null, Description: line.line_desc || "", DiscountMarkup: line.prt_dsmk_m || 0, @@ -811,11 +825,7 @@ const GenerateDetailLines = (line, statuses) => { Vendor: (line.billlines[0] && line.billlines[0].bill.vendor.name) || "", VendorPaid: null, VendorPrice: - (line.billlines[0] && - (line.billlines[0].actual_price * line.billlines[0].quantity).toFixed( - 2 - )) || - 0, + (line.billlines[0] && line.billlines[0].actual_price.toFixed(2)) || 0, Deleted: null, ExpectedOn: null, ReceivedOn: diff --git a/server/graphql-client/queries.js b/server/graphql-client/queries.js index aa8823623..6284de616 100644 --- a/server/graphql-client/queries.js +++ b/server/graphql-client/queries.js @@ -639,7 +639,7 @@ exports.AUTOHOUSE_QUERY = `query AUTOHOUSE_EXPORT($start: timestamptz, $bodyshop job_totals driveable parts_tax_rates - + ded_amt joblines(where: {removed: {_eq: false}}) { id line_no From e7e9ca6dfc6fddf00ab3a83bb8fb209ed4ded4fa Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 9 Feb 2022 10:35:15 -0800 Subject: [PATCH 2/6] Schema Updates. --- hasura/metadata/tables.yaml | 1 + .../down.sql | 4 ++++ .../up.sql | 2 ++ .../down.sql | 1 + .../up.sql | 1 + .../down.sql | 1 + .../up.sql | 1 + 7 files changed, 11 insertions(+) create mode 100644 hasura/migrations/1644427186188_alter_table_public_bodyshops_add_column_entegral_configuration/down.sql create mode 100644 hasura/migrations/1644427186188_alter_table_public_bodyshops_add_column_entegral_configuration/up.sql create mode 100644 hasura/migrations/1644427201767_alter_table_public_bodyshops_alter_column_entegral_configuration/down.sql create mode 100644 hasura/migrations/1644427201767_alter_table_public_bodyshops_alter_column_entegral_configuration/up.sql create mode 100644 hasura/migrations/1644430372272_alter_table_public_bodyshops_alter_column_timezone/down.sql create mode 100644 hasura/migrations/1644430372272_alter_table_public_bodyshops_alter_column_timezone/up.sql diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml index 3f989dc2c..004cdf5a8 100644 --- a/hasura/metadata/tables.yaml +++ b/hasura/metadata/tables.yaml @@ -815,6 +815,7 @@ - email - enforce_class - enforce_referral + - entegral_configuration - entegral_id - features - federal_tax_id diff --git a/hasura/migrations/1644427186188_alter_table_public_bodyshops_add_column_entegral_configuration/down.sql b/hasura/migrations/1644427186188_alter_table_public_bodyshops_add_column_entegral_configuration/down.sql new file mode 100644 index 000000000..0723fc66a --- /dev/null +++ b/hasura/migrations/1644427186188_alter_table_public_bodyshops_add_column_entegral_configuration/down.sql @@ -0,0 +1,4 @@ +-- Could not auto-generate a down migration. +-- Please write an appropriate down migration for the SQL below: +-- alter table "public"."bodyshops" add column "entegral_configuration" jsonb +-- null default jsonb_build_array(); diff --git a/hasura/migrations/1644427186188_alter_table_public_bodyshops_add_column_entegral_configuration/up.sql b/hasura/migrations/1644427186188_alter_table_public_bodyshops_add_column_entegral_configuration/up.sql new file mode 100644 index 000000000..c914e91f5 --- /dev/null +++ b/hasura/migrations/1644427186188_alter_table_public_bodyshops_add_column_entegral_configuration/up.sql @@ -0,0 +1,2 @@ +alter table "public"."bodyshops" add column "entegral_configuration" jsonb + null default jsonb_build_array(); diff --git a/hasura/migrations/1644427201767_alter_table_public_bodyshops_alter_column_entegral_configuration/down.sql b/hasura/migrations/1644427201767_alter_table_public_bodyshops_alter_column_entegral_configuration/down.sql new file mode 100644 index 000000000..6c23ce2a6 --- /dev/null +++ b/hasura/migrations/1644427201767_alter_table_public_bodyshops_alter_column_entegral_configuration/down.sql @@ -0,0 +1 @@ +alter table "public"."bodyshops" alter column "entegral_configuration" set default jsonb_build_array(); diff --git a/hasura/migrations/1644427201767_alter_table_public_bodyshops_alter_column_entegral_configuration/up.sql b/hasura/migrations/1644427201767_alter_table_public_bodyshops_alter_column_entegral_configuration/up.sql new file mode 100644 index 000000000..ca39a9e40 --- /dev/null +++ b/hasura/migrations/1644427201767_alter_table_public_bodyshops_alter_column_entegral_configuration/up.sql @@ -0,0 +1 @@ +alter table "public"."bodyshops" alter column "entegral_configuration" set default jsonb_build_object(); diff --git a/hasura/migrations/1644430372272_alter_table_public_bodyshops_alter_column_timezone/down.sql b/hasura/migrations/1644430372272_alter_table_public_bodyshops_alter_column_timezone/down.sql new file mode 100644 index 000000000..0fee18174 --- /dev/null +++ b/hasura/migrations/1644430372272_alter_table_public_bodyshops_alter_column_timezone/down.sql @@ -0,0 +1 @@ +ALTER TABLE "public"."bodyshops" ALTER COLUMN "timezone" drop default; diff --git a/hasura/migrations/1644430372272_alter_table_public_bodyshops_alter_column_timezone/up.sql b/hasura/migrations/1644430372272_alter_table_public_bodyshops_alter_column_timezone/up.sql new file mode 100644 index 000000000..669f3a52e --- /dev/null +++ b/hasura/migrations/1644430372272_alter_table_public_bodyshops_alter_column_timezone/up.sql @@ -0,0 +1 @@ +alter table "public"."bodyshops" alter column "timezone" set default 'America/Vancouver'; From 351459681ce050d209591e136539df13a2849440 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 9 Feb 2022 10:55:12 -0800 Subject: [PATCH 3/6] IO-1637 Tax rates randomly not pulling. --- .../bill-enter-modal/bill-enter-modal.container.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx b/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx index 0ef98325a..6c0eeaa60 100644 --- a/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx +++ b/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx @@ -216,7 +216,11 @@ function BillEnterModalContainer({ if (enterAgain) { form.resetFields(); - form.setFieldsValue({ ...form.getFieldsValue(), billlines: [] }); + form.resetFields(); + form.setFieldsValue({ + ...formValues, + billlines: [], + }); } else { toggleModalVisible(); } From 6c0bf67f3762d559a5c28b337cf042a739f5e5a2 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 9 Feb 2022 14:55:16 -0800 Subject: [PATCH 4/6] IO-1723 Updated job costing. --- .../job-costing-modal.container.jsx | 15 +- .../job-costing-statistics.component.jsx | 8 + server/job/job-costing.js | 192 ++++++++++++------ 3 files changed, 144 insertions(+), 71 deletions(-) diff --git a/client/src/components/job-costing-modal/job-costing-modal.container.jsx b/client/src/components/job-costing-modal/job-costing-modal.container.jsx index cef43bfd0..fd15d6345 100644 --- a/client/src/components/job-costing-modal/job-costing-modal.container.jsx +++ b/client/src/components/job-costing-modal/job-costing-modal.container.jsx @@ -26,11 +26,6 @@ export function JobCostingModalContainer({ const { visible, context } = jobCostingModal; const { jobId } = context; - // const { loading, error, data } = useQuery(QUERY_JOB_COSTING_DETAILS, { - // variables: { id: jobId }, - // skip: !jobId, - // }); - useEffect(() => { async function getData() { if (jobId && visible) { @@ -46,8 +41,14 @@ export function JobCostingModalContainer({ toggleModalVisible()} - onCancel={() => toggleModalVisible()} + onOk={() => { + toggleModalVisible(); + setCostingData(null); + }} + onCancel={() => { + toggleModalVisible(); + setCostingData(null); + }} cancelButtonProps={{ style: { display: "none" } }} width="90%" destroyOnClose diff --git a/client/src/components/job-costing-statistics/job-costing-statistics.component.jsx b/client/src/components/job-costing-statistics/job-costing-statistics.component.jsx index d63a60149..fe73a76ac 100644 --- a/client/src/components/job-costing-statistics/job-costing-statistics.component.jsx +++ b/client/src/components/job-costing-statistics/job-costing-statistics.component.jsx @@ -16,6 +16,10 @@ export default function JobCostingStatistics({ summaryData }) { value={Dinero(summaryData.totalPartsSales).toFormat()} title={t("jobs.labels.sale_parts")} /> + + 0 ? 1 : -1) ); - if (!acc.parts[partsProfitCenter]) - acc.parts[partsProfitCenter] = Dinero(); - acc.parts[partsProfitCenter] = - acc.parts[partsProfitCenter].add(partsAmount); + if (!acc.additional[partsProfitCenter]) + acc.additional[partsProfitCenter] = Dinero(); + acc.additional[partsProfitCenter] = + acc.additional[partsProfitCenter].add(partsAmount); } } return acc; }, - { parts: {}, labor: {} } + { parts: {}, labor: {}, additional: {} } ); if (!hasMapaLine) { - if (!jobLineTotalsByProfitCenter.parts[defaultProfits["MAPA"]]) - jobLineTotalsByProfitCenter.parts[defaultProfits["MAPA"]] = Dinero(); - jobLineTotalsByProfitCenter.parts[defaultProfits["MAPA"]] = - jobLineTotalsByProfitCenter.parts[defaultProfits["MAPA"]].add( + if (!jobLineTotalsByProfitCenter.additional[defaultProfits["MAPA"]]) + jobLineTotalsByProfitCenter.additional[defaultProfits["MAPA"]] = Dinero(); + jobLineTotalsByProfitCenter.additional[defaultProfits["MAPA"]] = + jobLineTotalsByProfitCenter.additional[defaultProfits["MAPA"]].add( Dinero({ amount: Math.round((job.rate_mapa || 0) * 100), }).multiply(materialsHours.mapaHrs || 0) ); } if (!hasMashLine) { - if (!jobLineTotalsByProfitCenter.parts[defaultProfits["MASH"]]) - jobLineTotalsByProfitCenter.parts[defaultProfits["MASH"]] = Dinero(); - jobLineTotalsByProfitCenter.parts[defaultProfits["MASH"]] = - jobLineTotalsByProfitCenter.parts[defaultProfits["MASH"]].add( + if (!jobLineTotalsByProfitCenter.additional[defaultProfits["MASH"]]) + jobLineTotalsByProfitCenter.additional[defaultProfits["MASH"]] = Dinero(); + jobLineTotalsByProfitCenter.additional[defaultProfits["MASH"]] = + jobLineTotalsByProfitCenter.additional[defaultProfits["MASH"]].add( Dinero({ amount: Math.round((job.rate_mash || 0) * 100), }).multiply(materialsHours.mashHrs || 0) @@ -381,54 +401,88 @@ function GenerateCostingData(job) { )) || job.bodyshop.md_responsibility_centers.defaults; - const billTotalsByCostCenters = job.bills.reduce((bill_acc, bill_val) => { - //At the bill level. - bill_val.billlines.map((line_val) => { - //At the bill line level. - if (job.bodyshop.pbs_serialnumber || job.bodyshop.cdk_dealerid) { - if (!bill_acc[selectedDmsAllocationConfig.costs[line_val.cost_center]]) + const billTotalsByCostCenters = job.bills.reduce( + (bill_acc, bill_val) => { + //At the bill level. + bill_val.billlines.map((line_val) => { + //At the bill line level. + if (job.bodyshop.pbs_serialnumber || job.bodyshop.cdk_dealerid) { + if ( + !bill_acc[selectedDmsAllocationConfig.costs[line_val.cost_center]] + ) + bill_acc[selectedDmsAllocationConfig.costs[line_val.cost_center]] = + Dinero(); + bill_acc[selectedDmsAllocationConfig.costs[line_val.cost_center]] = - Dinero(); + bill_acc[ + selectedDmsAllocationConfig.costs[line_val.cost_center] + ].add( + Dinero({ + amount: Math.round((line_val.actual_cost || 0) * 100), + }) + .multiply(line_val.quantity) + .multiply(bill_val.is_credit_memo ? -1 : 1) + ); + } else { + const isAdditionalCostCenter = + // line_val.cost_center === + // job.bodyshop.md_responsibility_centers.defaults.costs.PAS || + // line_val.cost_center === + // job.bodyshop.md_responsibility_centers.defaults.costs.PASL || + line_val.cost_center === + job.bodyshop.md_responsibility_centers.defaults.costs.TOW || + line_val.cost_center === + job.bodyshop.md_responsibility_centers.defaults.costs.MAPA || + line_val.cost_center === + job.bodyshop.md_responsibility_centers.defaults.costs.MASH; - bill_acc[selectedDmsAllocationConfig.costs[line_val.cost_center]] = - bill_acc[selectedDmsAllocationConfig.costs[line_val.cost_center]].add( - Dinero({ - amount: Math.round((line_val.actual_cost || 0) * 100), - }) - .multiply(line_val.quantity) - .multiply(bill_val.is_credit_memo ? -1 : 1) - ); - } else { - if (!bill_acc[line_val.cost_center]) - bill_acc[line_val.cost_center] = Dinero(); + if (isAdditionalCostCenter) { + if (!bill_acc.additionalCosts[line_val.cost_center]) + bill_acc.additionalCosts[line_val.cost_center] = Dinero(); - bill_acc[line_val.cost_center] = bill_acc[line_val.cost_center].add( - Dinero({ - amount: Math.round((line_val.actual_cost || 0) * 100), - }) - .multiply(line_val.quantity) - .multiply(bill_val.is_credit_memo ? -1 : 1) - ); - } + bill_acc.additionalCosts[line_val.cost_center] = + bill_acc.additionalCosts[line_val.cost_center].add( + Dinero({ + amount: Math.round((line_val.actual_cost || 0) * 100), + }) + .multiply(line_val.quantity) + .multiply(bill_val.is_credit_memo ? -1 : 1) + ); + } else { + if (!bill_acc[line_val.cost_center]) + bill_acc[line_val.cost_center] = Dinero(); - return null; - }); - return bill_acc; - }, {}); + bill_acc[line_val.cost_center] = bill_acc[line_val.cost_center].add( + Dinero({ + amount: Math.round((line_val.actual_cost || 0) * 100), + }) + .multiply(line_val.quantity) + .multiply(bill_val.is_credit_memo ? -1 : 1) + ); + } + } + + return null; + }); + return bill_acc; + }, + { additionalCosts: {} } + ); //If the hourly rates for job costing are set, add them in. + if (job.bodyshop.jc_hourly_rates && job.bodyshop.jc_hourly_rates.mapa) { if ( - !billTotalsByCostCenters[ + !billTotalsByCostCenters.additionalCosts[ job.bodyshop.md_responsibility_centers.defaults.costs.MAPA ] ) - billTotalsByCostCenters[ + billTotalsByCostCenters.additionalCosts[ job.bodyshop.md_responsibility_centers.defaults.costs.MAPA ] = Dinero(); - billTotalsByCostCenters[ + billTotalsByCostCenters.additionalCosts[ job.bodyshop.md_responsibility_centers.defaults.costs.MAPA - ] = billTotalsByCostCenters[ + ] = billTotalsByCostCenters.additionalCosts[ job.bodyshop.md_responsibility_centers.defaults.costs.MAPA ].add( Dinero({ @@ -442,16 +496,16 @@ function GenerateCostingData(job) { if (job.bodyshop.jc_hourly_rates && job.bodyshop.jc_hourly_rates.mash) { if ( - !billTotalsByCostCenters[ + !billTotalsByCostCenters.additionalCosts[ job.bodyshop.md_responsibility_centers.defaults.costs.MASH ] ) - billTotalsByCostCenters[ + billTotalsByCostCenters.additionalCosts[ job.bodyshop.md_responsibility_centers.defaults.costs.MASH ] = Dinero(); - billTotalsByCostCenters[ + billTotalsByCostCenters.additionalCosts[ job.bodyshop.md_responsibility_centers.defaults.costs.MASH - ] = billTotalsByCostCenters[ + ] = billTotalsByCostCenters.additionalCosts[ job.bodyshop.md_responsibility_centers.defaults.costs.MASH ].add( Dinero({ @@ -511,9 +565,11 @@ function GenerateCostingData(job) { const summaryData = { totalLaborSales: Dinero({ amount: 0 }), totalPartsSales: Dinero({ amount: 0 }), + totalAdditionalSales: Dinero({ amount: 0 }), totalSales: Dinero({ amount: 0 }), totalLaborCost: Dinero({ amount: 0 }), totalPartsCost: Dinero({ amount: 0 }), + totalAdditionalCost: Dinero({ amount: 0 }), totalCost: Dinero({ amount: 0 }), totalLaborGp: Dinero({ amount: 0 }), totalPartsGp: Dinero({ amount: 0 }), @@ -533,14 +589,16 @@ function GenerateCostingData(job) { jobLineTotalsByProfitCenter.labor[ccVal] || Dinero({ amount: 0 }); const sale_parts = jobLineTotalsByProfitCenter.parts[ccVal] || Dinero({ amount: 0 }); + const sale_additional = + jobLineTotalsByProfitCenter.additional[ccVal] || Dinero({ amount: 0 }); const cost_labor = ticketTotalsByCostCenter[ccVal] || Dinero({ amount: 0 }); const cost_parts = billTotalsByCostCenters[ccVal] || Dinero({ amount: 0 }); + const cost_additional = + billTotalsByCostCenters.additionalCosts[ccVal] || Dinero({ amount: 0 }); - const costs = (billTotalsByCostCenters[ccVal] || Dinero({ amount: 0 })).add( - ticketTotalsByCostCenter[ccVal] || Dinero({ amount: 0 }) - ); - const totalSales = sale_labor.add(sale_parts); + const costs = cost_labor.add(cost_parts).add(cost_additional); + const totalSales = sale_labor.add(sale_parts).add(sale_additional); const gpdollars = totalSales.subtract(costs); const gppercent = ( (gpdollars.getAmount() / totalSales.getAmount()) * @@ -550,11 +608,13 @@ function GenerateCostingData(job) { //Push summary data to avoid extra loop. summaryData.totalLaborSales = summaryData.totalLaborSales.add(sale_labor); summaryData.totalPartsSales = summaryData.totalPartsSales.add(sale_parts); - summaryData.totalSales = summaryData.totalSales - .add(sale_labor) - .add(sale_parts); + summaryData.totalAdditionalSales = + summaryData.totalAdditionalSales.add(sale_additional); + summaryData.totalSales = summaryData.totalSales.add(totalSales); summaryData.totalLaborCost = summaryData.totalLaborCost.add(cost_labor); summaryData.totalPartsCost = summaryData.totalPartsCost.add(cost_parts); + summaryData.totalAdditionalCost = + summaryData.totalAdditionalCost.add(cost_additional); summaryData.totalCost = summaryData.totalCost.add(costs); return { @@ -564,14 +624,18 @@ function GenerateCostingData(job) { sale_labor_dinero: sale_labor, sale_parts: sale_parts && sale_parts.toFormat(), sale_parts_dinero: sale_parts, - sales: sale_labor.add(sale_parts).toFormat(), - sales_dinero: sale_labor.add(sale_parts), + sale_additional: sale_additional && sale_additional.toFormat(), + sale_additional_dinero: sale_additional, + sales: totalSales.toFormat(), + sales_dinero: totalSales, cost_parts: cost_parts && cost_parts.toFormat(), cost_parts_dinero: cost_parts, cost_labor: cost_labor && cost_labor.toFormat(), cost_labor_dinero: cost_labor, - costs: cost_parts.add(cost_labor).toFormat(), - costs_dinero: cost_parts.add(cost_labor), + cost_additional: cost_additional && cost_additional.toFormat(), + cost_additional_dinero: cost_additional, + costs: costs.toFormat(), + costs_dinero: costs, gpdollars_dinero: gpdollars, gpdollars: gpdollars.toFormat(), gppercent: formatGpPercent(gppercent), From 415d6cca29daf8ffe9766d5f6eb5e6659eaf5034 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 9 Feb 2022 15:06:00 -0800 Subject: [PATCH 5/6] IO-1723 Job Costing Additional Items --- bodyshop_translations.babel | 44 ++++++++++++++++++++++- client/src/translations/en_us/common.json | 2 ++ client/src/translations/es/common.json | 2 ++ client/src/translations/fr/common.json | 2 ++ server/job/job-costing.js | 2 ++ 5 files changed, 51 insertions(+), 1 deletion(-) diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 2c77315d4..8948c8daf 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -1,4 +1,4 @@ - +