diff --git a/electron/changelog.json b/electron/changelog.json index 8605a7c..fda911f 100644 --- a/electron/changelog.json +++ b/electron/changelog.json @@ -208,5 +208,10 @@ "title": "Release Notes for 1.5.0", "date": "10/29/2025", "notes": "New Features:\r\n* Direct integration to Estimate Scrubber is now available in Public Beta. Existing customers should automatically have access to this feature. If you encounter any issues, please reach out to support.\r\n* Added a quantity toggle to use line quantity instead of assuming 1 per MPI guidelines for RPS calculations.\r\n* Added date shortcuts to the report page for ease of use.\r\n* Added a floating shortcut to run 1 month and 3 month reports.\r\n\r\nImprovements:\r\n* Added better indicators for quantities and negative RPS values." + }, + "1.6.0-beta.2": { + "title": "Release Notes for 1.6.0-beta.2", + "date": "05/04/2026", + "notes": "New Features:\r\n* Added projected targets for SGI claims.\r\n" } } diff --git a/electron/decoder/decoder.js b/electron/decoder/decoder.js index 3958122..88b19f4 100644 --- a/electron/decoder/decoder.js +++ b/electron/decoder/decoder.js @@ -395,8 +395,10 @@ async function DecodeLinFile(extensionlessFilePath, close_date) { joblines.map((jobline) => { jobline.ignore = false; switch (ins_rule_set) { - case "MPI": case "SGI": + jobline = SGI_V1Ruleset(jobline, joblines); + break; + case "MPI": const rulesetToApply = WhichRulesetToApply(close_date); switch (rulesetToApply) { @@ -593,6 +595,101 @@ function V3Ruleset(jobline, joblines) { return jobline; } +function SGI_V1Ruleset(jobline, joblines) { + //RPS-39 - OEM ON OEM SAVINGS + //Verified on 08/24/21 + if (jobline.part_type === "PAN" && jobline.db_price !== jobline.act_price && jobline.db_price !== 0) { + jobline.db_price = jobline.act_price; + } + + //Remove all $0DB line items 02/17/2022. + if ( + (jobline.part_type === "PAA" || jobline.part_type === "PAL" || jobline.part_type === "PAN") && + jobline.db_price === 0 + ) { + jobline.ignore = true; + } + + //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. + // 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 && jobline.price_j) { + log.info(`Jobline '${jobline.line_desc}' ignored because it was manually changed to 0..`); + 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,6}[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") || + jobline.line_desc.toLowerCase().startsWith("urethane") || + jobline.line_desc.toLowerCase().startsWith("w/shield adhesive") || + //jobline.line_desc.toLowerCase().includes("wheel") || Removed as a part of RPS-41 + (jobline.line_desc.toLowerCase().includes("tire") && + !jobline.line_desc.toLowerCase().includes("sensor") && + !jobline.line_desc.toLowerCase().includes("label")) || + jobline.line_desc.toLowerCase().startsWith("hazardous") || + jobline.line_desc.toLowerCase().startsWith("detail") || + jobline.line_desc.toLowerCase().startsWith("clean") || + // jobline.part_type.toUpperCase() === "PAG" ||Removed for RPS-43. + jobline.part_type.toUpperCase() === "PAS" || + jobline.part_type.toUpperCase() === "PASL" || + jobline.part_type.toUpperCase() === "PAE" + //jobline.glass_flag === true //Removed for RPS-43. + ) { + 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; + //Calculate the discount to be added as a negative. + jobline.act_price = jobline.prt_dsmk_m; + //Check to see if the parent line has a discount. + const parentLine = joblines.find((r) => parseInt(r.unq_seq) === jobline.line_ref); + if (parentLine && parentLine.ignore) { + jobline.ignore = true; + } + } + + //RPS-42 Dynamic Inclusion or Exclusion of Lines based on RPS-EXCLUDE or RPS. + if (jobline.oem_partno.toLowerCase().includes("/rps-exclude")) { + jobline.ignore = true; + } else if (jobline.oem_partno.toLowerCase().includes("/rps")) { + jobline.ignore = false; + } + //Copy of SGI V2 - duplicated to prevent impacts to MPI. + //Remove any glass related items. + if (jobline.mod_lbr_ty?.toUpperCase() === "LAG") { + jobline.ignore = true; + } + + //ADAS Part Line + if ( + AdasDescriptions.some((d) => { + const ret = jobline.line_desc.toLowerCase().includes(d); + return ret; + }) + ) { + jobline.ignore = true; + } + //Additional glass line exclusions + if (v2GlassLines.some((d) => jobline.line_desc.toLowerCase().includes(d))) { + jobline.ignore = true; + } + + return jobline; +} + const AdasDescriptions = [ "seat belt", "air bag bolt", diff --git a/package.json b/package.json index c800150..cbc2d45 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "productName": "ImEX RPS", "author": "ImEX Systems Inc. ", "description": "ImEX RPS", - "version": "1.6.0-alpha.9", + "version": "1.6.0-beta.2", "main": "electron/main.js", "homepage": "./", "dependencies": {