From 719fa6a67d5e96225b1c13ccb68dad765d598696 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 11 Apr 2024 09:23:20 -0700 Subject: [PATCH] ProMan totals changes. --- .../jobs-available-table.container.jsx | 54 ++++++++++--------- server/job/job-totals-USA.js | 3 +- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/client/src/components/jobs-available-table/jobs-available-table.container.jsx b/client/src/components/jobs-available-table/jobs-available-table.container.jsx index a8784fda8..5e7681853 100644 --- a/client/src/components/jobs-available-table/jobs-available-table.container.jsx +++ b/client/src/components/jobs-available-table/jobs-available-table.container.jsx @@ -592,32 +592,34 @@ function ResolveCCCLineIssues(estData, bodyshop) { //Group by line no // For everything but the first one, strip out the price number in - // InstanceRenderManager({executeFunction:true, args:[], promanager: () => { - // const groupedByLineRef = _.groupBy(estData.joblines.data, "line_ref"); - // Object.keys(groupedByLineRef).forEach((lineRef) => { - // let index0ActPrice; - // groupedByLineRef[lineRef].forEach((line, index) => { - // //Let the first one keep it - // if (index === 0){ - // index0ActPrice = line.act_price; - // return;} - // //Web Est seems to have additional costs with UNQ_SEQ 0. Keep them all? - // if (line.unq_seq === 0) return; - // if(index0ActPrice !== line.act_price){ - // line.notes += ` | Price override.`; - // return; - // } - // const indexInEstData = estData.joblines.data.findIndex( - // (l) => l.unq_seq === line.unq_seq - // ); - // estData.joblines.data[ - // indexInEstData - // ].notes += ` | Scrubbed due to the line_ref issue. (prev act price = ${estData.joblines.data[indexInEstData].act_price})`; - // estData.joblines.data[indexInEstData].act_price = 0; - // estData.joblines.data[indexInEstData].db_price = 0; - // }); - // }) - // }}) + InstanceRenderManager({ + executeFunction: true, + args: [], + promanager: () => { + const groupedByLineRef = _.groupBy(estData.joblines.data, "line_ref"); + Object.keys(groupedByLineRef).forEach((lineRef) => { + let index0ActPrice; + groupedByLineRef[lineRef].forEach((line, index) => { + //Let the first one keep it + if (index === 0) { + index0ActPrice = line.act_price; + return; + } + //Web Est seems to have additional costs with UNQ_SEQ 0. Keep them all? + if (line.unq_seq === 0) return; + if (index0ActPrice !== line.act_price) { + // line.notes += ` | Price override.`; + return; + } + const indexInEstData = estData.joblines.data.findIndex((l) => l.unq_seq === line.unq_seq); + //estData.joblines.data[indexInEstData].notes += + // ` | Act Price delete. (prev act price = ${estData.joblines.data[indexInEstData].act_price})`; + estData.joblines.data[indexInEstData].act_price = 0; + estData.joblines.data[indexInEstData].db_price = 0; + }); + }); + } + }); InstanceRenderManager({ executeFunction: true, diff --git a/server/job/job-totals-USA.js b/server/job/job-totals-USA.js index 700ea451d..7617099ff 100644 --- a/server/job/job-totals-USA.js +++ b/server/job/job-totals-USA.js @@ -924,9 +924,8 @@ function CalculateTaxesTotals(job, otherTotals) { if ( thresholdAmount === 9999.99 || InstanceMgr({ - debug: true, imex: false, - rome: false, + rome: thresholdAmount === 0 && parseInt(tyCounter) === 1, promanager: thresholdAmount === 0 && parseInt(tyCounter) === 1 }) ) {