fix: setting paid amount to 0 when is_paid is unchecked in purchase invoice
This commit is contained in:
@@ -437,6 +437,8 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
|
||||
this.frm.set_value("is_paid", 0);
|
||||
frappe.msgprint(__("Please specify Company to proceed"));
|
||||
}
|
||||
} else {
|
||||
this.frm.set_value("paid_amount", 0);
|
||||
}
|
||||
this.calculate_outstanding_amount();
|
||||
this.frm.refresh_fields();
|
||||
|
||||
@@ -650,6 +650,9 @@ class AccountsController(TransactionBase):
|
||||
self.base_paid_amount = flt(
|
||||
self.paid_amount * self.conversion_rate, self.precision("base_paid_amount")
|
||||
)
|
||||
else:
|
||||
self.paid_amount = 0
|
||||
self.base_paid_amount = 0
|
||||
|
||||
def set_missing_values(self, for_validate=False):
|
||||
if frappe.flags.in_test:
|
||||
|
||||
Reference in New Issue
Block a user