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