diff --git a/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.container.jsx b/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.container.jsx index eeff6d2de..ae223fc92 100644 --- a/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.container.jsx +++ b/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.container.jsx @@ -10,6 +10,7 @@ import { selectTechnician } from "../../redux/tech/tech.selectors"; import { selectBodyshop } from "../../redux/user/user.selectors"; import TechClockInComponent from "./tech-job-clock-in-form.component"; import TechJobPrintTickets from "../tech-job-print-tickets/tech-job-print-tickets.component"; +import moment from "moment"; const mapStateToProps = createStructuredSelector({ technician: selectTechnician, @@ -23,18 +24,19 @@ export function TechClockInContainer({ technician, bodyshop }) { refetchQueries: ["QUERY_ACTIVE_TIME_TICKETS"], }); const { t } = useTranslation(); - + console.log(moment("2022-05-28T01:43:52.508Z").format("YYYY-MM-DD")); const handleFinish = async (values) => { setLoading(true); const theTime = (await axios.post("/utils/time")).data; + const result = await insertTimeTicket({ variables: { timeTicketInput: [ { bodyshopid: bodyshop.id, employeeid: technician.id, - date: theTime, - clockon: theTime, + date: moment(theTime).format("YYYY-MM-DD"), + clockon: moment(theTime), jobid: values.jobid, cost_center: values.cost_center, ciecacode: 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 abf6b17ff..efdcc25d6 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 @@ -47,7 +47,7 @@ export function TechClockOffButton({ const handleFinish = async (values) => { logImEXEvent("tech_clock_out_job"); - + console.log(values); setLoading(true); const result = await updateTimeticket({ variables: { @@ -55,9 +55,10 @@ export function TechClockOffButton({ timeticket: { clockoff: (await axios.post("/utils/time")).data, ...values, - rate: emps && emps.rates.filter( - (r) => r.cost_center === values.cost_center - )[0]?.rate, + rate: + emps && + emps.rates.filter((r) => r.cost_center === values.cost_center)[0] + ?.rate, ciecacode: bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber ? values.cost_center diff --git a/server/data/autohouse.js b/server/data/autohouse.js index c19708714..37476b132 100644 --- a/server/data/autohouse.js +++ b/server/data/autohouse.js @@ -800,7 +800,7 @@ const CreateCosts = (job) => { }; const StatusMapping = (status, md_ro_statuses) => { - //EST, SCH, ARR, IPR, RDY, DEL, CLO, CAN, UNDEFINED. + //Possible return statuses EST, SCH, ARR, IPR, RDY, DEL, CLO, CAN, UNDEFINED. const { default_imported, default_open, @@ -823,8 +823,6 @@ const StatusMapping = (status, md_ro_statuses) => { else if (status === default_void) return "VOID"; else if (md_ro_statuses.production_statuses.includes(status)) return "IPR"; else return "UNDEFINED"; - - // default: return "UNDEFINED" }; const GenerateDetailLines = (job, line, statuses) => {