Added voiding of ROs IO-639
This commit is contained in:
@@ -75,6 +75,7 @@ function Header({
|
||||
className="header-main-menu"
|
||||
selectedKeys={[selectedHeader]}
|
||||
onClick={handleMenuClick}
|
||||
subMenuCloseDelay={0.3}
|
||||
>
|
||||
<Menu.Item key="home">
|
||||
<Link to="/manage">
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -169,7 +169,9 @@ export default function ShopInfoROStatusComponent({ form }) {
|
||||
>
|
||||
<Select>
|
||||
{options.map((item, idx) => (
|
||||
<Select.Option key={idx}>{item}</Select.Option>
|
||||
<Select.Option key={idx} value={item}>
|
||||
{item}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
@@ -185,7 +187,9 @@ export default function ShopInfoROStatusComponent({ form }) {
|
||||
>
|
||||
<Select>
|
||||
{options.map((item, idx) => (
|
||||
<Select.Option key={idx}>{item}</Select.Option>
|
||||
<Select.Option key={idx} value={item}>
|
||||
{item}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
@@ -201,7 +205,9 @@ export default function ShopInfoROStatusComponent({ form }) {
|
||||
>
|
||||
<Select>
|
||||
{options.map((item, idx) => (
|
||||
<Select.Option key={idx}>{item}</Select.Option>
|
||||
<Select.Option key={idx} value={item}>
|
||||
{item}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
@@ -217,7 +223,9 @@ export default function ShopInfoROStatusComponent({ form }) {
|
||||
>
|
||||
<Select>
|
||||
{options.map((item, idx) => (
|
||||
<Select.Option key={idx}>{item}</Select.Option>
|
||||
<Select.Option key={idx} value={item}>
|
||||
{item}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
@@ -233,7 +241,9 @@ export default function ShopInfoROStatusComponent({ form }) {
|
||||
>
|
||||
<Select>
|
||||
{options.map((item, idx) => (
|
||||
<Select.Option key={idx}>{item}</Select.Option>
|
||||
<Select.Option key={idx} value={item}>
|
||||
{item}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
@@ -249,7 +259,9 @@ export default function ShopInfoROStatusComponent({ form }) {
|
||||
>
|
||||
<Select>
|
||||
{options.map((item, idx) => (
|
||||
<Select.Option key={idx}>{item}</Select.Option>
|
||||
<Select.Option key={idx} value={item}>
|
||||
{item}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
@@ -265,7 +277,9 @@ export default function ShopInfoROStatusComponent({ form }) {
|
||||
>
|
||||
<Select>
|
||||
{options.map((item, idx) => (
|
||||
<Select.Option key={idx}>{item}</Select.Option>
|
||||
<Select.Option key={idx} value={item}>
|
||||
{item}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
@@ -281,7 +295,9 @@ export default function ShopInfoROStatusComponent({ form }) {
|
||||
>
|
||||
<Select>
|
||||
{options.map((item, idx) => (
|
||||
<Select.Option key={idx}>{item}</Select.Option>
|
||||
<Select.Option key={idx} value={item}>
|
||||
{item}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
|
||||
@@ -473,6 +473,7 @@ export const GET_JOB_BY_PK = gql`
|
||||
class
|
||||
category
|
||||
deliverchecklist
|
||||
voided
|
||||
joblines(where: { jobid: { _eq: $id } }, order_by: { line_no: asc }) {
|
||||
id
|
||||
line_no
|
||||
@@ -615,6 +616,7 @@ export const QUERY_JOB_CARD_DETAILS = gql`
|
||||
updated_at
|
||||
clm_total
|
||||
ded_amt
|
||||
voided
|
||||
cccontracts {
|
||||
id
|
||||
agreementnumber
|
||||
@@ -657,7 +659,7 @@ export const QUERY_TECH_JOB_DETAILS = gql`
|
||||
date_invoiced
|
||||
date_open
|
||||
date_exported
|
||||
|
||||
voided
|
||||
date_scheduled
|
||||
date_estimated
|
||||
employee_body
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useMutation, useQuery } from "@apollo/react-hooks";
|
||||
import React, { useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import AlertComponent from "../../components/alert/alert.component";
|
||||
import SpinComponent from "../../components/loading-spinner/loading-spinner.component";
|
||||
import NotFound from "../../components/not-found/not-found.component";
|
||||
@@ -13,9 +14,14 @@ import {
|
||||
setJobReadOnly,
|
||||
setSelectedHeader,
|
||||
} from "../../redux/application/application.actions";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import { CreateRecentItem } from "../../utils/create-recent-item";
|
||||
import JobsDetailPage from "./jobs-detail.page.component";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
||||
addRecentItem: (item) => dispatch(addRecentItem(item)),
|
||||
@@ -24,6 +30,7 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
});
|
||||
|
||||
function JobsDetailPageContainer({
|
||||
bodyshop,
|
||||
match,
|
||||
setBreadcrumbs,
|
||||
addRecentItem,
|
||||
@@ -64,7 +71,9 @@ function JobsDetailPageContainer({
|
||||
|
||||
if (data && data.jobs_by_pk) {
|
||||
setJobReadOnly(
|
||||
!!data.jobs_by_pk.date_exported || !!data.jobs_by_pk.date_invoiced
|
||||
data.jobs_by_pk.date_exported ||
|
||||
data.jobs_by_pk.date_invoiced ||
|
||||
data.jobs_by_pk.voided
|
||||
);
|
||||
|
||||
addRecentItem(
|
||||
@@ -108,4 +117,7 @@ function JobsDetailPageContainer({
|
||||
<AlertComponent message={t("jobs.errors.noaccess")} type="error" />
|
||||
);
|
||||
}
|
||||
export default connect(null, mapDispatchToProps)(JobsDetailPageContainer);
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(JobsDetailPageContainer);
|
||||
|
||||
@@ -909,9 +909,10 @@
|
||||
"noowner": "No owner associated.",
|
||||
"novehicle": "No vehicle associated.",
|
||||
"saving": "Error encountered while saving record.",
|
||||
"updating": "Error while updating job(s). {{error}}",
|
||||
"updating": "Error while updating job(s). {{error}}",
|
||||
"validation": "Please ensure all fields are entered correctly.",
|
||||
"validationtitle": "Validation Error"
|
||||
"validationtitle": "Validation Error",
|
||||
"voiding": "Error voiding job. {{error}}"
|
||||
},
|
||||
"fields": {
|
||||
"actual_completion": "Actual Completion",
|
||||
@@ -1189,7 +1190,8 @@
|
||||
"totals": "Totals",
|
||||
"vehicle_info": "Vehicle",
|
||||
"vehicleassociation": "Vehicle Association",
|
||||
"viewallocations": "View Allocations"
|
||||
"viewallocations": "View Allocations",
|
||||
"voidjob": "Are you sure you want to void this job? This cannot be easily undone. "
|
||||
},
|
||||
"successes": {
|
||||
"addedtoproduction": "Job added to production board.",
|
||||
@@ -1207,7 +1209,8 @@
|
||||
"save": "Job saved successfully.",
|
||||
"savetitle": "Record saved successfully.",
|
||||
"supplemented": "Job supplemented successfully. ",
|
||||
"updated": "Job(s) updated successfully."
|
||||
"updated": "Job(s) updated successfully.",
|
||||
"voided": "Job voided successfully."
|
||||
}
|
||||
},
|
||||
"menus": {
|
||||
@@ -1267,7 +1270,8 @@
|
||||
"deletejob": "Delete Job",
|
||||
"duplicate": "Duplicate this Job",
|
||||
"duplicatenolines": "Duplicate this Job without Repair Data",
|
||||
"newcccontract": "Create Courtesy Car Contract"
|
||||
"newcccontract": "Create Courtesy Car Contract",
|
||||
"void": "Void Job"
|
||||
},
|
||||
"jobsdetail": {
|
||||
"claimdetail": "Claim Details",
|
||||
|
||||
@@ -911,7 +911,8 @@
|
||||
"saving": "Se encontró un error al guardar el registro.",
|
||||
"updating": "",
|
||||
"validation": "Asegúrese de que todos los campos se ingresen correctamente.",
|
||||
"validationtitle": "Error de validacion"
|
||||
"validationtitle": "Error de validacion",
|
||||
"voiding": ""
|
||||
},
|
||||
"fields": {
|
||||
"actual_completion": "Realización real",
|
||||
@@ -1189,7 +1190,8 @@
|
||||
"totals": "",
|
||||
"vehicle_info": "Vehículo",
|
||||
"vehicleassociation": "",
|
||||
"viewallocations": ""
|
||||
"viewallocations": "",
|
||||
"voidjob": ""
|
||||
},
|
||||
"successes": {
|
||||
"addedtoproduction": "",
|
||||
@@ -1207,7 +1209,8 @@
|
||||
"save": "Trabajo guardado con éxito.",
|
||||
"savetitle": "Registro guardado con éxito.",
|
||||
"supplemented": "Trabajo complementado con éxito.",
|
||||
"updated": ""
|
||||
"updated": "",
|
||||
"voided": ""
|
||||
}
|
||||
},
|
||||
"menus": {
|
||||
@@ -1267,7 +1270,8 @@
|
||||
"deletejob": "",
|
||||
"duplicate": "",
|
||||
"duplicatenolines": "",
|
||||
"newcccontract": ""
|
||||
"newcccontract": "",
|
||||
"void": ""
|
||||
},
|
||||
"jobsdetail": {
|
||||
"claimdetail": "Detalles de la reclamación",
|
||||
|
||||
@@ -911,7 +911,8 @@
|
||||
"saving": "Erreur rencontrée lors de la sauvegarde de l'enregistrement.",
|
||||
"updating": "",
|
||||
"validation": "Veuillez vous assurer que tous les champs sont correctement entrés.",
|
||||
"validationtitle": "Erreur de validation"
|
||||
"validationtitle": "Erreur de validation",
|
||||
"voiding": ""
|
||||
},
|
||||
"fields": {
|
||||
"actual_completion": "Achèvement réel",
|
||||
@@ -1189,7 +1190,8 @@
|
||||
"totals": "",
|
||||
"vehicle_info": "Véhicule",
|
||||
"vehicleassociation": "",
|
||||
"viewallocations": ""
|
||||
"viewallocations": "",
|
||||
"voidjob": ""
|
||||
},
|
||||
"successes": {
|
||||
"addedtoproduction": "",
|
||||
@@ -1207,7 +1209,8 @@
|
||||
"save": "Le travail a été enregistré avec succès.",
|
||||
"savetitle": "Enregistrement enregistré avec succès.",
|
||||
"supplemented": "Travail complété avec succès.",
|
||||
"updated": ""
|
||||
"updated": "",
|
||||
"voided": ""
|
||||
}
|
||||
},
|
||||
"menus": {
|
||||
@@ -1267,7 +1270,8 @@
|
||||
"deletejob": "",
|
||||
"duplicate": "",
|
||||
"duplicatenolines": "",
|
||||
"newcccontract": ""
|
||||
"newcccontract": "",
|
||||
"void": ""
|
||||
},
|
||||
"jobsdetail": {
|
||||
"claimdetail": "Détails de la réclamation",
|
||||
|
||||
Reference in New Issue
Block a user