diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index c23acfa76..fd7c9e586 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -14573,6 +14573,27 @@ + + unavailable + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + diff --git a/client/src/components/courtesy-car-status-select/courtesy-car-status-select.component.jsx b/client/src/components/courtesy-car-status-select/courtesy-car-status-select.component.jsx index 72c886da5..84c346ce6 100644 --- a/client/src/components/courtesy-car-status-select/courtesy-car-status-select.component.jsx +++ b/client/src/components/courtesy-car-status-select/courtesy-car-status-select.component.jsx @@ -28,6 +28,7 @@ const CourtesyCarStatusComponent = ({ value, onChange }, ref) => { + ); }; diff --git a/client/src/components/courtesy-cars-list/courtesy-cars-list.component.jsx b/client/src/components/courtesy-cars-list/courtesy-cars-list.component.jsx index bf144de4a..2f96c7491 100644 --- a/client/src/components/courtesy-cars-list/courtesy-cars-list.component.jsx +++ b/client/src/components/courtesy-cars-list/courtesy-cars-list.component.jsx @@ -61,7 +61,11 @@ export default function CourtesyCarsList({ loading, courtesycars, refetch }) { { text: t("courtesycars.status.leasereturn"), value: "courtesycars.status.leasereturn" - } + }, + { + text: t("courtesycars.status.unavailable"), + value: "courtesycars.status.unavailable", + }, ], onFilter: (value, record) => record.status === value, sortOrder: state.sortedInfo.columnKey === "status" && state.sortedInfo.order, diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index d65f28b51..0011cede6 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -866,10 +866,11 @@ }, "status": { "in": "Available", - "inservice": "In Service", + "inservice": "Service/Maintenance", "leasereturn": "Lease Returned", "out": "Rented", - "sold": "Sold" + "sold": "Sold", + "unavailable": "Unavailable" }, "successes": { "saved": "Courtesy Car saved successfully." diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index cc5e1fead..463e310e6 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -869,7 +869,8 @@ "inservice": "", "leasereturn": "", "out": "", - "sold": "" + "sold": "", + "unavailable": "" }, "successes": { "saved": "" diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index cde29d341..8ddbeef43 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -869,7 +869,8 @@ "inservice": "", "leasereturn": "", "out": "", - "sold": "" + "sold": "", + "unavailable": "" }, "successes": { "saved": "" diff --git a/server/cdk/cdk-calculate-allocations.js b/server/cdk/cdk-calculate-allocations.js index 600db20b4..b557f322d 100644 --- a/server/cdk/cdk-calculate-allocations.js +++ b/server/cdk/cdk-calculate-allocations.js @@ -236,10 +236,36 @@ exports.default = async function (socket, jobid) { 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) - ); + if (!costCenterHash[mapaAccountName]) + costCenterHash[mapaAccountName] = Dinero(); + if (job.bodyshop.use_paint_scale_data === true) { + if (job.mixdata.length > 0) { + costCenterHash[mapaAccountName] = costCenterHash[ + mapaAccountName + ].add( + Dinero({ + amount: Math.round( + ((job.mixdata[0] && job.mixdata[0].totalliquidcost) || 0) * + 100 + ), + }) + ); + } else { + costCenterHash[mapaAccountName] = costCenterHash[ + mapaAccountName + ].add( + Dinero(job.job_totals.rates.mapa.total).percentage( + bodyshop?.cdk_configuration?.sendmaterialscosting + ) + ); + } + } else { + costCenterHash[mapaAccountName] = costCenterHash[mapaAccountName].add( + Dinero(job.job_totals.rates.mapa.total).percentage( + bodyshop?.cdk_configuration?.sendmaterialscosting + ) + ); + } } else { //console.log("NO MAPA ACCOUNT FOUND!!"); } diff --git a/server/graphql-client/queries.js b/server/graphql-client/queries.js index cd61b3575..d26db1405 100644 --- a/server/graphql-client/queries.js +++ b/server/graphql-client/queries.js @@ -1790,6 +1790,7 @@ exports.GET_CDK_ALLOCATIONS = `query QUERY_JOB_CLOSE_DETAILS($id: uuid!) { md_responsibility_centers cdk_configuration pbs_configuration + use_paint_scale_data } ro_number dms_allocation @@ -1897,6 +1898,10 @@ exports.GET_CDK_ALLOCATIONS = `query QUERY_JOB_CLOSE_DETAILS($id: uuid!) { line_ref unq_seq } + mixdata(limit: 1, order_by: {updated_at: desc}) { + jobid + totalliquidcost + } } }`;