- {`ImEX Online V.${process.env.NODE_ENV} - ${
+ {`ImEX Online ${
process.env.REACT_APP_GIT_SHA
} - ${preval`module.exports = new Date().toLocaleString("en-US", {timeZone: "America/Los_Angeles"});`}`}
From 09ce5ac89297db9651bdc79e868c8b20fb5c9233 Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Thu, 27 May 2021 16:21:54 -0700
Subject: [PATCH 11/13] IO-1152 Resolve parts markup issue.
---
client/src/graphql/jobs.queries.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js
index 9d1dbea66..3002e8d7f 100644
--- a/client/src/graphql/jobs.queries.js
+++ b/client/src/graphql/jobs.queries.js
@@ -1485,6 +1485,7 @@ export const QUERY_JOB_CLOSE_DETAILS = gql`
op_code_desc
profitcenter_labor
profitcenter_part
+ prt_dsmk_p
}
}
}
From 343274e1e271a8ca883b5bf3f00c229549306269 Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Thu, 27 May 2021 16:25:07 -0700
Subject: [PATCH 12/13] IO-1152 Missed in last commit.
---
server/accounting/qbxml/qbxml-receivables.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/server/accounting/qbxml/qbxml-receivables.js b/server/accounting/qbxml/qbxml-receivables.js
index 49f67f397..375a99d88 100644
--- a/server/accounting/qbxml/qbxml-receivables.js
+++ b/server/accounting/qbxml/qbxml-receivables.js
@@ -221,7 +221,7 @@ const generateInvoiceQbxml = (
amount: Math.round((jobline.act_price || 0) * 100),
})
.multiply(jobline.part_qty || 0)
- .percentage(jobline.prt_dsmk_p)
+ .percentage(jobline.prt_dsmk_p || 0)
);
const account = responsibilityCenters.profits.find(
(i) => jobline.profitcenter_part.toLowerCase() === i.name.toLowerCase()
From 58c6ba2f87f1f1ab27c1f2b93c5dbebdeeda7b0d Mon Sep 17 00:00:00 2001
From: Patrick Fic
Date: Thu, 27 May 2021 16:49:21 -0700
Subject: [PATCH 13/13] IO-1152 Add missing fields to query.
---
server/accounting/qbxml/qbxml-receivables.js | 17 ++++++++---------
server/graphql-client/queries.js | 1 +
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/server/accounting/qbxml/qbxml-receivables.js b/server/accounting/qbxml/qbxml-receivables.js
index 375a99d88..2138c5b50 100644
--- a/server/accounting/qbxml/qbxml-receivables.js
+++ b/server/accounting/qbxml/qbxml-receivables.js
@@ -212,17 +212,16 @@ const generateInvoiceQbxml = (
}
if (jobline.profitcenter_part && jobline.act_price) {
- const DineroAmount = Dinero({
+ let DineroAmount = Dinero({
amount: Math.round(jobline.act_price * 100),
- })
- .multiply(jobline.part_qty || 1)
- .add(
- Dinero({
- amount: Math.round((jobline.act_price || 0) * 100),
- })
- .multiply(jobline.part_qty || 0)
- .percentage(jobline.prt_dsmk_p || 0)
+ }).multiply(jobline.part_qty || 1);
+
+ if (jobline.prt_dsmk_p && jobline.prt_dsmk_p !== 0) {
+ console.log("Have a part discount", jobline);
+ DineroAmount = DineroAmount.add(
+ DineroAmount.percentage(jobline.prt_dsmk_p || 0)
);
+ }
const account = responsibilityCenters.profits.find(
(i) => jobline.profitcenter_part.toLowerCase() === i.name.toLowerCase()
);
diff --git a/server/graphql-client/queries.js b/server/graphql-client/queries.js
index 9b7b3677c..ee3de5cf9 100644
--- a/server/graphql-client/queries.js
+++ b/server/graphql-client/queries.js
@@ -101,6 +101,7 @@ query QUERY_JOBS_FOR_RECEIVABLES_EXPORT($ids: [uuid!]!) {
profitcenter_labor
profitcenter_part
db_ref
+ prt_dsmk_p
}
}
bodyshops(where: {associations: {active: {_eq: true}}}) {