New fix for NA mitchell items. RPS-46. Fixed vehicle age bug RPS-51

This commit is contained in:
Patrick Fic
2020-11-18 15:10:45 -08:00
parent b057f50579
commit 6ecdcefe92
7 changed files with 53 additions and 26 deletions

View File

@@ -1,13 +1,5 @@
New Features:
- Vehicles with mileage under 20,000kms will now be included in Watcher filtering criteria.
- Savings on OEM parts will always default to the user enter price and override the estimating system price.
- Wheel related lines will no longer be automatically ignored.
- Glass related lines will no longer be automatically ignored.
- Added 'Variance %' statistic to reporting totals.
- Automatically ignore any lines which have invalid prices from estimating system.
- Force line inclusion/exclusion - Using “ /rps-exclude” or “/rps” in the Part Number field to force inclusion or exclusion of lines for RPS calculation.
- Added automatic update checks every 30 minutes.
-
Bug Fixes:
- Resolved an issue where the updater would not show update progress to some users.
- Fixed a UI bug during job search that would cause the 'no close date' alert to be incorrectly shown.
- Resolved an issue where N/A prices were being incorrectly included.

View File

@@ -298,9 +298,9 @@ async function DecodeLinFile(extensionlessFilePath) {
// "TAX_PART",
"DB_PRICE",
"ACT_PRICE",
// "PRICE_J",
// "CERT_PART",
"PART_QTY",
"PRICE_J",
// "CERT_PART",
// "ALT_CO_ID",
// "ALT_PARTNO",
// "ALT_OVERRD",
@@ -372,6 +372,15 @@ async function DecodeLinFile(extensionlessFilePath) {
// jobline.db_price = jobline.act_price;
// }
//RPS-46 Ignore NA Line Items.
if (
jobline.part_type === "PAN" &&
jobline.price_j === true &&
jobline.db_price === 0
) {
jobline.ignore = true;
}
//RPS-39 - OEM ON OEM SAVINGS
if (
jobline.part_type === "PAN" &&
@@ -403,9 +412,8 @@ async function DecodeLinFile(extensionlessFilePath) {
// 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.part_type.toUpperCase() === "PAE"
//jobline.glass_flag === true //Removed for RPS-43.
jobline.db_price === 0 //Added as a part of RPS-46.
)
jobline.ignore = true;
@@ -416,7 +424,10 @@ async function DecodeLinFile(extensionlessFilePath) {
jobline.ignore = false;
}
console.log("jobline", jobline);
delete jobline.glass_flag;
delete jobline.price_j;
return jobline;
});

View File

@@ -295,10 +295,12 @@ ipcMain.on(ipcTypes.app.toMain.checkForUpdates, (event, args) => {
});
ipcMain.on(ipcTypes.app.toMain.downloadUpdates, (event, args) => {
Nucleus.track("DOWNLOAD_UPDATE_FROM_RENDERER");
autoUpdater.downloadUpdate();
});
ipcMain.on(ipcTypes.app.toMain.installUpdates, (event, args) => {
Nucleus.track("INSTALL_UPDATE_FROM_RENDERER");
const isSilent = true;
const isForceRunAfter = true;
autoUpdater.quitAndInstall(isSilent, isForceRunAfter);
@@ -313,24 +315,24 @@ autoUpdater.on("update-downloaded", (ev, info) => {
Nucleus.track("UPDATE_DOWNLOADED", ev);
// if (process.env.NODE_ENV === "production") {
dialog.showMessageBox(
{
dialog
.showMessageBox({
type: "info",
title: "ImeX RPS Update Manager",
message: `ImEX RPS is ready to update to Version ${ev.version}. It is highly recommended that you update immediately. Would you like to update now? RPS will automatically restart.`,
buttons: ["Yes", "No"],
},
(buttonIndex) => {
if (buttonIndex === 0) {
})
.then(({ response }) => {
log.log("The button worked.", response);
if (response === 0) {
const isSilent = true;
const isForceRunAfter = true;
store.set("showChangeLog", true);
autoUpdater.quitAndInstall(isSilent, isForceRunAfter);
} else {
logger.error("Error");
log.warn("Updated ignored.");
}
}
);
});
});
async function checkForUpdates() {
try {

View File

@@ -20,7 +20,9 @@ export default function JobPartsGraphAtom({
}
acc[val.part_type] = acc[val.part_type].add(
Dinero({ amount: Math.round((val[price] || 0) * 100) })
Dinero({ amount: Math.round((val[price] || 0) * 100) }).multiply(
val.part_qty || 1
)
);
return acc;

View File

@@ -60,6 +60,13 @@ export default function JobLinesTableMolecule({ loading, job }) {
width: "15%",
sorter: (a, b) => alphaSort(a.oem_partno, b.oem_partno),
},
{
title: "Qty.",
dataIndex: "part_qty",
key: "part_qty",
width: "5%",
sorter: (a, b) => a.part_qty - b.part_qty,
},
{
title: "Database Price",
dataIndex: "db_price",

View File

@@ -17,6 +17,9 @@ export async function UpsertEstimate(job) {
logger.info("Beginning Upserting job from Renderer.");
const parsedYr = parseInt(job.v_model_yr);
logger.info(
"Job Loss Date",
job.loss_date,
"Parsed Year",
moment(job.loss_date).year() -
(parsedYr >= 0 ? 2000 + parsedYr : 1900 + parsedYr)
);
@@ -29,6 +32,8 @@ export async function UpsertEstimate(job) {
(parsedYr >= 0 ? 2000 + parsedYr : 1900 + parsedYr),
};
if (job.v_age < 0) job.v_age = 0;
const existingJobs = await client.query({
query: QUERY_JOB_BY_CLM_NO,
variables: { clm_no: job.clm_no },

View File

@@ -9,11 +9,15 @@ export function CalculateJobRpsDollars(job, returnSumActPrice) {
.filter((j) => !j.ignore)
.reduce((acc, val) => {
actPriceSum = actPriceSum.add(
Dinero({ amount: Math.round((val.act_price || 0) * 100) })
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) })
Dinero({ amount: Math.round((val.price_diff || 0) * 100) }).multiply(
val.part_qty || 1
)
);
} else {
return acc;
@@ -34,7 +38,11 @@ export function CalculateJobRpsPc(
const dbPriceSum = job.joblines
.filter((j) => !j.ignore)
.reduce((acc, val) => {
return acc.add(Dinero({ amount: Math.round((val.db_price || 0) * 100) }));
return acc.add(
Dinero({ amount: Math.round((val.db_price || 0) * 100) }).multiply(
val.part_qty || 1
)
);
}, Dinero());
const jobRpsPc = currentRpsDollars.getAmount() / dbPriceSum.getAmount();