From ae705322f802fe87097dae4dd3e655b8c0b06d43 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 15 Aug 2024 13:41:33 -0700 Subject: [PATCH] IO-2879 936001 TOWING to QB Prevent double sending 936001 Towing lines to QB Signed-off-by: Allan Carr --- server/accounting/qb-receivables-lines.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/accounting/qb-receivables-lines.js b/server/accounting/qb-receivables-lines.js index 5300cc822..40b5bec9c 100644 --- a/server/accounting/qb-receivables-lines.js +++ b/server/accounting/qb-receivables-lines.js @@ -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)) &&