Further work on totals testing. Almost accurate now.

This commit is contained in:
Patrick Fic
2020-04-09 15:29:30 -07:00
parent ad5d371547
commit 4e70c6a9b6
14 changed files with 297 additions and 107 deletions

View File

@@ -34,7 +34,6 @@ function CalculateTaxesTotals(job, otherTotals) {
}, 0);
console.log("otherTotals", otherTotals);
console.log("job", job);
console.log("parts pst", statePartsTax);
console.log(
@@ -158,19 +157,23 @@ function CalculateRatesTotals(ratesList, shoprates) {
},
rate_atp: {
rate: shoprates.rate_atp || 0,
hours: jobLines
.filter(
(item) =>
item.mod_lbr_ty !== "LA1" &&
item.mod_lbr_ty !== "LA2" &&
item.mod_lbr_ty !== "LA3" &&
item.mod_lbr_ty !== "LA4" &&
item.mod_lbr_ty !== "LAU" &&
item.mod_lbr_ty !== "LAG" &&
item.mod_lbr_ty !== "LAS" &&
item.mod_lbr_ty !== "LAA"
)
.reduce((acc, value) => acc + value.mod_lb_hrs, 0),
hours:
jobLines.filter((item) => item.line_desc.includes("ATS Amount"))
.length > 0
? jobLines
.filter(
(item) =>
item.mod_lbr_ty !== "LA1" &&
item.mod_lbr_ty !== "LA2" &&
item.mod_lbr_ty !== "LA3" &&
item.mod_lbr_ty !== "LA4" &&
item.mod_lbr_ty !== "LAU" &&
item.mod_lbr_ty !== "LAG" &&
item.mod_lbr_ty !== "LAS" &&
item.mod_lbr_ty !== "LAA"
)
.reduce((acc, value) => acc + value.mod_lb_hrs, 0)
: 0,
},
paint_mat: {
rate: ratesList.rate_mapa,
@@ -193,8 +196,8 @@ function CalculateRatesTotals(ratesList, shoprates) {
subtotal = subtotal + ret[property].hours * ret[property].rate;
if (
property !== "paint_mat" &&
property !== "shop_mat" &&
property !== "rate_atp"
property !== "shop_mat"
//&& property !== "rate_atp"
)
rates_subtotal =
rates_subtotal + ret[property].hours * ret[property].rate;