IO-2116 Add account number to control types for DMS.
This commit is contained in:
@@ -17,5 +17,4 @@
|
|||||||
"no-console": "off"
|
"no-console": "off"
|
||||||
},
|
},
|
||||||
"settings": {}
|
"settings": {}
|
||||||
//"plugins": ["cypress"]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4402,6 +4402,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>sendmaterialscosting</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>srcco</name>
|
<name>srcco</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -22456,6 +22477,32 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<folder_node>
|
||||||
|
<name>control_type</name>
|
||||||
|
<children>
|
||||||
|
<concept_node>
|
||||||
|
<name>account_number</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
|
</children>
|
||||||
|
</folder_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>cost</name>
|
<name>cost</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
|
|||||||
@@ -345,7 +345,20 @@ export function DmsPostForm({ bodyshop, socket, job, logsRef }) {
|
|||||||
t(`jobs.fields.${cdkPayer?.control_type}`)}
|
t(`jobs.fields.${cdkPayer?.control_type}`)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
else {
|
else if (
|
||||||
|
i18n.exists(
|
||||||
|
`jobs.fields.dms.control_type.${cdkPayer?.control_type}`
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{cdkPayer &&
|
||||||
|
t(
|
||||||
|
`jobs.fields.dms.control_type.${cdkPayer?.control_type}`
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -139,6 +139,12 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
|||||||
>
|
>
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.fields.dms.sendmaterialscosting")}
|
||||||
|
name={["cdk_configuration", "sendmaterialscosting"]}
|
||||||
|
>
|
||||||
|
<InputNumber min={0} max={100} />
|
||||||
|
</Form.Item>
|
||||||
{bodyshop.pbs_serialnumber && (
|
{bodyshop.pbs_serialnumber && (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("bodyshop.fields.dms.disablecontactvehiclecreation")}
|
label={t("bodyshop.fields.dms.disablecontactvehiclecreation")}
|
||||||
@@ -200,7 +206,7 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
|||||||
// },
|
// },
|
||||||
// ]}
|
// ]}
|
||||||
>
|
>
|
||||||
<Select showSearch>
|
<Select allowClear showSearch>
|
||||||
<Select.Option value="ro_number">
|
<Select.Option value="ro_number">
|
||||||
{t("jobs.fields.ro_number")}
|
{t("jobs.fields.ro_number")}
|
||||||
</Select.Option>
|
</Select.Option>
|
||||||
@@ -210,6 +216,9 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
|||||||
<Select.Option value="po_number">
|
<Select.Option value="po_number">
|
||||||
{t("jobs.fields.ponumber")}
|
{t("jobs.fields.ponumber")}
|
||||||
</Select.Option>
|
</Select.Option>
|
||||||
|
<Select.Option value="account_number">
|
||||||
|
{t("jobs.fields.dms.control_type.account_number")}
|
||||||
|
</Select.Option>
|
||||||
</Select>
|
</Select>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
|
|||||||
@@ -273,6 +273,7 @@
|
|||||||
"itc_local": "Local Tax is ITC?",
|
"itc_local": "Local Tax is ITC?",
|
||||||
"itc_state": "State Tax is ITC?",
|
"itc_state": "State Tax is ITC?",
|
||||||
"mappingname": "DMS Mapping Name",
|
"mappingname": "DMS Mapping Name",
|
||||||
|
"sendmaterialscosting": "Materials Cost as % of Sale",
|
||||||
"srcco": "Source Company #/Dealer #"
|
"srcco": "Source Company #/Dealer #"
|
||||||
},
|
},
|
||||||
"email": "General Shop Email",
|
"email": "General Shop Email",
|
||||||
@@ -1360,6 +1361,9 @@
|
|||||||
"address": "Customer Address",
|
"address": "Customer Address",
|
||||||
"amount": "Amount",
|
"amount": "Amount",
|
||||||
"center": "Center",
|
"center": "Center",
|
||||||
|
"control_type": {
|
||||||
|
"account_number": "Account Number"
|
||||||
|
},
|
||||||
"cost": "Cost",
|
"cost": "Cost",
|
||||||
"cost_dms_acctnumber": "Cost DMS Acct #",
|
"cost_dms_acctnumber": "Cost DMS Acct #",
|
||||||
"dms_make": "DMS Make",
|
"dms_make": "DMS Make",
|
||||||
|
|||||||
@@ -273,6 +273,7 @@
|
|||||||
"itc_local": "",
|
"itc_local": "",
|
||||||
"itc_state": "",
|
"itc_state": "",
|
||||||
"mappingname": "",
|
"mappingname": "",
|
||||||
|
"sendmaterialscosting": "",
|
||||||
"srcco": ""
|
"srcco": ""
|
||||||
},
|
},
|
||||||
"email": "",
|
"email": "",
|
||||||
@@ -1360,6 +1361,9 @@
|
|||||||
"address": "",
|
"address": "",
|
||||||
"amount": "",
|
"amount": "",
|
||||||
"center": "",
|
"center": "",
|
||||||
|
"control_type": {
|
||||||
|
"account_number": ""
|
||||||
|
},
|
||||||
"cost": "",
|
"cost": "",
|
||||||
"cost_dms_acctnumber": "",
|
"cost_dms_acctnumber": "",
|
||||||
"dms_make": "",
|
"dms_make": "",
|
||||||
|
|||||||
@@ -273,6 +273,7 @@
|
|||||||
"itc_local": "",
|
"itc_local": "",
|
||||||
"itc_state": "",
|
"itc_state": "",
|
||||||
"mappingname": "",
|
"mappingname": "",
|
||||||
|
"sendmaterialscosting": "",
|
||||||
"srcco": ""
|
"srcco": ""
|
||||||
},
|
},
|
||||||
"email": "",
|
"email": "",
|
||||||
@@ -1360,6 +1361,9 @@
|
|||||||
"address": "",
|
"address": "",
|
||||||
"amount": "",
|
"amount": "",
|
||||||
"center": "",
|
"center": "",
|
||||||
|
"control_type": {
|
||||||
|
"account_number": ""
|
||||||
|
},
|
||||||
"cost": "",
|
"cost": "",
|
||||||
"cost_dms_acctnumber": "",
|
"cost_dms_acctnumber": "",
|
||||||
"dms_make": "",
|
"dms_make": "",
|
||||||
|
|||||||
@@ -209,6 +209,48 @@ exports.default = async function (socket, jobid) {
|
|||||||
// console.log("NO MASH ACCOUNT FOUND!!");
|
// console.log("NO MASH ACCOUNT FOUND!!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.log(
|
||||||
|
Number.isInteger(bodyshop?.cdk_configuration?.sendmaterialscosting),
|
||||||
|
typeof Number.isInteger(bodyshop?.cdk_configuration?.sendmaterialscosting)
|
||||||
|
);
|
||||||
|
if (!!bodyshop?.cdk_configuration?.sendmaterialscosting) {
|
||||||
|
//Manually send the percentage of the costing.
|
||||||
|
|
||||||
|
//Paint Mat
|
||||||
|
const mapaAccountName = selectedDmsAllocationConfig.costs.MAPA;
|
||||||
|
const mapaAccount = bodyshop.md_responsibility_centers.costs.find(
|
||||||
|
(c) => c.name === mapaAccountName
|
||||||
|
);
|
||||||
|
if (mapaAccount) {
|
||||||
|
if (!costCenterHash[mapaAccountName])
|
||||||
|
costCenterHash[mapaAccountName] = Dinero();
|
||||||
|
costCenterHash[mapaAccountName] = costCenterHash[mapaAccountName].add(
|
||||||
|
Dinero(job.job_totals.rates.mapa.total).percentage(
|
||||||
|
bodyshop?.cdk_configuration?.sendmaterialscosting
|
||||||
|
)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
//console.log("NO MAPA ACCOUNT FOUND!!");
|
||||||
|
}
|
||||||
|
|
||||||
|
//Shop Mat
|
||||||
|
const mashAccountName = selectedDmsAllocationConfig.costs.MASH;
|
||||||
|
const mashAccount = bodyshop.md_responsibility_centers.costs.find(
|
||||||
|
(c) => c.name === mashAccountName
|
||||||
|
);
|
||||||
|
if (mashAccount) {
|
||||||
|
if (!costCenterHash[mashAccountName])
|
||||||
|
costCenterHash[mashAccountName] = Dinero();
|
||||||
|
costCenterHash[mashAccountName] = costCenterHash[mashAccountName].add(
|
||||||
|
Dinero(job.job_totals.rates.mash.total).percentage(
|
||||||
|
bodyshop?.cdk_configuration?.sendmaterialscosting
|
||||||
|
)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// console.log("NO MASH ACCOUNT FOUND!!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const { ca_bc_pvrt } = job;
|
const { ca_bc_pvrt } = job;
|
||||||
if (ca_bc_pvrt) {
|
if (ca_bc_pvrt) {
|
||||||
// const pvrtAccount = bodyshop.md_responsibility_centers.profits.find(
|
// const pvrtAccount = bodyshop.md_responsibility_centers.profits.find(
|
||||||
|
|||||||
Reference in New Issue
Block a user