Merged in feature/IO-3496-STOR-Job-Total-USA (pull request #2790)

IO-3496 Phase 1 for Job-Total-USA Fix

Approved-by: Dave Richer
This commit is contained in:
Allan Carr
2026-01-08 20:57:45 +00:00
committed by Dave Richer

View File

@@ -381,7 +381,12 @@ async function CalculateRatesTotals({ job, client }) {
if (item.mod_lbr_ty) { if (item.mod_lbr_ty) {
//Check to see if it has 0 hours and a price instead. //Check to see if it has 0 hours and a price instead.
if (item.lbr_op === "OP14" && item.act_price > 0 && (!item.part_type || item.mod_lb_hrs === 0) && !IsAdditionalCost(item)) { if (
item.lbr_op === "OP14" &&
item.act_price > 0 &&
(!item.part_type || item.mod_lb_hrs === 0) &&
!IsAdditionalCost(item)
) {
//Scenario where SGI may pay out hours using a part price. //Scenario where SGI may pay out hours using a part price.
if (!ret[item.mod_lbr_ty.toLowerCase()].total) { if (!ret[item.mod_lbr_ty.toLowerCase()].total) {
ret[item.mod_lbr_ty.toLowerCase()].base = Dinero(); ret[item.mod_lbr_ty.toLowerCase()].base = Dinero();
@@ -943,9 +948,10 @@ function CalculateTaxesTotals(job, otherTotals) {
amount: Math.round(stlTowing.t_amt * 100) amount: Math.round(stlTowing.t_amt * 100)
}) })
); );
if (stlStorage) if (stlStorage)
taxableAmounts.TOW = taxableAmounts.TOW.add( taxableAmounts.STOR = taxableAmounts.STOR.add(
(taxableAmounts.TOW = Dinero({ (taxableAmounts.STOR = Dinero({
amount: Math.round(stlStorage.t_amt * 100) amount: Math.round(stlStorage.t_amt * 100)
})) }))
); );
@@ -988,7 +994,7 @@ function CalculateTaxesTotals(job, otherTotals) {
const pfo = job.cieca_pfo; const pfo = job.cieca_pfo;
Object.keys(taxableAmounts).map((key) => { Object.keys(taxableAmounts).map((key) => {
try { try {
if (key.startsWith("PA")) { if (key.startsWith("PA") && key !== "PAE") {
const typeOfPart = key; // === "PAM" ? "PAC" : key; const typeOfPart = key; // === "PAM" ? "PAC" : key;
//At least one of these scenarios must be taxable. //At least one of these scenarios must be taxable.
for (let tyCounter = 1; tyCounter <= 5; tyCounter++) { for (let tyCounter = 1; tyCounter <= 5; tyCounter++) {