diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 2e39fa216..d987d9ac9 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -2527,6 +2527,27 @@ validation + + manualinhouse + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + unique_invoice_number false diff --git a/client/src/components/bill-form/bill-form.component.jsx b/client/src/components/bill-form/bill-form.component.jsx index b5cfb9322..e8d8e4387 100644 --- a/client/src/components/bill-form/bill-form.component.jsx +++ b/client/src/components/bill-form/bill-form.component.jsx @@ -106,6 +106,18 @@ export function BillFormComponent({ required: true, //message: t("general.validation.required"), }, + ({ getFieldValue }) => ({ + validator(rule, value) { + if ( + value && + !getFieldValue(["isinhouse"]) && + value === bodyshop.inhousevendorid + ) { + return Promise.reject(t("bills.validation.manualinhouse")); + } + return Promise.resolve(); + }, + }), ]} >