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

Signed-off-by: Allan Carr <allan@imexsystems.ca>
This commit is contained in:
Allan Carr
2026-01-08 12:20:15 -08:00
parent 4a7bb07345
commit a906bc5816

View File

@@ -381,7 +381,12 @@ async function CalculateRatesTotals({ job, client }) {
if (item.mod_lbr_ty) {
//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.
if (!ret[item.mod_lbr_ty.toLowerCase()].total) {
ret[item.mod_lbr_ty.toLowerCase()].base = Dinero();
@@ -943,9 +948,10 @@ function CalculateTaxesTotals(job, otherTotals) {
amount: Math.round(stlTowing.t_amt * 100)
})
);
if (stlStorage)
taxableAmounts.TOW = taxableAmounts.TOW.add(
(taxableAmounts.TOW = Dinero({
taxableAmounts.STOR = taxableAmounts.STOR.add(
(taxableAmounts.STOR = Dinero({
amount: Math.round(stlStorage.t_amt * 100)
}))
);
@@ -988,7 +994,7 @@ function CalculateTaxesTotals(job, otherTotals) {
const pfo = job.cieca_pfo;
Object.keys(taxableAmounts).map((key) => {
try {
if (key.startsWith("PA")) {
if (key.startsWith("PA") && key !== "PAE") {
const typeOfPart = key; // === "PAM" ? "PAC" : key;
//At least one of these scenarios must be taxable.
for (let tyCounter = 1; tyCounter <= 5; tyCounter++) {