diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 5d73035cc..81b0ae9c9 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -22603,6 +22603,27 @@ + + shiftclockin + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + diff --git a/client/src/components/job-detail-lines/job-lines.component.jsx b/client/src/components/job-detail-lines/job-lines.component.jsx index 8f5ce8a2e..5491109c6 100644 --- a/client/src/components/job-detail-lines/job-lines.component.jsx +++ b/client/src/components/job-detail-lines/job-lines.component.jsx @@ -47,13 +47,14 @@ export function JobLinesComponent({ form, }) { const [deleteJobLine] = useMutation(DELETE_JOB_LINE_BY_PK); + const { loading: billLinesLoading, error: billLinesError, data: billLinesData, } = useQuery(QUERY_BILLS_BY_JOB_REF, { - variables: { jobId: job.id }, - skip: loading, + variables: { jobId: job && job.id }, + skip: loading || !job, }); const billLinesDataObj = useMemo(() => { diff --git a/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.component.jsx b/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.component.jsx index 163d30772..fadd6e39e 100644 --- a/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.component.jsx +++ b/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.component.jsx @@ -1,19 +1,21 @@ -import { Form } from "antd"; +import { Form, Select } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; +import { selectTechnician } from "../../redux/tech/tech.selectors"; import { selectBodyshop } from "../../redux/user/user.selectors"; import JobSearchSelect from "../job-search-select/job-search-select.component"; import JobsDetailLaborContainer from "../jobs-detail-labor/jobs-detail-labor.container"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, + technician: selectTechnician, }); -export function TechClockInComponent({ form, bodyshop }) { +export function TechClockInComponent({ form, bodyshop, technician }) { const { t } = useTranslation(); - + const emps = bodyshop.employees.filter((e) => e.id === technician.id)[0]; return (
+ + + + prevValues.jobid !== curValues.jobid 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 920cc3744..6aa69f208 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 @@ -35,7 +35,7 @@ export function TechClockInContainer({ technician, bodyshop }) { date: theTime, clockon: theTime, jobid: values.jobid, - cost_center: technician.cost_center, + cost_center: values.cost_center, ciecacode: Object.keys( bodyshop.md_responsibility_centers.defaults.costs ).find((key) => { 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 d88791562..2ebbf2b14 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 @@ -30,6 +30,7 @@ export function TechClockOffButton({ const [form] = Form.useForm(); const { t } = useTranslation(); + const emps = bodyshop.employees.filter((e) => e.id === technician.id)[0]; const handleFinish = async (values) => { logImEXEvent("tech_clock_out_job"); @@ -120,9 +121,10 @@ export function TechClockOffButton({ {t("timetickets.labels.shift")} ) : ( - bodyshop.md_responsibility_centers.costs.map((i, idx) => ( - - {i.name} + emps && + emps.rates.map((item) => ( + + {item.cost_center} )) )} diff --git a/client/src/components/tech-job-clocked-in-list/tech-job-clocked-in-list.component.jsx b/client/src/components/tech-job-clocked-in-list/tech-job-clocked-in-list.component.jsx index c959e2fd7..e028a29c5 100644 --- a/client/src/components/tech-job-clocked-in-list/tech-job-clocked-in-list.component.jsx +++ b/client/src/components/tech-job-clocked-in-list/tech-job-clocked-in-list.component.jsx @@ -81,6 +81,9 @@ export function TechClockedInList({ technician }) { {ticket.clockon} + + {ticket.cost_center}{" "} + )} diff --git a/client/src/components/tech-lookup-jobs-drawer/tech-lookup-jobs-drawer.component.jsx b/client/src/components/tech-lookup-jobs-drawer/tech-lookup-jobs-drawer.component.jsx index 6607115dd..da5e98981 100644 --- a/client/src/components/tech-lookup-jobs-drawer/tech-lookup-jobs-drawer.component.jsx +++ b/client/src/components/tech-lookup-jobs-drawer/tech-lookup-jobs-drawer.component.jsx @@ -116,16 +116,12 @@ export function JobDetailCards({ setPrintCenterContext }) { } > - - What would be good to have here? - What would be good to have here? - What would be good to have here? - diff --git a/client/src/graphql/timetickets.queries.js b/client/src/graphql/timetickets.queries.js index c961e49e1..ae34bf326 100644 --- a/client/src/graphql/timetickets.queries.js +++ b/client/src/graphql/timetickets.queries.js @@ -115,6 +115,7 @@ export const QUERY_ACTIVE_TIME_TICKETS = gql` id clockon memo + cost_center job { id diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index b6f7ebb49..4a42b969e 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -1344,7 +1344,8 @@ "login": "Login", "logout": "Logout", "productionboard": "Production Board - Visual", - "productionlist": "Production List" + "productionlist": "Production List", + "shiftclockin": "Shift Clock" } }, "messaging": { diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 6b82ab965..6bd48d031 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -1344,7 +1344,8 @@ "login": "", "logout": "", "productionboard": "", - "productionlist": "" + "productionlist": "", + "shiftclockin": "" } }, "messaging": { diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 62dc9d20c..f417d6872 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -1344,7 +1344,8 @@ "login": "", "logout": "", "productionboard": "", - "productionlist": "" + "productionlist": "", + "shiftclockin": "" } }, "messaging": {