Uncomment ProManager calculations.

This commit is contained in:
Patrick Fic
2024-04-04 20:01:47 -07:00
parent a43134511b
commit 7ece1256f2

View File

@@ -592,32 +592,35 @@ function ResolveCCCLineIssues(estData, bodyshop) {
//Group by line no
// For everything but the first one, strip out the price number in
// InstanceRenderManager({executeFunction:true, args:[], promanager: () => {
// const groupedByLineRef = _.groupBy(estData.joblines.data, "line_ref");
// Object.keys(groupedByLineRef).forEach((lineRef) => {
// let index0ActPrice;
// groupedByLineRef[lineRef].forEach((line, index) => {
// //Let the first one keep it
// if (index === 0){
// index0ActPrice = line.act_price;
// return;}
// //Web Est seems to have additional costs with UNQ_SEQ 0. Keep them all?
// if (line.unq_seq === 0) return;
// if(index0ActPrice !== line.act_price){
// line.notes += ` | Price override.`;
// return;
// }
// const indexInEstData = estData.joblines.data.findIndex(
// (l) => l.unq_seq === line.unq_seq
// );
// estData.joblines.data[
// indexInEstData
// ].notes += ` | Scrubbed due to the line_ref issue. (prev act price = ${estData.joblines.data[indexInEstData].act_price})`;
// estData.joblines.data[indexInEstData].act_price = 0;
// estData.joblines.data[indexInEstData].db_price = 0;
// });
// })
// }})
InstanceRenderManager({
executeFunction: true,
args: [],
promanager: () => {
const groupedByLineRef = _.groupBy(estData.joblines.data, "line_ref");
Object.keys(groupedByLineRef).forEach((lineRef) => {
let index0ActPrice;
groupedByLineRef[lineRef].forEach((line, index) => {
//Let the first one keep it
if (index === 0) {
index0ActPrice = line.act_price;
return;
}
//Web Est seems to have additional costs with UNQ_SEQ 0. Keep them all?
if (line.unq_seq === 0) return;
if (index0ActPrice !== line.act_price) {
line.notes += ` | Price override.`;
return;
}
const indexInEstData = estData.joblines.data.findIndex((l) => l.unq_seq === line.unq_seq);
estData.joblines.data[
indexInEstData
].notes += ` | Scrubbed due to the line_ref issue. (prev act price = ${estData.joblines.data[indexInEstData].act_price})`;
estData.joblines.data[indexInEstData].act_price = 0;
estData.joblines.data[indexInEstData].db_price = 0;
});
});
}
});
InstanceRenderManager({
executeFunction: true,