Improved auto allocation IO-442

This commit is contained in:
Patrick Fic
2021-01-14 15:52:49 -08:00
parent 03f0afbb68
commit 39bc20a2cb

View File

@@ -23,7 +23,14 @@ export function JobsCloseAutoAllocate({ bodyshop, joblines, form, disabled }) {
if (jl.part_type) { if (jl.part_type) {
ret.profitcenter_part = defaults.profits[jl.part_type.toUpperCase()]; ret.profitcenter_part = defaults.profits[jl.part_type.toUpperCase()];
} else { } else {
console.log("Jobline Didnt matchMedia.", jl); }
if (jl.mod_lbr_ty) {
ret.profitcenter_labor =
defaults.profits[jl.mod_lbr_ty.toUpperCase()];
} else {
ret.profitcenter_labor = null;
}
if (!jl.part_type && !jl.mod_lbr_ty) {
const lineDesc = jl.line_desc.toLowerCase(); const lineDesc = jl.line_desc.toLowerCase();
if (lineDesc.includes("shop materials")) { if (lineDesc.includes("shop materials")) {
ret.profitcenter_part = defaults.profits["MASH"]; ret.profitcenter_part = defaults.profits["MASH"];
@@ -35,12 +42,6 @@ export function JobsCloseAutoAllocate({ bodyshop, joblines, form, disabled }) {
ret.profitcenter_part = null; ret.profitcenter_part = null;
} }
} }
if (jl.mod_lbr_ty) {
ret.profitcenter_labor =
defaults.profits[jl.mod_lbr_ty.toUpperCase()];
} else {
ret.profitcenter_labor = null;
}
return ret; return ret;
}), }),
}); });