cost
false
diff --git a/client/src/components/dms-post-form/dms-post-form.component.jsx b/client/src/components/dms-post-form/dms-post-form.component.jsx
index 1204418b5..c9043d050 100644
--- a/client/src/components/dms-post-form/dms-post-form.component.jsx
+++ b/client/src/components/dms-post-form/dms-post-form.component.jsx
@@ -345,7 +345,20 @@ export function DmsPostForm({ bodyshop, socket, job, logsRef }) {
t(`jobs.fields.${cdkPayer?.control_type}`)}
);
- else {
+ else if (
+ i18n.exists(
+ `jobs.fields.dms.control_type.${cdkPayer?.control_type}`
+ )
+ ) {
+ return (
+
+ {cdkPayer &&
+ t(
+ `jobs.fields.dms.control_type.${cdkPayer?.control_type}`
+ )}
+
+ );
+ } else {
return null;
}
}}
diff --git a/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx b/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx
index 699967383..96feb08e4 100644
--- a/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx
+++ b/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx
@@ -139,6 +139,12 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
>
+
+
+
{bodyshop.pbs_serialnumber && (
-
diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json
index 9c3ae03f0..247263894 100644
--- a/client/src/translations/en_us/common.json
+++ b/client/src/translations/en_us/common.json
@@ -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",
diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json
index 6e7454cd0..7aee1ce3e 100644
--- a/client/src/translations/es/common.json
+++ b/client/src/translations/es/common.json
@@ -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": "",
diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json
index 683b09f2c..fc95cb71d 100644
--- a/client/src/translations/fr/common.json
+++ b/client/src/translations/fr/common.json
@@ -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": "",
diff --git a/server/cdk/cdk-calculate-allocations.js b/server/cdk/cdk-calculate-allocations.js
index 5d42d0cdb..cd75dc6ec 100644
--- a/server/cdk/cdk-calculate-allocations.js
+++ b/server/cdk/cdk-calculate-allocations.js
@@ -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(