From 2579558090d1fe1b798883a1b9c7e1bd676c09de Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Tue, 8 Mar 2022 14:47:01 -0800 Subject: [PATCH 1/4] IO-1606 IO-1607 IO-1752 Move towing rates. --- .../job-bills-total.component.jsx | 6 +++--- .../job-reconciliation-modal.component.jsx | 6 +++++- server/job/job-totals.js | 16 +++++++++++----- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/client/src/components/job-bills-total/job-bills-total.component.jsx b/client/src/components/job-bills-total/job-bills-total.component.jsx index 011a9b80f..ef9e0da35 100644 --- a/client/src/components/job-bills-total/job-bills-total.component.jsx +++ b/client/src/components/job-bills-total/job-bills-total.component.jsx @@ -64,9 +64,9 @@ export default function JobBillsTotalComponent({ }) ); - const totalPartsSublet = Dinero(totals.parts.parts.total).add( - Dinero(totals.parts.sublets.total) - ); + const totalPartsSublet = Dinero(totals.parts.parts.total) + .add(Dinero(totals.parts.sublets.total)) + .add(Dinero(totals.additional.towing)); const discrepancy = totalPartsSublet.subtract(billTotals); diff --git a/client/src/components/job-reconciliation-modal/job-reconciliation-modal.component.jsx b/client/src/components/job-reconciliation-modal/job-reconciliation-modal.component.jsx index f817a4e73..cde3abc6c 100644 --- a/client/src/components/job-reconciliation-modal/job-reconciliation-modal.component.jsx +++ b/client/src/components/job-reconciliation-modal/job-reconciliation-modal.component.jsx @@ -18,7 +18,11 @@ export default function JobReconciliationModalComponent({ job, bills }) { .flat() || []; const jobLineData = job.joblines.filter( - (j) => j.part_type !== null && j.part_type !== "PAE" + (j) => + (j.part_type !== null && j.part_type !== "PAE") || + (j.line_desc && + j.line_desc.toLowerCase().includes("towing") && + j.lbr_op === "OP13") ); return ( diff --git a/server/job/job-totals.js b/server/job/job-totals.js index 31dc995a6..f6ef1fda6 100644 --- a/server/job/job-totals.js +++ b/server/job/job-totals.js @@ -418,21 +418,27 @@ function CalculateAdditional(job) { pvrt: null, total: null, }; + ret.towing = Dinero({ + amount: Math.round((job.towing_payable || 0) * 100), + }); ret.additionalCosts = job.joblines .filter((jl) => !jl.removed && IsAdditionalCost(jl)) .reduce((acc, val) => { const lineValue = Dinero({ amount: Math.round((val.act_price || 0) * 100), }).multiply(val.part_qty || 1); - ret.additionalCostItems.push({ key: val.line_desc, total: lineValue }); - return acc.add(lineValue); + + if (val.line_desc.toLowerCase().includes("towing")) { + ret.towing = lineValue; + return acc; + } else { + ret.additionalCostItems.push({ key: val.line_desc, total: lineValue }); + return acc.add(lineValue); + } }, Dinero()); ret.adjustments = Dinero({ amount: Math.round((job.adjustment_bottom_line || 0) * 100), }); - ret.towing = Dinero({ - amount: Math.round((job.towing_payable || 0) * 100), - }); ret.storage = Dinero({ amount: Math.round((job.storage_payable || 0) * 100), }); From 2e2a4920ca5204b83cd4baab77d0e03900ba9e38 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Thu, 10 Mar 2022 10:55:44 -0800 Subject: [PATCH 2/4] IO-1772 Add label for no vehicle info. --- bodyshop_translations.babel | 23 ++++++++++++++++++- .../jobs-detail-header.component.jsx | 13 ++++++++--- client/src/translations/en_us/common.json | 1 + client/src/translations/es/common.json | 1 + client/src/translations/fr/common.json | 1 + 5 files changed, 35 insertions(+), 4 deletions(-) diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index b94eb957c..fb5525ca5 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -1,4 +1,4 @@ - +