diff --git a/client/src/components/jobs-close-auto-allocate/jobs-close-auto-allocate.component.jsx b/client/src/components/jobs-close-auto-allocate/jobs-close-auto-allocate.component.jsx index 4ba38e347..aedeba6bd 100644 --- a/client/src/components/jobs-close-auto-allocate/jobs-close-auto-allocate.component.jsx +++ b/client/src/components/jobs-close-auto-allocate/jobs-close-auto-allocate.component.jsx @@ -1,11 +1,11 @@ import { Button } from "antd"; +import _ from "lodash"; import React from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { logImEXEvent } from "../../firebase/firebase.utils"; import { selectBodyshop } from "../../redux/user/user.selectors"; -import _ from "lodash"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, }); @@ -23,7 +23,17 @@ export function JobsCloseAutoAllocate({ bodyshop, joblines, form, disabled }) { if (jl.part_type) { ret.profitcenter_part = defaults.profits[jl.part_type.toUpperCase()]; } else { - ret.profitcenter_part = null; + console.log("Jobline Didnt matchMedia.", jl); + const lineDesc = 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 { + ret.profitcenter_part = null; + } } if (jl.mod_lbr_ty) { ret.profitcenter_labor =