IO-1059 Auto validation for bill on exported job.
This commit is contained in:
@@ -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 ||
|
||||
|
||||
Reference in New Issue
Block a user