diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json
index 0011cede6..4c534a1f1 100644
--- a/client/src/translations/en_us/common.json
+++ b/client/src/translations/en_us/common.json
@@ -295,7 +295,8 @@
"dailypainttarget": "Scoreboard - Daily Paint Target",
"default_adjustment_rate": "Default Labor Deduction Adjustment Rate",
"deliver": {
- "templates": "Delivery Templates"
+ "templates": "Delivery Templates",
+ "require_actual_delivery_date": "Require Actual Delivery"
},
"dms": {
"apcontrol": "AP Control Number",
@@ -1139,6 +1140,8 @@
"download": "Download",
"edit": "Edit",
"login": "Login",
+ "next": "Next",
+ "previous": "Previous",
"print": "Print",
"refresh": "Refresh",
"remove": "Remove",
diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json
index 463e310e6..d9d1accce 100644
--- a/client/src/translations/es/common.json
+++ b/client/src/translations/es/common.json
@@ -295,7 +295,8 @@
"dailypainttarget": "",
"default_adjustment_rate": "",
"deliver": {
- "templates": ""
+ "templates": "",
+ "require_actual_delivery_date": ""
},
"dms": {
"apcontrol": "",
@@ -1139,6 +1140,8 @@
"download": "",
"edit": "Editar",
"login": "",
+ "next": "",
+ "previous": "",
"print": "",
"refresh": "",
"remove": "",
diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json
index 8ddbeef43..b44021dd2 100644
--- a/client/src/translations/fr/common.json
+++ b/client/src/translations/fr/common.json
@@ -295,7 +295,8 @@
"dailypainttarget": "",
"default_adjustment_rate": "",
"deliver": {
- "templates": ""
+ "templates": "",
+ "require_actual_delivery_date": ""
},
"dms": {
"apcontrol": "",
@@ -1139,6 +1140,8 @@
"download": "",
"edit": "modifier",
"login": "",
+ "next": "",
+ "previous": "",
"print": "",
"refresh": "",
"remove": "",
diff --git a/server/accounting/qb-receivables-lines.js b/server/accounting/qb-receivables-lines.js
index 4be412ac9..1207ae6e0 100644
--- a/server/accounting/qb-receivables-lines.js
+++ b/server/accounting/qb-receivables-lines.js
@@ -891,30 +891,29 @@ function checkStateTax(jobline, jobs_by_pk) {
}
const isAdditionalCost =
- (jobline.lbr_op === "OP13" || (jobline.db_ref && jobline.db_ref.startsWith("9360"))) && !isPaintOrShopMat;
-
- if (!jobline.part_type && isAdditionalCost) {
- if (jobs_by_pk.tax_lbr_rt === 0) {
- return false;
- } else {
- return true;
- }
- }
-
- if (
- jobline.db_ref === "900511" ||
- jobline.db_ref === "900510" ||
- (jobline.mod_lb_hrs === 0 && jobline.act_price > 0 && jobline.lbr_op === "OP14")
- )
- return true; //Extending IO-1375 as a part of IO-2023
+ (jobline.lbr_op === "OP13" ||
+ (jobline.lbr_op === "OP14" && jobline.act_price > 0 && jobline.mod_lb_hrs === 0) ||
+ (jobline.db_ref && jobline.db_ref.startsWith("9360")) ||
+ (jobline.db_ref && jobline.db_ref.startsWith("90051"))) &&
+ !isPaintOrShopMat;
if (jobline.tax_part === false) {
return false;
} else {
+ if (!jobline.part_type && isAdditionalCost) {
+ if (jobs_by_pk.tax_lbr_rt === 0) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
if (jobline.part_type) {
if (
- jobs_by_pk.parts_tax_rates[`${jobline.part_type.toUpperCase()}`].prt_tax_in === false ||
- jobs_by_pk.parts_tax_rates[`${jobline.part_type.toUpperCase()}`].prt_tax_rt === 0
+ (jobs_by_pk.parts_tax_rates[`${jobline.part_type.toUpperCase()}`].prt_tax_in &&
+ jobs_by_pk.parts_tax_rates[`${jobline.part_type.toUpperCase()}`].prt_tax_in === false) ||
+ (jobs_by_pk.parts_tax_rates[`${jobline.part_type.toUpperCase()}`].prt_tax_rt &&
+ jobs_by_pk.parts_tax_rates[`${jobline.part_type.toUpperCase()}`].prt_tax_rt === 0)
) {
return false;
} else {
diff --git a/server/job/job-costing.js b/server/job/job-costing.js
index 8b966140e..f8cbd2515 100644
--- a/server/job/job-costing.js
+++ b/server/job/job-costing.js
@@ -318,7 +318,9 @@ function GenerateCostingData(job) {
if (!partsProfitCenter)
console.log("Unknown cost/profit center mapping for parts.", val.line_desc, val.part_type);
const partsAmount = Dinero({
- amount: val.act_price_before_ppc ? Math.round(val.act_price_before_ppc * 100) : Math.round(val.act_price * 100)
+ amount: val.act_price_before_ppc
+ ? Math.round(val.act_price_before_ppc * 100)
+ : Math.round(val.act_price * 100)
})
.multiply(val.part_qty || 1)
.add(
@@ -327,7 +329,9 @@ function GenerateCostingData(job) {
? val.prt_dsmk_m
? Dinero({ amount: Math.round(val.prt_dsmk_m * 100) })
: Dinero({
- amount: val.act_price_before_ppc ? Math.round(val.act_price_before_ppc * 100) : Math.round(val.act_price * 100)
+ amount: val.act_price_before_ppc
+ ? Math.round(val.act_price_before_ppc * 100)
+ : Math.round(val.act_price * 100)
})
.multiply(val.part_qty || 0)
.percentage(Math.abs(val.prt_dsmk_p || 0))
@@ -368,7 +372,10 @@ function GenerateCostingData(job) {
}
//Additional Profit Center
- if ((!val.part_type && !val.mod_lbr_ty) || (!val.part_type && val.mod_lbr_ty)) {
+ if (
+ (!val.part_type && !val.mod_lbr_ty) ||
+ (!val.part_type && val.mod_lbr_ty && val.act_price > 0 && val.lbr_op !== "OP14")
+ ) {
//Does it already have a defined profit center?
//If so, use it, otherwise try to use the same from the auto-allocate logic in IO app jobs-close-auto-allocate.
const partsProfitCenter = val.profitcenter_part || getAdditionalCostCenter(val, defaultProfits) || "Unknown";
diff --git a/server/job/job-totals-USA.js b/server/job/job-totals-USA.js
index c8bcdf2a8..9a11574c5 100644
--- a/server/job/job-totals-USA.js
+++ b/server/job/job-totals-USA.js
@@ -747,7 +747,9 @@ function CalculateTaxesTotals(job, otherTotals) {
MAPA: Dinero(),
MASH: Dinero(),
TOW: Dinero(),
- STOR: Dinero()
+ STOR: Dinero(),
+
+ ADJ: Dinero()
};
//For each line, determine if it's taxable, and if it is, add the line amount to the taxable amounts total.
@@ -816,6 +818,8 @@ function CalculateTaxesTotals(job, otherTotals) {
amount: Math.round(stlStorage.t_amt * 100)
});
+ if (job.adjustment_bottom_line) taxableAmounts.ADJ = Dinero({ amount: Math.round(job.adjustment_bottom_line * 100) });
+
const pfp = job.parts_tax_rates;
//For any profile level markups/discounts, add them in now as well.
@@ -903,12 +907,26 @@ function CalculateTaxesTotals(job, otherTotals) {
);
}
}
+ } else if (key === "ADJ") {
+ for (let tyCounter = 1; tyCounter <= 5; tyCounter++) {
+ if (IsTrueOrYes(pfp.PAT ? pfp.PAT[`prt_tx_in${tyCounter}`] : pfp.PAN[`prt_tx_in${tyCounter}`])) {
+ //This amount is taxable for this type.
+ taxableAmountsByTier[`ty${tyCounter}Tax`] = taxableAmountsByTier[`ty${tyCounter}Tax`].add(
+ taxableAmounts[key]
+ );
+ }
+ }
}
} catch (error) {
console.error("Key with issue", key);
}
});
+ Object.keys(taxableAmountsByTier).forEach((taxTierKey) => {
+ if (taxableAmountsByTier[taxTierKey].lessThan(Dinero({ amount: 0 }))) {
+ taxableAmountsByTier[taxTierKey] = Dinero({ amount: 0 });
+ }
+ });
const remainingTaxableAmounts = taxableAmountsByTier;
console.log("*** Taxable Amounts by Tier***");
console.table(JSON.parse(JSON.stringify(taxableAmountsByTier)));