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

@@ -2527,6 +2527,27 @@
<folder_node>
<name>validation</name>
<children>
<concept_node>
<name>manualinhouse</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>unique_invoice_number</name>
<definition_loaded>false</definition_loaded>

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

View File

@@ -167,6 +167,7 @@
"exported": "Bill exported successfully."
},
"validation": {
"manualinhouse": "Manual posting to the in house vendor is restricted. ",
"unique_invoice_number": "This invoice number has already been entered for this vendor."
}
},

View File

@@ -167,6 +167,7 @@
"exported": ""
},
"validation": {
"manualinhouse": "",
"unique_invoice_number": ""
}
},

View File

@@ -167,6 +167,7 @@
"exported": ""
},
"validation": {
"manualinhouse": "",
"unique_invoice_number": ""
}
},