From 404b69cbc7cf1a1f74eaf1d81e600692adc63bb1 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 13 Sep 2021 15:36:58 -0700 Subject: [PATCH] RPS-85 Ignore NAGS lines. --- electron/decoder/decoder.js | 32 +++++++++++-------- .../jobs-detail-description.molecule.jsx | 3 ++ .../jobs-lines-table.molecule.jsx | 13 -------- .../jobs-targets-stats.molecule.jsx | 14 +++++++- .../sider-menu/sider-menu.organism.jsx | 7 ++-- 5 files changed, 38 insertions(+), 31 deletions(-) diff --git a/electron/decoder/decoder.js b/electron/decoder/decoder.js index 19dbfee..6d04519 100644 --- a/electron/decoder/decoder.js +++ b/electron/decoder/decoder.js @@ -390,6 +390,7 @@ async function DecodeLinFile(extensionlessFilePath) { jobline.ignore = false; //Wheel Repair Pricing PRS-82 + //Verified on 08/24/21 if ( jobline.part_type === "PAN" && jobline.line_desc.toLowerCase().includes("wheel") && @@ -411,6 +412,7 @@ async function DecodeLinFile(extensionlessFilePath) { // } //RPS-39 - OEM ON OEM SAVINGS + //Verified on 08/24/21 if ( jobline.part_type === "PAN" && jobline.db_price !== jobline.act_price @@ -419,7 +421,7 @@ async function DecodeLinFile(extensionlessFilePath) { } //$0DB price for aftermarket and recycled parts. RPS-83 - //Norm to double check. + //Verified on 08/24/21 if ( (jobline.part_type === "PAA" || jobline.part_type === "PAL") && jobline.db_price === 0 && @@ -429,8 +431,10 @@ async function DecodeLinFile(extensionlessFilePath) { } //05/20 - //We’ll have to apply a rule that will not count any A/M, Reman or new part price that is manually changed to $0.00. Only recycled parts that are changed to $0.00 can be counted towards RPS. + //We’ll have to apply a rule that will not count any A/M, Reman or new part price that is manually changed to $0.00. + //Only recycled parts that are changed to $0.00 can be counted towards RPS. // This is separate from $0.00 DB prices that need to be updated to the manually entered price. + //Verified on 08/24/21 if ( jobline.part_type !== "PAL" && jobline.act_price === 0 && @@ -442,22 +446,22 @@ async function DecodeLinFile(extensionlessFilePath) { jobline.ignore = true; } - // if ( - // !!jobline.db_price && - // jobline.db_price > 0 && - // !!jobline.act_price && - // jobline.act_price > jobline.db_price - // ) { - // //Actual price should never be higher than the DB Price. - // jobline.db_price = jobline.act_price; - // } - - //Update as per Norm from Rod & Waldo - Only Recycled Glass should count towards RPS, not A/M or OEM + //08/24/21 - Norm to take as action item to determine what the final set of rules were per Derek. if (jobline.glass_flag && jobline.part_type !== "PAL") { jobline.ignore = true; } + //09/2021 Detect NAGS lines using RegEx for the Part Number + if ( + jobline.line_desc.toLowerCase().includes("glass") && + jobline.oem_partno.match(`[A-Z]{2}[0-9]{5}[A-Z]{3}`) + ) { + console.log(jobline.line_desc, "NAGS Line ignored"); + jobline.ignore = true; + } + //Logic Based Exclusions. + //Verified on 08/24/21 if ( !jobline.part_type || jobline.db_ref.startsWith("900") || @@ -475,10 +479,10 @@ async function DecodeLinFile(extensionlessFilePath) { ) { jobline.ignore = true; } + //Check to see if this is a discount line i.e. a 900511 if (jobline.db_ref === "900511" && jobline.prt_dsmk_p !== 50) { jobline.ignore = false; - console.log("dsmk_d", jobline.prt_dsmk_p); //Calculate the discount to be added as a negative. jobline.act_price = jobline.prt_dsmk_m; } diff --git a/src/components/molecules/jobs-detail-description/jobs-detail-description.molecule.jsx b/src/components/molecules/jobs-detail-description/jobs-detail-description.molecule.jsx index 413b611..f29cdb9 100644 --- a/src/components/molecules/jobs-detail-description/jobs-detail-description.molecule.jsx +++ b/src/components/molecules/jobs-detail-description/jobs-detail-description.molecule.jsx @@ -57,6 +57,9 @@ export default function JobsDetailDescriptionMolecule({ loading, job }) { {job.updated_at} + + {job && job.joblines.filter((i) => !i.ignore).length} + diff --git a/src/components/molecules/jobs-lines-table/jobs-lines-table.molecule.jsx b/src/components/molecules/jobs-lines-table/jobs-lines-table.molecule.jsx index 735db1e..64ba33a 100644 --- a/src/components/molecules/jobs-lines-table/jobs-lines-table.molecule.jsx +++ b/src/components/molecules/jobs-lines-table/jobs-lines-table.molecule.jsx @@ -169,19 +169,6 @@ export default function JobLinesTableMolecule({ loading, job }) { x: true, y: "20rem", }} - // summary={ - // () => ( - // - // Summary - // - // This is a summary content - // - // - // This is a summary content - // - // - // ) - // } /> ); diff --git a/src/components/molecules/jobs-targets-stats/jobs-targets-stats.molecule.jsx b/src/components/molecules/jobs-targets-stats/jobs-targets-stats.molecule.jsx index 9c2fb17..f027aed 100644 --- a/src/components/molecules/jobs-targets-stats/jobs-targets-stats.molecule.jsx +++ b/src/components/molecules/jobs-targets-stats/jobs-targets-stats.molecule.jsx @@ -45,6 +45,9 @@ export function JobsTargetsStatsMolecule({ errorMessage="It looks like this job doesn't exist." /> ); + + const targetRpsDollars = dbPriceSum.percentage(selectedJobTargetPc * 100); + const dollarDiff = jobRpsDollars.subtract(targetRpsDollars); return (
+
}> Settings - + + } + key="3" style={{ color: "tomato" }} + icon={} onClick={() => { ipcRenderer.send(ipcTypes.default.quit); }}