Merged in v1.0.22 (pull request #25)

V1.0.22
This commit is contained in:
Patrick Fic
2021-05-20 22:10:08 +00:00
5 changed files with 54 additions and 73 deletions

View File

@@ -1,5 +1,5 @@
New Features:
- Improved glass parts recognition.
- Added additional models for more accurate group detection.
- Added support Line Discounting
- Ignored lines will now automatically reset when importing to ensure lines are not ignored when updated in place.
Bug Fixes:
-
- Improved detection of $0 price items.

View File

@@ -63,5 +63,10 @@
"title": "Release Notes for 1.0.21",
"date": "05/07/2021",
"notes": "New Features: \n- Improved glass parts recognition.\n- Added additional models for more accurate group detection."
},
"1.0.22": {
"title": "Release Notes for 1.0.22",
"date": "05/20/2021",
"notes": "New Features: \n- Added support Line Discounting\n- Ignored lines will now automatically reset when importing to ensure lines are not ignored when updated in place.\nBug Fixes: \n- Improved detection of $0 price items."
}
}

View File

@@ -279,61 +279,6 @@ async function DecodeLinFile(extensionlessFilePath) {
let records = await dbf.readRecords();
let joblines = records
.map((record) => {
try {
console.log(
"Trying pick",
_.pick(record, [
"LINE_NO",
"LINE_IND",
// "LINE_REF",
// "TRAN_CODE",
"DB_REF",
"UNQ_SEQ",
// "WHO_PAYS",
"LINE_DESC",
"PART_TYPE",
// "PART_DESCJ",
"PRT_DSMK_M",
"OEM_PARTNO",
// "PRICE_INC",
// "ALT_PART_I",
// "TAX_PART",
"DB_PRICE",
"ACT_PRICE",
"PART_QTY",
"PRICE_J",
"GLASS_FLAG",
// "CERT_PART",
// "ALT_CO_ID",
// "ALT_PARTNO",
// "ALT_OVERRD",
// "ALT_PARTM",
// "PRT_DSMK_P",
// "MOD_LBR_TY",
// "DB_HRS",
// "MOD_LB_HRS",
// "LBR_INC",
// "LBR_OP",
// "LBR_HRS_J",
// "LBR_TYP_J",
// "LBR_OP_J",
// "PAINT_STG",
// "PAINT_TONE",
// "LBR_TAX",
// "LBR_AMT",
// "MISC_AMT",
// "MISC_SUBLT",
// "MISC_TAX",
// "BETT_TYPE",
// "BETT_PCTG",
// "BETT_AMT",
// "BETT_TAX",
])
);
} catch (error) {
console.log(error);
}
return _.transform(
_.pick(record, [
"LINE_NO",
@@ -361,7 +306,7 @@ async function DecodeLinFile(extensionlessFilePath) {
// "ALT_PARTNO",
// "ALT_OVERRD",
// "ALT_PARTM",
// "PRT_DSMK_P",
"PRT_DSMK_P",
// "MOD_LBR_TY",
// "DB_HRS",
@@ -385,7 +330,7 @@ async function DecodeLinFile(extensionlessFilePath) {
]),
function (result, val, key) {
//Required because unq_seq gets pulled as a numeric instaed of a string.
console.log(result, val, key);
if (key === "UNQ_SEQ") {
result[key.toLowerCase()] = val.toString();
return;
@@ -442,6 +387,8 @@ async function DecodeLinFile(extensionlessFilePath) {
// jobline.ignore = true;
// }
jobline.ignore = false;
//Wheel Repair Pricing PRS-82
if (
jobline.part_type === "PAN" &&
@@ -452,14 +399,16 @@ async function DecodeLinFile(extensionlessFilePath) {
log.info(`Jobline '${jobline.line_desc}' ignored due to wheel repair.`);
jobline.ignore = true;
}
//RPS-46 Ignore NA Line Items.
if (
jobline.part_type === "PAN" &&
jobline.price_j === true &&
jobline.db_price === 0
) {
jobline.ignore = true;
}
//Removed on 05/20. We are seeing more $0DB lines than NA lines and they are getting incorrectly ignored.
// if (
// jobline.part_type === "PAN" &&
// jobline.price_j === true &&
// jobline.db_price === 0
// ) {
// jobline.ignore = true;
// }
//RPS-39 - OEM ON OEM SAVINGS
if (
@@ -479,6 +428,20 @@ async function DecodeLinFile(extensionlessFilePath) {
jobline.db_price = jobline.act_price;
}
//05/20
//Well have to apply a rule that will not count any A/M, Reman or new part price that is manually changed to $0.00. Only recycled parts that are changed to $0.00 can be counted towards RPS.
// This is separate from $0.00 DB prices that need to be updated to the manually entered price.
// if (
// jobline.part_type !== "PAL" &&
// jobline.act_price === 0 &&
// jobline.price_j
// ) {
// log.info(
// `Jobline '${jobline.line_desc}' ignored because it was manually changed to 0..`
// );
// jobline.ignore = true;
// }
// if (
// !!jobline.db_price &&
// jobline.db_price > 0 &&
@@ -509,8 +472,16 @@ async function DecodeLinFile(extensionlessFilePath) {
jobline.part_type.toUpperCase() === "PASL" ||
jobline.part_type.toUpperCase() === "PAE"
//jobline.glass_flag === true //Removed for RPS-43.
)
) {
jobline.ignore = true;
}
//Check to see if this is a discount line i.e. a 900511
if (jobline.db_ref === "900511" && jobline.prt_dsmk_p !== 50) {
jobline.ignore = false;
console.log("dsmk_d", jobline.prt_dsmk_p);
//Calculate the discount to be added as a negative.
jobline.act_price = jobline.prt_dsmk_m;
}
//RPS-42 Dynamic Inclusion or Exclusion of Lines based on RPS-EXCLUDE or RPS.
if (jobline.oem_partno.toLowerCase().includes("/rps-exclude")) {
@@ -520,6 +491,7 @@ async function DecodeLinFile(extensionlessFilePath) {
}
delete jobline.prt_dsmk_m; //Delete price markup for wheel repair
delete jobline.prt_dsmk_p;
delete jobline.glass_flag;
delete jobline.price_j;
return jobline;

View File

@@ -3,7 +3,7 @@
"productName": "ImEX RPS",
"author": "ImEX Systems Inc. <support@thinkimex.com>",
"description": "ImEX RPS",
"version": "1.0.21",
"version": "1.0.22",
"main": "electron/main.js",
"homepage": "./",
"dependencies": {

View File

@@ -104,10 +104,14 @@ export const GetSupplementDelta = async (jobId, existingLinesO, newLines) => {
//Found a relevant matching line. Add it to lines to update.
linesToUpdate.push({
id: existingLines[matchingIndex].id,
newData: {
...newLine,
ignore: existingLines[matchingIndex].ignore,
},
newData: newLine,
// {
// ...newLine,
// ignore:
// newLine.db_ref === "900511" && newLine.prt_dsmk_p !== 50
// ? false
// : existingLines[matchingIndex].ignore,
// },
});
//Splice out item we found for performance.
existingLines.splice(matchingIndex, 1);