From d6d6ced7a4fe57b298ffaa767478983f4cc62b5e Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 1 May 2024 11:47:42 -0700 Subject: [PATCH 1/2] CC modifications. --- bodyshop_translations.babel | 42 +++++++++++++++++++ .../courtesy-car-status-select.component.jsx | 3 ++ .../courtesy-cars-list.component.jsx | 4 ++ client/src/translations/en_us/common.json | 5 ++- client/src/translations/es/common.json | 3 +- client/src/translations/fr/common.json | 3 +- 6 files changed, 56 insertions(+), 4 deletions(-) diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 09552c8e2..5fd7e5826 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -3645,6 +3645,27 @@ + + returnfrombill + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + savewithdiscrepancy false @@ -13807,6 +13828,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 771a321d7..c982c59b3 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 @@ -37,6 +37,9 @@ 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 f5e9a7b71..863a537b8 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 @@ -77,6 +77,10 @@ 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: diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 2ba97cafd..862db6102 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -828,10 +828,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 1d7db8628..7e7ccfede 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -831,7 +831,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 221f1556d..ed723ce65 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -831,7 +831,8 @@ "inservice": "", "leasereturn": "", "out": "", - "sold": "" + "sold": "", + "unavailable": "" }, "successes": { "saved": "" From acc91abc0c4102e5a6c7935aa535eb93c6abb482 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Wed, 1 May 2024 13:26:24 -0700 Subject: [PATCH 2/2] IO-2717 CDK Use Scale Data for Paint Materials Cost Signed-off-by: Allan Carr --- server/cdk/cdk-calculate-allocations.js | 33 +++++++++++++++++++++---- server/graphql-client/queries.js | 5 ++++ 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/server/cdk/cdk-calculate-allocations.js b/server/cdk/cdk-calculate-allocations.js index cd75dc6ec..5f8605232 100644 --- a/server/cdk/cdk-calculate-allocations.js +++ b/server/cdk/cdk-calculate-allocations.js @@ -224,11 +224,34 @@ exports.default = async function (socket, jobid) { 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 (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 b2fd4e23e..8e70ca959 100644 --- a/server/graphql-client/queries.js +++ b/server/graphql-client/queries.js @@ -1793,6 +1793,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 @@ -1900,6 +1901,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 + } } }`;