IO-3515 additional cleanup, translations

This commit is contained in:
Patrick Fic
2026-02-19 14:15:57 -08:00
parent b2bc19c5c9
commit 21f43285bc
10 changed files with 159 additions and 88 deletions

View File

@@ -111,7 +111,6 @@ function BillEnterAiScan({
formdata.append("jobid", billEnterModal.context.job?.id);
formdata.append("bodyshopid", bodyshop.id);
formdata.append("partsorderid", billEnterModal.context.parts_order?.id);
//formdata.append("skipTextract", "true"); // For testing purposes
try {
const { data, status } = await axios.post("/ai/bill-ocr", formdata);
@@ -147,7 +146,7 @@ function BillEnterAiScan({
setScanLoading(false);
notification.error({
title: t("bills.labels.ai.scanfailed"),
message: error.response?.data?.message || error.message || "Failed to process invoice"
message: error.response?.data?.message || error.message || t("bills.labels.ai.generic_failure")
});
}
}

View File

@@ -119,6 +119,8 @@ function BillEnterModalContainer({ billEnterModal, toggleModalVisible, bodyshop,
create_ppc,
// eslint-disable-next-line no-unused-vars
original_actual_price,
// eslint-disable-next-line no-unused-vars
confidence,
...restI
} = i;

View File

@@ -128,7 +128,7 @@ export function BillFormComponent({
]);
useEffect(() => {
console.log("*** Form Watch - jobid changed:", jobIdFormWatch);
// When the jobid is set by AI scan, we need to reload the lines. This prevents having to hoist the apollo query.
if (jobIdFormWatch !== null) {
if (form.getFieldValue("jobid") !== null && form.getFieldValue("jobid") !== undefined) {
loadLines({ variables: { id: form.getFieldValue("jobid") } });
@@ -399,8 +399,8 @@ export function BillFormComponent({
totals = CalculateBillTotal(values);
} catch (error) {
notification.error({
title: "Error calculating totals",
message: error.message || "An error occurred while calculating bill totals.",
title: t("bills.errors.calculating_totals"),
message: error.message || t("bills.errors.calculating_totals_generic"),
key: "bill_totals_calculation_error"
});
}

View File

@@ -192,6 +192,8 @@
"return": "Return Items"
},
"errors": {
"calculating_totals": "Error Calculating Totals",
"calculating_totals_generic": "Please ensure all fields are properly completed. ",
"creating": "Error adding bill. {{error}}",
"deleting": "Error deleting bill. {{error}}",
"existinginventoryline": "This bill cannot be deleted as it is tied to items in inventory.",
@@ -228,6 +230,7 @@
"overall": "Overall"
},
"disclaimer_title": "AI Scan Beta Disclaimer",
"generic_failure": "Failed to process invoice.",
"multipage": "The is a multi-page document. Processing will take a few moments.",
"processing": "Analyzing Bill",
"scan": "AI Bill Scanner",

View File

@@ -192,6 +192,8 @@
"return": ""
},
"errors": {
"calculating_totals": "",
"calculating_totals_generic": "",
"creating": "",
"deleting": "",
"existinginventoryline": "",
@@ -228,6 +230,7 @@
"overall": ""
},
"disclaimer_title": "",
"generic_failure": "",
"multipage": "",
"processing": "",
"scan": "",

View File

@@ -192,6 +192,8 @@
"return": ""
},
"errors": {
"calculating_totals": "",
"calculating_totals_generic": "",
"creating": "",
"deleting": "",
"existinginventoryline": "",
@@ -228,6 +230,7 @@
"overall": ""
},
"disclaimer_title": "",
"generic_failure": "",
"multipage": "",
"processing": "",
"scan": "",