IO-2170 Correct for Shift clock so Job Status is only on Job Clock

This commit is contained in:
Allan Carr
2023-07-17 09:56:21 -07:00
parent 94353bb342
commit 90ea2cd699

View File

@@ -101,24 +101,25 @@ export function TechClockOffButton({
message: t("timetickets.successes.clockedout"), message: t("timetickets.successes.clockedout"),
}); });
} }
if (!isShiftTicket) {
const job_update_result = await updateJobStatus({
variables: {
jobId: jobId,
status: status,
},
});
const job_update_result = await updateJobStatus({ if (!!job_update_result.errors) {
variables: { notification["error"]({
jobId: jobId, message: t("jobs.errors.updating", {
status: status, message: JSON.stringify(result.errors),
}, }),
}); });
} else {
if (!!job_update_result.errors) { notification["success"]({
notification["error"]({ message: t("jobs.successes.updated"),
message: t("jobs.errors.updating", { });
message: JSON.stringify(result.errors), }
}),
});
} else {
notification["success"]({
message: t("jobs.successes.updated"),
});
} }
setLoading(false); setLoading(false);
if (completedCallback) completedCallback(); if (completedCallback) completedCallback();
@@ -217,7 +218,6 @@ export function TechClockOffButton({
</Form.Item> </Form.Item>
</div> </div>
) : null} ) : null}
<Form.Item <Form.Item
name="cost_center" name="cost_center"
label={t("timetickets.fields.cost_center")} label={t("timetickets.fields.cost_center")}
@@ -250,26 +250,29 @@ export function TechClockOffButton({
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item {isShiftTicket ? (
name="status" <div></div>
label={t("jobs.fields.status")} ) : (
initialValue={ <Form.Item
lineTicketData && lineTicketData.jobs_by_pk.status name="status"
} label={t("jobs.fields.status")}
rules={[ initialValue={
{ lineTicketData && lineTicketData.jobs_by_pk.status
required: true, }
//message: t("general.validation.required"), rules={[
}, {
]} required: true,
> //message: t("general.validation.required"),
<Select disabled={isShiftTicket}> },
{bodyshop.md_ro_statuses.production_statuses.map((item) => ( ]}
<Select.Option key={item}></Select.Option> >
))} <Select>
</Select> {bodyshop.md_ro_statuses.production_statuses.map((item) => (
</Form.Item> <Select.Option key={item}></Select.Option>
))}
</Select>
</Form.Item>
)}
<Button type="primary" htmlType="submit" loading={loading}> <Button type="primary" htmlType="submit" loading={loading}>
{t("general.actions.save")} {t("general.actions.save")}
</Button> </Button>