Add tax rates to shop config, resolve rate population on job detail.
This commit is contained in:
@@ -767,6 +767,7 @@ function CalculateTaxesTotals(job, otherTotals) {
|
||||
|
||||
let statePartsTax = Dinero();
|
||||
let additionalItemsTax = Dinero();
|
||||
let us_sales_tax_breakdown;
|
||||
|
||||
//Audatex sends additional glass part types. IO-774
|
||||
const BackupGlassTax =
|
||||
@@ -977,8 +978,8 @@ function CalculateTaxesTotals(job, otherTotals) {
|
||||
.add(totalTaxByTier.ty4Tax)
|
||||
.add(totalTaxByTier.ty5Tax)
|
||||
.add(totalTaxByTier.ty6Tax);
|
||||
|
||||
console.log("Tiered Taxes Total for Parts", statePartsTax.toFormat());
|
||||
us_sales_tax_breakdown = totalTaxByTier;
|
||||
console.log("Tiered Taxes Total for Parts/Labor", statePartsTax.toFormat());
|
||||
} else {
|
||||
//Use the old thing.
|
||||
job.joblines
|
||||
@@ -1037,6 +1038,8 @@ function CalculateTaxesTotals(job, otherTotals) {
|
||||
let laborTaxTotal = Dinero();
|
||||
|
||||
if (Object.keys(job.cieca_pfl).length > 0) {
|
||||
//Ignore it now, we have calculated it above.
|
||||
//This was previously used for JCS before parts were also calculated at a different rate.
|
||||
} else {
|
||||
//We don't have it, just add in how it was before.
|
||||
laborTaxTotal = otherTotals.rates.subtotal.percentage(
|
||||
@@ -1055,6 +1058,7 @@ function CalculateTaxesTotals(job, otherTotals) {
|
||||
)
|
||||
),
|
||||
statePartsTax,
|
||||
us_sales_tax_breakdown,
|
||||
state_tax: statePartsTax
|
||||
.add(laborTaxTotal)
|
||||
.add(
|
||||
@@ -1083,7 +1087,6 @@ function CalculateTaxesTotals(job, otherTotals) {
|
||||
)
|
||||
: Dinero()
|
||||
),
|
||||
|
||||
local_tax: subtotal.percentage((job.local_tax_rate || 0) * 100),
|
||||
};
|
||||
ret.total_repairs = ret.subtotal
|
||||
|
||||
Reference in New Issue
Block a user