$0DB Updates, quantity ignore.

This commit is contained in:
Patrick Fic
2022-02-17 09:17:00 -08:00
parent 9b64d90361
commit 54d4625a6a
8 changed files with 54 additions and 36 deletions

View File

@@ -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."
}
}

View File

@@ -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

View File

@@ -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;

View File

@@ -58,7 +58,9 @@ export default function JobsDetailDescriptionMolecule({ loading, job }) {
<TimeAgoFormatter>{job.updated_at}</TimeAgoFormatter>
</Descriptions.Item>
<Descriptions.Item label="# RPS Eligible Parts">
{job && job.joblines.filter((i) => !i.ignore).length}
{job &&
job.joblines.filter((i) => !i.ignore && i.db_ref !== "900511")
.length}
</Descriptions.Item>
</Descriptions>
</PageHeader>

View File

@@ -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,

View File

@@ -111,6 +111,7 @@ export const QUERY_JOB_BY_PK = gql`
price_diff
price_diff_pc
ignore
db_ref
}
}
}

View File

@@ -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",

View File

@@ -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());