Resolve time ticket posting issue.
This commit is contained in:
@@ -26,6 +26,10 @@ export function TechClockInContainer({
|
||||
technician,
|
||||
bodyshop,
|
||||
}) {
|
||||
console.log(
|
||||
"🚀 ~ file: tech-job-clock-in-form.container.jsx:29 ~ technician:",
|
||||
technician
|
||||
);
|
||||
const [form] = Form.useForm();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [insertTimeTicket] = useMutation(INSERT_NEW_TIME_TICKET, {
|
||||
@@ -33,6 +37,10 @@ export function TechClockInContainer({
|
||||
});
|
||||
const { t } = useTranslation();
|
||||
|
||||
const emps = bodyshop.employees.filter(
|
||||
(e) => e.id === (technician && technician.id)
|
||||
)[0];
|
||||
|
||||
const handleFinish = async (values) => {
|
||||
setLoading(true);
|
||||
const theTime = (await axios.post("/utils/time")).data;
|
||||
@@ -87,7 +95,12 @@ export function TechClockInContainer({
|
||||
onClick={() => {
|
||||
setTimeTicketContext({
|
||||
actions: {},
|
||||
context: { timeticket: { employeeid: technician.id } },
|
||||
context: {
|
||||
timeticket: {
|
||||
employeeid: technician.id,
|
||||
flat_rate: emps.flat_rate,
|
||||
},
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -59,6 +59,7 @@ export function TechClockOffButton({
|
||||
emps &&
|
||||
emps.rates.filter((r) => r.cost_center === values.cost_center)[0]
|
||||
?.rate,
|
||||
flat_rate: emps.flat_rate,
|
||||
ciecacode:
|
||||
bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
|
||||
? values.cost_center
|
||||
|
||||
@@ -125,6 +125,7 @@ export const QUERY_BODYSHOP = gql`
|
||||
employee_number
|
||||
rates
|
||||
external_id
|
||||
flat_rate
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user