IO-2116 Add account number to control types for DMS.
This commit is contained in:
@@ -17,5 +17,4 @@
|
||||
"no-console": "off"
|
||||
},
|
||||
"settings": {}
|
||||
//"plugins": ["cypress"]
|
||||
}
|
||||
|
||||
@@ -4402,6 +4402,27 @@
|
||||
</translation>
|
||||
</translations>
|
||||
</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>
|
||||
<name>srcco</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
@@ -22456,6 +22477,32 @@
|
||||
</translation>
|
||||
</translations>
|
||||
</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>
|
||||
<name>cost</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
|
||||
@@ -345,7 +345,20 @@ export function DmsPostForm({ bodyshop, socket, job, logsRef }) {
|
||||
t(`jobs.fields.${cdkPayer?.control_type}`)}
|
||||
</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;
|
||||
}
|
||||
}}
|
||||
|
||||
@@ -139,6 +139,12 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.dms.sendmaterialscosting")}
|
||||
name={["cdk_configuration", "sendmaterialscosting"]}
|
||||
>
|
||||
<InputNumber min={0} max={100} />
|
||||
</Form.Item>
|
||||
{bodyshop.pbs_serialnumber && (
|
||||
<Form.Item
|
||||
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">
|
||||
{t("jobs.fields.ro_number")}
|
||||
</Select.Option>
|
||||
@@ -210,6 +216,9 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
||||
<Select.Option value="po_number">
|
||||
{t("jobs.fields.ponumber")}
|
||||
</Select.Option>
|
||||
<Select.Option value="account_number">
|
||||
{t("jobs.fields.dms.control_type.account_number")}
|
||||
</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
|
||||
|
||||
@@ -273,6 +273,7 @@
|
||||
"itc_local": "Local Tax is ITC?",
|
||||
"itc_state": "State Tax is ITC?",
|
||||
"mappingname": "DMS Mapping Name",
|
||||
"sendmaterialscosting": "Materials Cost as % of Sale",
|
||||
"srcco": "Source Company #/Dealer #"
|
||||
},
|
||||
"email": "General Shop Email",
|
||||
@@ -1360,6 +1361,9 @@
|
||||
"address": "Customer Address",
|
||||
"amount": "Amount",
|
||||
"center": "Center",
|
||||
"control_type": {
|
||||
"account_number": "Account Number"
|
||||
},
|
||||
"cost": "Cost",
|
||||
"cost_dms_acctnumber": "Cost DMS Acct #",
|
||||
"dms_make": "DMS Make",
|
||||
|
||||
@@ -273,6 +273,7 @@
|
||||
"itc_local": "",
|
||||
"itc_state": "",
|
||||
"mappingname": "",
|
||||
"sendmaterialscosting": "",
|
||||
"srcco": ""
|
||||
},
|
||||
"email": "",
|
||||
@@ -1360,6 +1361,9 @@
|
||||
"address": "",
|
||||
"amount": "",
|
||||
"center": "",
|
||||
"control_type": {
|
||||
"account_number": ""
|
||||
},
|
||||
"cost": "",
|
||||
"cost_dms_acctnumber": "",
|
||||
"dms_make": "",
|
||||
|
||||
@@ -273,6 +273,7 @@
|
||||
"itc_local": "",
|
||||
"itc_state": "",
|
||||
"mappingname": "",
|
||||
"sendmaterialscosting": "",
|
||||
"srcco": ""
|
||||
},
|
||||
"email": "",
|
||||
@@ -1360,6 +1361,9 @@
|
||||
"address": "",
|
||||
"amount": "",
|
||||
"center": "",
|
||||
"control_type": {
|
||||
"account_number": ""
|
||||
},
|
||||
"cost": "",
|
||||
"cost_dms_acctnumber": "",
|
||||
"dms_make": "",
|
||||
|
||||
@@ -209,6 +209,48 @@ exports.default = async function (socket, jobid) {
|
||||
// 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;
|
||||
if (ca_bc_pvrt) {
|
||||
// const pvrtAccount = bodyshop.md_responsibility_centers.profits.find(
|
||||
|
||||
Reference in New Issue
Block a user