Compare commits

...

3 Commits

Author SHA1 Message Date
Allan Carr
6c9dd969e5 IO-3496 STOR Job Total USA
Signed-off-by: Allan Carr <allan@imexsystems.ca>
2026-01-08 15:34:48 -08:00
Allan Carr
a906bc5816 IO-3496 Phase 1 for Job-Total-USA Fix
Signed-off-by: Allan Carr <allan@imexsystems.ca>
2026-01-08 12:20:15 -08:00
Dave Richer
4a7bb07345 Merged in hotfix/missing-dms-migration (pull request #2738)
hotfix/missing-dms-migration - Add Back DMS_ID
2025-12-19 20:13:11 +00:00
2 changed files with 24 additions and 4 deletions

View File

@@ -1506,6 +1506,7 @@ exports.GET_JOB_BY_PK = `query GET_JOB_BY_PK($id: uuid!) {
est_ct_fn
shopid
est_ct_ln
ciecaid
cieca_pfl
cieca_pft
cieca_pfo

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,13 +948,27 @@ function CalculateTaxesTotals(job, otherTotals) {
amount: Math.round(stlTowing.t_amt * 100)
})
);
if (stlStorage)
if (!stlTowing && !job.ciecaid && job.towing_payable)
taxableAmounts.TOW = taxableAmounts.TOW.add(
(taxableAmounts.TOW = Dinero({
Dinero({
amount: Math.round((job.towing_payable || 0) * 100)
})
);
if (stlStorage)
taxableAmounts.STOR = taxableAmounts.STOR.add(
(taxableAmounts.STOR = Dinero({
amount: Math.round(stlStorage.t_amt * 100)
}))
);
if (!stlStorage && !job.ciecaid && job.storage_payable)
taxableAmounts.STOR = taxableAmounts.STOR.add(
Dinero({
amount: Math.round((job.storage_payable || 0) * 100)
})
);
const pfp = job.parts_tax_rates;
//For any profile level markups/discounts, add them in now as well.
@@ -988,7 +1007,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++) {