diff --git a/server/job/job-totals-USA.js b/server/job/job-totals-USA.js index e29b48ef3..906d024b3 100644 --- a/server/job/job-totals-USA.js +++ b/server/job/job-totals-USA.js @@ -73,7 +73,16 @@ async function TotalsServerSide(req, res) { job.cieca_ttl.data.n_ttl_amt === job.cieca_ttl.data.g_ttl_amt //It looks like sometimes, gross and net are the same, but they shouldn't be. ? job.cieca_ttl.data.n_ttl_amt - job.cieca_ttl.data.g_tax : job.cieca_ttl.data.g_ttl_amt - job.cieca_ttl.data.g_tax; //If they are, adjust the gross total down by the tax amount. - const ttlDifference = emsTotal - ret.totals.subtotal.getAmount() / 100; + const ttlDifference = + emsTotal - + ret.totals.subtotal + .add( + Dinero({ + amount: Math.round((job.adjustment_bottom_line || 0) * 100) + }).multiply(-1) //Add back in the adjustment to the subtotal. We don't want to scrub it twice. + ) + .getAmount() / + 100; if (Math.abs(ttlDifference) > 0.0) { //If difference is greater than a pennny, we need to adjust it.