IO-2879 936001 TOWING to QB

Prevent double sending 936001 Towing lines to QB

Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
This commit is contained in:
Allan Carr
2024-08-15 13:41:33 -07:00
parent 97282740f5
commit ae705322f8

View File

@@ -20,6 +20,7 @@ exports.default = function ({ bodyshop, jobs_by_pk, qbo = false, items, taxCodes
//Otherwise, calculate them and add them to the default MAPA and MASH centers.
let hasMapaLine = false;
let hasMashLine = false;
let isTowingLine = false;
//Create the invoice lines mapping.
jobs_by_pk.joblines.map((jobline) => {
@@ -30,8 +31,11 @@ exports.default = function ({ bodyshop, jobs_by_pk, qbo = false, items, taxCodes
if (jobline.db_ref === "936007") {
hasMashLine = true;
}
if (jobline.db_ref === "936001" && jobline.line_desc.includes("Towing")) {
isTowingLine = true;
}
//Parts Lines Mappings.
if (jobline.profitcenter_part) {
if (!isTowingLine && jobline.profitcenter_part) {
//TODO:AIO This appears to be a net 0 change exept for default quantity as 0 instead of 1 for imex. Need to verify.
const discountAmount =
((jobline.prt_dsmk_m && jobline.prt_dsmk_m !== 0) || (jobline.prt_dsmk_p && jobline.prt_dsmk_p !== 0)) &&