@@ -695,25 +695,25 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
|||||||
>
|
>
|
||||||
<Input onBlur={handleBlur} />
|
<Input onBlur={handleBlur} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
{!hasDMSKey && (
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.fields.responsibilitycenter_accountitem")}
|
||||||
|
key={`${index}accountitem`}
|
||||||
|
name={[field.name, "accountitem"]}
|
||||||
|
rules={[{ required: true }]}
|
||||||
|
>
|
||||||
|
<Input onBlur={handleBlur} />
|
||||||
|
</Form.Item>
|
||||||
|
)}
|
||||||
{hasDMSKey && !bodyshop.rr_dealerid && (
|
{hasDMSKey && !bodyshop.rr_dealerid && (
|
||||||
<>
|
<Form.Item
|
||||||
<Form.Item
|
label={t("bodyshop.fields.dms.dms_acctnumber")}
|
||||||
label={t("bodyshop.fields.responsibilitycenter_accountitem")}
|
key={`${index}dms_acctnumber`}
|
||||||
key={`${index}accountitem`}
|
name={[field.name, "dms_acctnumber"]}
|
||||||
name={[field.name, "accountitem"]}
|
rules={[{ required: true }]}
|
||||||
rules={[{ required: true }]}
|
>
|
||||||
>
|
<Input onBlur={handleBlur} />
|
||||||
<Input onBlur={handleBlur} />
|
</Form.Item>
|
||||||
</Form.Item>
|
|
||||||
<Form.Item
|
|
||||||
label={t("bodyshop.fields.dms.dms_acctnumber")}
|
|
||||||
key={`${index}dms_acctnumber`}
|
|
||||||
name={[field.name, "dms_acctnumber"]}
|
|
||||||
rules={[{ required: true }]}
|
|
||||||
>
|
|
||||||
<Input onBlur={handleBlur} />
|
|
||||||
</Form.Item>
|
|
||||||
</>
|
|
||||||
)}
|
)}
|
||||||
{bodyshop.cdk_dealerid && (
|
{bodyshop.cdk_dealerid && (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
|
|||||||
@@ -304,6 +304,7 @@ function GenerateCostingData(job) {
|
|||||||
if (
|
if (
|
||||||
job.cieca_pfl &&
|
job.cieca_pfl &&
|
||||||
job.cieca_pfl[val.mod_lbr_ty.toUpperCase()] &&
|
job.cieca_pfl[val.mod_lbr_ty.toUpperCase()] &&
|
||||||
|
typeof job.cieca_pfl[val.mod_lbr_ty.toUpperCase()].lbr_adjp === "number" &&
|
||||||
job.cieca_pfl[val.mod_lbr_ty.toUpperCase()].lbr_adjp !== 0
|
job.cieca_pfl[val.mod_lbr_ty.toUpperCase()].lbr_adjp !== 0
|
||||||
) {
|
) {
|
||||||
let adjp = 0;
|
let adjp = 0;
|
||||||
@@ -338,7 +339,7 @@ function GenerateCostingData(job) {
|
|||||||
if (!acc.labor[laborProfitCenter]) acc.labor[laborProfitCenter] = Dinero();
|
if (!acc.labor[laborProfitCenter]) acc.labor[laborProfitCenter] = Dinero();
|
||||||
acc.labor[laborProfitCenter] = acc.labor[laborProfitCenter].add(laborAmount);
|
acc.labor[laborProfitCenter] = acc.labor[laborProfitCenter].add(laborAmount);
|
||||||
|
|
||||||
if (val.mod_lb_hrs === 0 && val.act_price > 0 && val.lbr_op === "OP14") {
|
if (val.act_price > 0 && val.lbr_op === "OP14") {
|
||||||
//Scenario where SGI may pay out hours using a part price.
|
//Scenario where SGI may pay out hours using a part price.
|
||||||
acc.labor[laborProfitCenter] = acc.labor[laborProfitCenter].add(
|
acc.labor[laborProfitCenter] = acc.labor[laborProfitCenter].add(
|
||||||
Dinero({
|
Dinero({
|
||||||
@@ -469,10 +470,7 @@ function GenerateCostingData(job) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Additional Profit Center
|
//Additional Profit Center
|
||||||
if (
|
if ((!val.part_type && !val.mod_lbr_ty) || (!val.part_type && val.mod_lbr_ty && val.lbr_op !== "OP14")) {
|
||||||
(!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?
|
//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.
|
//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";
|
const partsProfitCenter = val.profitcenter_part || getAdditionalCostCenter(val, defaultProfits) || "Unknown";
|
||||||
@@ -524,7 +522,12 @@ function GenerateCostingData(job) {
|
|||||||
}).multiply(materialsHours.mapaHrs || 0)
|
}).multiply(materialsHours.mapaHrs || 0)
|
||||||
);
|
);
|
||||||
let adjp = 0;
|
let adjp = 0;
|
||||||
if (job.materials["MAPA"] && job.materials["MAPA"].mat_adjp) {
|
if (
|
||||||
|
job.materials["MAPA"] &&
|
||||||
|
job.materials["MAPA"].mat_adjp &&
|
||||||
|
typeof job.materials["MAPA"].mat_adjp === "number" &&
|
||||||
|
job.materials["MAPA"].mat_adjp !== 0
|
||||||
|
) {
|
||||||
adjp =
|
adjp =
|
||||||
Math.abs(job.materials["MAPA"].mat_adjp) > 1
|
Math.abs(job.materials["MAPA"].mat_adjp) > 1
|
||||||
? job.materials["MAPA"].mat_adjp
|
? job.materials["MAPA"].mat_adjp
|
||||||
@@ -551,7 +554,12 @@ function GenerateCostingData(job) {
|
|||||||
}).multiply(materialsHours.mashHrs || 0)
|
}).multiply(materialsHours.mashHrs || 0)
|
||||||
);
|
);
|
||||||
let adjp = 0;
|
let adjp = 0;
|
||||||
if (job.materials["MASH"] && job.materials["MASH"].mat_adjp) {
|
if (
|
||||||
|
job.materials["MASH"] &&
|
||||||
|
job.materials["MASH"].mat_adjp &&
|
||||||
|
typeof job.materials["MASH"].mat_adjp === "number" &&
|
||||||
|
job.materials["MASH"].mat_adjp !== 0
|
||||||
|
) {
|
||||||
adjp =
|
adjp =
|
||||||
Math.abs(job.materials["MASH"].mat_adjp) > 1
|
Math.abs(job.materials["MASH"].mat_adjp) > 1
|
||||||
? job.materials["MASH"].mat_adjp
|
? job.materials["MASH"].mat_adjp
|
||||||
@@ -575,7 +583,7 @@ function GenerateCostingData(job) {
|
|||||||
jobLineTotalsByProfitCenter.additional[defaultProfits["TOW"]] = Dinero();
|
jobLineTotalsByProfitCenter.additional[defaultProfits["TOW"]] = Dinero();
|
||||||
|
|
||||||
jobLineTotalsByProfitCenter.additional[defaultProfits["TOW"]] = stlTowing
|
jobLineTotalsByProfitCenter.additional[defaultProfits["TOW"]] = stlTowing
|
||||||
? Dinero({ amount: Math.round(stlTowing.ttl_amt * 100) })
|
? Dinero({ amount: Math.round((stlTowing.ttl_amt || 0) * 100) })
|
||||||
: Dinero({
|
: Dinero({
|
||||||
amount: Math.round((job.towing_payable || 0) * 100)
|
amount: Math.round((job.towing_payable || 0) * 100)
|
||||||
});
|
});
|
||||||
@@ -584,7 +592,7 @@ function GenerateCostingData(job) {
|
|||||||
jobLineTotalsByProfitCenter.additional[defaultProfits["STO"]] = Dinero();
|
jobLineTotalsByProfitCenter.additional[defaultProfits["STO"]] = Dinero();
|
||||||
|
|
||||||
jobLineTotalsByProfitCenter.additional[defaultProfits["STO"]] = stlStorage
|
jobLineTotalsByProfitCenter.additional[defaultProfits["STO"]] = stlStorage
|
||||||
? Dinero({ amount: Math.round(stlStorage.ttl_amt * 100) })
|
? Dinero({ amount: Math.round((stlStorage.ttl_amt || 0) * 100) })
|
||||||
: Dinero({
|
: Dinero({
|
||||||
amount: Math.round((job.storage_payable || 0) * 100)
|
amount: Math.round((job.storage_payable || 0) * 100)
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user