Pro man logo, CDK updates for Rome, Update auto allocate.

This commit is contained in:
Patrick Fic
2024-03-20 11:14:15 -07:00
parent c55374edc8
commit e162460b9c
4 changed files with 29 additions and 21 deletions

View File

@@ -6,6 +6,7 @@ import {connect} from "react-redux";
import {createStructuredSelector} from "reselect";
import {logImEXEvent} from "../../firebase/firebase.utils";
import {selectBodyshop} from "../../redux/user/user.selectors";
import InstanceRenderManager from "../../utils/instanceRenderMgr";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -29,19 +30,25 @@ export function JobsCloseAutoAllocate({bodyshop, joblines, form, disabled}) {
ret.profitcenter_labor = null;
}
//Verify that this is also manually updated in server/job-costing
if (!jl.part_type && !jl.mod_lbr_ty) {
const lineDesc = jl.line_desc ? jl.line_desc.toLowerCase() : "";
if (lineDesc.includes("shop materials")) {
ret.profitcenter_part = defaults.profits["MASH"];
} else if (lineDesc.includes("paint/materials")) {
ret.profitcenter_part = defaults.profits["MAPA"];
} else if (lineDesc.includes("ats amount")) {
ret.profitcenter_part = defaults.profits["ATS"];
} else if (jl.act_price > 0) {
ret.profitcenter_part = defaults.profits["PAO"];
} else {
ret.profitcenter_part = null;
}
if (
InstanceRenderManager({
imex: !jl.part_type && !jl.mod_lbr_ty,
rome: !ret.profitcenter_part,
promanager: 'USE_ROME',
})
) {
const lineDesc = jl.line_desc ? jl.line_desc.toLowerCase() : '';
if (lineDesc.includes('shop materials')) {
ret.profitcenter_part = defaults.profits['MASH'];
} else if (lineDesc.includes('paint/materials')) {
ret.profitcenter_part = defaults.profits['MAPA'];
} else if (lineDesc.includes('ats amount')) {
ret.profitcenter_part = defaults.profits['ATS'];
} else if (jl.act_price > 0) {
ret.profitcenter_part = defaults.profits['PAO'];
} else {
ret.profitcenter_part = null;
}
}
return ret;
}),