IO-1059 Auto validation for bill on exported job.

This commit is contained in:
Patrick Fic
2021-06-08 17:14:47 -07:00
parent 0fa214f029
commit c6df38e753

View File

@@ -51,6 +51,11 @@ export function BillFormComponent({
setDiscount(opt.discount);
};
useEffect(() => {
if (job) form.validateFields(["is_credit_memo"]);
}, [job, form]);
console.log("🚀 ~ file: bill-form.component.jsx ~ line 57 ~ job", job);
useEffect(() => {
if (form.getFieldValue("vendorid") && vendorAutoCompleteOptions) {
const vendorId = form.getFieldValue("vendorid");
@@ -188,10 +193,10 @@ export function BillFormComponent({
label={t("bills.fields.is_credit_memo")}
name="is_credit_memo"
valuePropName="checked"
dependencies={["jobid"]}
rules={[
({ getFieldValue }) => ({
validator(rule, value) {
console.log("VALIDATOR FIRED");
if (
(job.status === bodyshop.md_ro_statuses.default_invoiced ||
job.status === bodyshop.md_ro_statuses.default_exported ||