From 05bfd217beceee11896bf4ec11a81f441aaf12d6 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Tue, 18 Oct 2022 10:39:58 -0700 Subject: [PATCH] IO-2070 Credit memos no longer update line status. --- .../bill-enter-modal.container.jsx | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx b/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx index ca94a70b3..6fb7692a4 100644 --- a/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx +++ b/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx @@ -229,23 +229,26 @@ function BillEnterModalContainer({ }); } } + //If it's not a credit memo, update the statuses. - await Promise.all( - remainingValues.billlines - .filter((il) => il.joblineid !== "noline") - .map((li) => { - return updateJobLines({ - variables: { - lineId: li.joblineid, - line: { - location: li.location || location, - status: - bodyshop.md_order_statuses.default_received || "Received*", + if (!values.is_credit_memo) { + await Promise.all( + remainingValues.billlines + .filter((il) => il.joblineid !== "noline") + .map((li) => { + return updateJobLines({ + variables: { + lineId: li.joblineid, + line: { + location: li.location || location, + status: + bodyshop.md_order_statuses.default_received || "Received*", + }, }, - }, - }); - }) - ); + }); + }) + ); + } ///////////////////////// if (upload && upload.length > 0) {