IO-3001 Add resp. centers and begin QB testing.

This commit is contained in:
Patrick Fic
2024-11-05 15:31:35 -08:00
parent 9bb36d2223
commit 94641ae01d
8 changed files with 11351 additions and 10812 deletions

View File

@@ -72,10 +72,10 @@ async function TotalsServerSide(req, res) {
const emsTotal =
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.g_ttl_amt - job.cieca_ttl.data.g_tax //If they are, adjust the gross total down by the tax amount.
: job.cieca_ttl.data.n_ttl_amt;
: job.cieca_ttl.data.n_ttl_amt - job.cieca_ttl.data.g_tax;
const ttlDifference = emsTotal - ret.totals.subtotal.getAmount() / 100;
if (Math.abs(ttlDifference) > 0.01) {
if (Math.abs(ttlDifference) > 0.00) {
//If difference is greater than a pennny, we need to adjust it.
ret.totals.ttl_adjustment = Dinero({ amount: Math.round(ttlDifference * 100) });
ret.totals.subtotal = ret.totals.subtotal.add(ret.totals.ttl_adjustment);
@@ -97,7 +97,7 @@ async function TotalsServerSide(req, res) {
100;
const ttlTaxDifference = emsTaxTotal - totalUsTaxes;
if (Math.abs(ttlTaxDifference) > 0.01) {
if (Math.abs(ttlTaxDifference) > 0.00) {
//If difference is greater than a pennny, we need to adjust it.
ret.totals.ttl_tax_adjustment = Dinero({ amount: Math.round(ttlTaxDifference * 100) });
ret.totals.total_repairs = ret.totals.total_repairs.add(ret.totals.ttl_tax_adjustment);