SGI Price Match Rule Change

RPS Price Match
This commit is contained in:
Allan Carr
2026-05-26 16:24:58 -07:00
parent 95ef21c1ae
commit 972b399ba8
3 changed files with 64 additions and 50 deletions

View File

@@ -596,9 +596,22 @@ function V3Ruleset(jobline, joblines) {
}
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) {
// RPS-39 - OEM ON OEM SAVINGS
// Verified on 08/24/21
// 2026-05-26 Added Parts Price Match logic for SGI
const hasPriceMatch = joblines.some(
(l) =>
String(l.line_ref) === String(jobline.unq_seq) &&
l.db_ref === "900501" &&
l.line_desc.toLowerCase().includes("rps price match")
);
if (
jobline.part_type === "PAN" &&
jobline.db_price !== jobline.act_price &&
jobline.db_price !== 0 &&
!hasPriceMatch
) {
jobline.db_price = jobline.act_price;
}