IO-1182 Restrict manual posting to in house vendor.

This commit is contained in:
Patrick Fic
2021-06-04 09:26:15 -07:00
parent a8b555b773
commit fb5a146dee
5 changed files with 36 additions and 0 deletions

View File

@@ -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();
},
}),
]}
>
<VendorSearchSelect