diff --git a/electron/changelog.json b/electron/changelog.json index 5895fe7..d25e050 100644 --- a/electron/changelog.json +++ b/electron/changelog.json @@ -92,6 +92,6 @@ "1.0.27": { "title": "Release Notes for 1.0.27", "date": "TBD", - "notes": "Bug Fix: \n- Improved handling of company names coming from Mitchell Cloud Estimating." + "notes": "Bug Fix: \n- Improved handling $0 DB items from Mitchell Cloud Estimating.\n- Adjusted handling of part quantities during calculation.\n- Removed line discounts from count of RPS eligible parts in header.\n- Added automatic exlcusion for -02 estimates." } } diff --git a/electron/decoder/decoder.js b/electron/decoder/decoder.js index 1985155..b7fa4b9 100644 --- a/electron/decoder/decoder.js +++ b/electron/decoder/decoder.js @@ -70,10 +70,15 @@ async function DecodeEstimate(filePath, includeFilePathInReturnJob = false) { })`, }; } else if (!job.CLM_NO) { - log.info("Job ignored. No claim #. " + job.clm_no); + log.info("Job ignored. No claim #. "); returnValue = { ERROR: `An unique claim number must be set for all jobs sent to RPS.`, }; + } else if (job.CLM_NO.match("02$")) { + log.info("Job ignored. This is an -02 claim. Claim #. " + job.CLM_NO); + returnValue = { + ERROR: "Job ignored. This is an -02 claim. Claim #. " + job.CLM_NO, + }; } else { returnValue = _.transform(job, function (result, val, key) { result[key.toLowerCase()] = val; @@ -361,19 +366,20 @@ async function DecodeLinFile(extensionlessFilePath) { // Appears you are calculating based on ‘N.A.’ part values in the Mitchell database. // Reminder – if Mitchell DB has $0.00 price updates can be tracked, if it has N.A. it cannot calculate RPS value. - if ( - (jobline.db_price === null || jobline.db_price === 0) && - !!jobline.act_price && - jobline.act_price > 0 - ) { - // log.info( - // "DB Price null/lower than act price", - // jobline.line_desc, - // jobline.db_price, - // jobline.act_price - // ); - jobline.db_price = jobline.act_price; - } + //Removed as a part of $0db removal on 12/17/2022. + // if ( + // (jobline.db_price === null || jobline.db_price === 0) && + // !!jobline.act_price && + // jobline.act_price > 0 + // ) { + // // log.info( + // // "DB Price null/lower than act price", + // // jobline.line_desc, + // // jobline.db_price, + // // jobline.act_price + // // ); + // jobline.db_price = jobline.act_price; + // } //*****TODO LINE**** //Any PAL, Remanufactured, Recycled, Aftermarket, Used, @@ -414,18 +420,22 @@ 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) { + if ( + jobline.part_type === "PAN" && + jobline.db_price !== jobline.act_price && + jobline.db_price !== 0 + ) { jobline.db_price = jobline.act_price; } - //$0DB price for aftermarket and recycled parts. RPS-83 - //Verified on 08/24/21 + //Remove all $0DB line items 02/17/2022. if ( - (jobline.part_type === "PAA" || jobline.part_type === "PAL") && - jobline.db_price === 0 && - jobline.db_price !== jobline.act_price + (jobline.part_type === "PAA" || + jobline.part_type === "PAL" || + jobline.part_type === "PAN") && + jobline.db_price === 0 ) { - jobline.db_price = jobline.act_price; + jobline.ignore = true; } //05/20 diff --git a/src/components/atoms/jobs-parts-graph/jobs-parts-graph.atom.jsx b/src/components/atoms/jobs-parts-graph/jobs-parts-graph.atom.jsx index 2213976..121b28b 100644 --- a/src/components/atoms/jobs-parts-graph/jobs-parts-graph.atom.jsx +++ b/src/components/atoms/jobs-parts-graph/jobs-parts-graph.atom.jsx @@ -20,9 +20,10 @@ export default function JobPartsGraphAtom({ } acc[val.part_type] = acc[val.part_type].add( - Dinero({ amount: Math.round((val[price] || 0) * 100) }).multiply( - val.part_qty || 1 - ) + Dinero({ amount: Math.round((val[price] || 0) * 100) }) + // .multiply( + // val.part_qty || 1 + // ) ); return acc; 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 f29cdb9..03f4e1c 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 @@ -58,7 +58,9 @@ export default function JobsDetailDescriptionMolecule({ loading, job }) { {job.updated_at} - {job && job.joblines.filter((i) => !i.ignore).length} + {job && + job.joblines.filter((i) => !i.ignore && i.db_ref !== "900511") + .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 64ba33a..863e7d2 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 @@ -117,7 +117,7 @@ export default function JobLinesTableMolecule({ loading, job }) { key: "ignore", filters: [ { text: "Eligible for RPS Calculation", value: false }, - { text: "Ineligible RPS Calculation", value: true }, + { text: "Ineligible for RPS Calculation", value: true }, ], width: "5%", filteredValue: filters.ignore || null, diff --git a/src/graphql/jobs.queries.js b/src/graphql/jobs.queries.js index 0c2bc0c..6a73331 100644 --- a/src/graphql/jobs.queries.js +++ b/src/graphql/jobs.queries.js @@ -111,6 +111,7 @@ export const QUERY_JOB_BY_PK = gql` price_diff price_diff_pc ignore + db_ref } } } diff --git a/src/ipc/cargovans.json b/src/ipc/cargovans.json index 51a03d8..f2c8e79 100644 --- a/src/ipc/cargovans.json +++ b/src/ipc/cargovans.json @@ -68,6 +68,7 @@ "SAVANA 1500 SL", "SAVANA 1500 SLE", "SAVANA 2500", + "2500 SAVANA", "SAVANA 2500 CARGO VAN", "SAVANA 2500 CARGO VAN EXT", "SAVANA 2500 LT", diff --git a/src/util/CalculateJobRps.js b/src/util/CalculateJobRps.js index 606574f..3696241 100644 --- a/src/util/CalculateJobRps.js +++ b/src/util/CalculateJobRps.js @@ -9,15 +9,17 @@ export function CalculateJobRpsDollars(job, returnSumActPrice) { .filter((j) => !j.ignore) .reduce((acc, val) => { actPriceSum = actPriceSum.add( - Dinero({ amount: Math.round((val.act_price || 0) * 100) }).multiply( - val.part_qty || 1 - ) + Dinero({ amount: Math.round((val.act_price || 0) * 100) }) + // .multiply( + // val.part_qty || 1 + // ) ); // if (val.price_diff > 0) { // return acc.add( - Dinero({ amount: Math.round((val.price_diff || 0) * 100) }).multiply( - val.part_qty || 1 - ) + Dinero({ amount: Math.round((val.price_diff || 0) * 100) }) + // .multiply( + // val.part_qty || 1 + // ) ); // } else { // return acc; @@ -39,9 +41,10 @@ export function CalculateJobRpsPc( .filter((j) => !j.ignore) .reduce((acc, val) => { return acc.add( - Dinero({ amount: Math.round((val.db_price || 0) * 100) }).multiply( - val.part_qty || 1 - ) + Dinero({ amount: Math.round((val.db_price || 0) * 100) }) + // .multiply( + // val.part_qty || 1 + // ) ); }, Dinero());