Added voiding of ROs IO-639

This commit is contained in:
Patrick Fic
2021-02-19 09:43:08 -08:00
parent 7eec9ef550
commit 450ce3dbc3
18 changed files with 1782 additions and 26 deletions

View File

@@ -267,7 +267,6 @@ export function JobsDetailHeaderActions({
key="jobcosting"
onClick={() => {
logImEXEvent("job_header_job_costing");
setJobCostingContext({
actions: { refetch: refetch },
context: {
@@ -309,6 +308,45 @@ export function JobsDetailHeaderActions({
</Popconfirm>
</Menu.Item>
)}
{!jobRO && job.converted && (
<Menu.Item>
<Popconfirm
title={t("jobs.labels.voidjob")}
okText="Yes"
cancelText="No"
onClick={(e) => e.stopPropagation()}
onConfirm={async () => {
//delete the job.
const result = await updateJob({
variables: {
jobId: job.id,
job: {
status: bodyshop.md_ro_statuses.default_void,
voided: true,
},
},
});
if (!!!result.errors) {
notification["success"]({
message: t("jobs.successes.voided"),
});
//go back to jobs list.
history.push(`/manage/`);
} else {
notification["error"]({
message: t("jobs.errors.voiding", {
error: JSON.stringify(result.errors),
}),
});
}
}}
getPopupContainer={(trigger) => trigger.parentNode}
>
{t("menus.jobsactions.void")}
</Popconfirm>
</Menu.Item>
)}
</Menu>
);
return (