From 9714371a3697bd41a89ec17874ac1e040746838c Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Tue, 11 Jan 2022 11:39:56 -0800 Subject: [PATCH] IO-1632 Resolve missing cieca code on clock out. --- .../tech-job-clock-out-button.component.jsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/client/src/components/tech-job-clock-out-button/tech-job-clock-out-button.component.jsx b/client/src/components/tech-job-clock-out-button/tech-job-clock-out-button.component.jsx index c0681c0e6..7e4cd8a79 100644 --- a/client/src/components/tech-job-clock-out-button/tech-job-clock-out-button.component.jsx +++ b/client/src/components/tech-job-clock-out-button/tech-job-clock-out-button.component.jsx @@ -55,6 +55,17 @@ export function TechClockOffButton({ timeticket: { clockoff: (await axios.post("/utils/time")).data, ...values, + ciecacode: + bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber + ? values.cost_center + : Object.keys( + bodyshop.md_responsibility_centers.defaults.costs + ).find((key) => { + return ( + bodyshop.md_responsibility_centers.defaults.costs[key] === + values.cost_center + ); + }), }, }, });