Add admin feature, extended SUVs and correct age 7 vehicles.
This commit is contained in:
@@ -37,27 +37,60 @@ ipcMain.on(ipcTypes.default.audit.toMain.runAudit, async (event, { sheetName })
|
||||
const detailSheet = obj.find((sheet) => sheet.name === sheetName);
|
||||
const claimsArray = [];
|
||||
let foundHeaderRow, foundTotalRow;
|
||||
|
||||
let clmIndex,
|
||||
close_dateIndex,
|
||||
v_model_yrIndex,
|
||||
v_makedescIndex,
|
||||
v_modelIndex,
|
||||
under20kmilesIndex,
|
||||
pan_totalIndex,
|
||||
paa_totalIndex,
|
||||
pal_totalIndex,
|
||||
pam_totalIndex,
|
||||
eligible_db_price_totalIndex,
|
||||
eligible_act_price_totalIndex,
|
||||
expected_rps_dollarsIndex,
|
||||
actual_rps_dollarsIndex;
|
||||
|
||||
detailSheet.data.forEach((line) => {
|
||||
//Check the first element. If it's claim number, we have our header row. the next one is important.
|
||||
if (!foundHeaderRow && line[0] === "Claim Number") {
|
||||
foundHeaderRow = true;
|
||||
//Set all of the indexes to match the titles.
|
||||
|
||||
clmIndex = line.findIndex((l) => l === "Claim Number");
|
||||
close_dateIndex = line.findIndex((l) => l === "Ready for Pay Date");
|
||||
v_model_yrIndex = line.findIndex((l) => l === "Vehicle Year");
|
||||
v_makedescIndex = line.findIndex((l) => l === "Vehicle Make");
|
||||
v_modelIndex = line.findIndex((l) => l === "Vehicle Model");
|
||||
under20kmilesIndex = line.findIndex((l) => l === "Under 20K");
|
||||
pan_totalIndex = line.findIndex((l) => l === "OE Part Prices");
|
||||
paa_totalIndex = line.findIndex((l) => l === "AM Part Prices");
|
||||
pal_totalIndex = line.findIndex((l) => l === "Recycled Part Prices");
|
||||
pam_totalIndex = line.findIndex((l) => l === "Reman & Other Part Prices");
|
||||
eligible_db_price_totalIndex = line.findIndex((l) => l === "(a) Eligible OEM Part Prices");
|
||||
eligible_act_price_totalIndex = line.findIndex((l) => l === "(b) Eligible Actual Part Prices");
|
||||
expected_rps_dollarsIndex = line.findIndex((l) => l === "(e) Expected RPS $ ");
|
||||
actual_rps_dollarsIndex = line.findIndex((l) => l === "(f) Actual RPS $");
|
||||
} else if (foundHeaderRow && !foundTotalRow && line[0] && line[0] !== "Grand Total") {
|
||||
//Add it to the array
|
||||
|
||||
const row = {
|
||||
clm_no: line[0].startsWith("00") ? line[0].slice(2) : line[0],
|
||||
close_date: line[1],
|
||||
v_model_yr: line[3],
|
||||
v_makedesc: line[4],
|
||||
v_model: line[5],
|
||||
under20kmiles: line[6],
|
||||
pan_total: line[7],
|
||||
paa_total: line[8],
|
||||
pal_total: line[9],
|
||||
pam_total: line[10],
|
||||
eligible_db_price_total: Math.round((line[11] + Number.EPSILON) * 100) / 100,
|
||||
eligible_act_price_total: Math.round((line[12] + Number.EPSILON) * 100) / 100,
|
||||
expected_rps_dollars: Math.round((line[15] + Number.EPSILON) * 100) / 100,
|
||||
actual_rps_dollars: Math.round((line[16] + Number.EPSILON) * 100) / 100
|
||||
clm_no: line[clmIndex].startsWith("00") ? line[clmIndex].slice(2) : line[clmIndex],
|
||||
close_date: line[close_dateIndex],
|
||||
v_model_yr: line[v_model_yrIndex],
|
||||
v_makedesc: line[v_makedescIndex],
|
||||
v_model: line[v_modelIndex],
|
||||
under20kmiles: line[under20kmilesIndex],
|
||||
pan_total: line[pan_totalIndex],
|
||||
paa_total: line[paa_totalIndex],
|
||||
pal_total: line[pal_totalIndex],
|
||||
pam_total: line[pam_totalIndex],
|
||||
eligible_db_price_total: Math.round((line[eligible_db_price_totalIndex] + Number.EPSILON) * 100) / 100,
|
||||
eligible_act_price_total: Math.round((line[eligible_act_price_totalIndex] + Number.EPSILON) * 100) / 100,
|
||||
expected_rps_dollars: Math.round((line[expected_rps_dollarsIndex] + Number.EPSILON) * 100) / 100,
|
||||
actual_rps_dollars: Math.round((line[actual_rps_dollarsIndex] + Number.EPSILON) * 100) / 100
|
||||
};
|
||||
claimsArray.push(row);
|
||||
} else {
|
||||
|
||||
@@ -183,5 +183,10 @@
|
||||
"title": "Release Notes for 1.3.4",
|
||||
"date": "10/11/2024",
|
||||
"notes": "Bug Fix\n*Fix typos on application labels."
|
||||
},
|
||||
"1.3.5": {
|
||||
"title": "Release Notes for 1.3.5",
|
||||
"date": "TBD",
|
||||
"notes": "Bug Fix\n*Fix typos on application labels."
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user