Merged in feature/IO-3529-DMS-Make-Code (pull request #2926)
IO-3529 Job Lines on Closing add IDs
This commit is contained in:
@@ -42,6 +42,10 @@ export function JobsCloseLines({ bodyshop, job, jobRO }) {
|
|||||||
<tbody>
|
<tbody>
|
||||||
{fields.map((field, index) => (
|
{fields.map((field, index) => (
|
||||||
<tr key={field.key}>
|
<tr key={field.key}>
|
||||||
|
{/* Hidden field to preserve jobline ID */}
|
||||||
|
<Form.Item hidden name={[field.name, "id"]}>
|
||||||
|
<input />
|
||||||
|
</Form.Item>
|
||||||
<td>
|
<td>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
// label={t("joblines.fields.line_desc")}
|
// label={t("joblines.fields.line_desc")}
|
||||||
|
|||||||
@@ -82,10 +82,23 @@ export function JobsCloseComponent({ job, bodyshop, jobRO, insertAuditTrail, set
|
|||||||
|
|
||||||
const handleFinish = async ({ removefromproduction, ...values }) => {
|
const handleFinish = async ({ removefromproduction, ...values }) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|
||||||
|
// Validate that all joblines have valid IDs
|
||||||
|
const joblinesWithIds = values.joblines.filter(jl => jl && jl.id);
|
||||||
|
if (joblinesWithIds.length !== values.joblines.length) {
|
||||||
|
notification.error({
|
||||||
|
title: t("jobs.errors.invalidjoblines"),
|
||||||
|
message: t("jobs.errors.missingjoblineids")
|
||||||
|
});
|
||||||
|
setLoading(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const result = await client.mutate({
|
const result = await client.mutate({
|
||||||
mutation: generateJobLinesUpdatesForInvoicing(values.joblines)
|
mutation: generateJobLinesUpdatesForInvoicing(values.joblines)
|
||||||
});
|
});
|
||||||
if (result.errors) {
|
if (result.errors) {
|
||||||
|
setLoading(false);
|
||||||
return; // Abandon the rest of the close.
|
return; // Abandon the rest of the close.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1676,7 +1676,9 @@
|
|||||||
"deleted": "Error deleting Job. {{error}}",
|
"deleted": "Error deleting Job. {{error}}",
|
||||||
"exporting": "Error exporting Job. {{error}}",
|
"exporting": "Error exporting Job. {{error}}",
|
||||||
"exporting-partner": "Unable to connect to partner application. Please ensure it is running and logged in.",
|
"exporting-partner": "Unable to connect to partner application. Please ensure it is running and logged in.",
|
||||||
|
"invalidjoblines": "Job has invalid job lines.",
|
||||||
"invoicing": "Error invoicing Job. {{error}}",
|
"invoicing": "Error invoicing Job. {{error}}",
|
||||||
|
"missingjoblineids": "Missing job line IDs for job lines.",
|
||||||
"noaccess": "This Job does not exist or you do not have access to it.",
|
"noaccess": "This Job does not exist or you do not have access to it.",
|
||||||
"nodamage": "No damage points on estimate.",
|
"nodamage": "No damage points on estimate.",
|
||||||
"nodates": "No dates specified for this Job.",
|
"nodates": "No dates specified for this Job.",
|
||||||
|
|||||||
@@ -1674,7 +1674,9 @@
|
|||||||
"deleted": "Error al eliminar el trabajo.",
|
"deleted": "Error al eliminar el trabajo.",
|
||||||
"exporting": "",
|
"exporting": "",
|
||||||
"exporting-partner": "",
|
"exporting-partner": "",
|
||||||
|
"invalidjoblines": "",
|
||||||
"invoicing": "",
|
"invoicing": "",
|
||||||
|
"missingjoblineids": "",
|
||||||
"noaccess": "Este trabajo no existe o no tiene acceso a él.",
|
"noaccess": "Este trabajo no existe o no tiene acceso a él.",
|
||||||
"nodamage": "",
|
"nodamage": "",
|
||||||
"nodates": "No hay fechas especificadas para este trabajo.",
|
"nodates": "No hay fechas especificadas para este trabajo.",
|
||||||
|
|||||||
@@ -1674,7 +1674,9 @@
|
|||||||
"deleted": "Erreur lors de la suppression du travail.",
|
"deleted": "Erreur lors de la suppression du travail.",
|
||||||
"exporting": "",
|
"exporting": "",
|
||||||
"exporting-partner": "",
|
"exporting-partner": "",
|
||||||
|
"invalidjoblines": "",
|
||||||
"invoicing": "",
|
"invoicing": "",
|
||||||
|
"missingjoblineids": "",
|
||||||
"noaccess": "Ce travail n'existe pas ou vous n'y avez pas accès.",
|
"noaccess": "Ce travail n'existe pas ou vous n'y avez pas accès.",
|
||||||
"nodamage": "",
|
"nodamage": "",
|
||||||
"nodates": "Aucune date spécifiée pour ce travail.",
|
"nodates": "Aucune date spécifiée pour ce travail.",
|
||||||
|
|||||||
Reference in New Issue
Block a user