From 6faf69a87514655a5f8890a754ea768e09ed1e40 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Mon, 31 May 2021 18:07:42 -0700 Subject: [PATCH] Emergency fix #2 for GST Registrant. --- server/job/job-totals.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/server/job/job-totals.js b/server/job/job-totals.js index e31c34ec2..45f6bb4e5 100644 --- a/server/job/job-totals.js +++ b/server/job/job-totals.js @@ -425,12 +425,18 @@ function CalculateTaxesTotals(job, otherTotals) { .add(ret.state_tax) .add(ret.local_tax); + console.log( + "Checking GST", + job.ca_customer_gst !== 0, + job.ca_customer_gst !== null + ); + ret.custPayable = { deductible: Dinero({ amount: (job.ded_amt || 0) * 100 }) || 0, federal_tax: job.ca_gst_registrant - ? job.ca_customer_gst !== 0 || job.ca_customer_gst !== null - ? Dinero({ amount: Math.round(job.ca_customer_gst * 100) }) - : ret.federal_tax + ? job.ca_customer_gst === 0 || job.ca_customer_gst === null + ? ret.federal_tax + : Dinero({ amount: Math.round(job.ca_customer_gst * 100) }) : Dinero(), other_customer_amount: Dinero({ amount: (job.other_amount_payable || 0) * 100,