mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-21 15:48:29 +00:00
fix: setting paid amount to 0 when is_paid is unchecked in purchase invoice
(cherry picked from commit e358a9e53f)
This commit is contained in:
@@ -425,6 +425,8 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
|
|||||||
this.frm.set_value("is_paid", 0);
|
this.frm.set_value("is_paid", 0);
|
||||||
frappe.msgprint(__("Please specify Company to proceed"));
|
frappe.msgprint(__("Please specify Company to proceed"));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.frm.set_value("paid_amount", 0);
|
||||||
}
|
}
|
||||||
this.calculate_outstanding_amount();
|
this.calculate_outstanding_amount();
|
||||||
this.frm.refresh_fields();
|
this.frm.refresh_fields();
|
||||||
|
|||||||
@@ -649,6 +649,9 @@ class AccountsController(TransactionBase):
|
|||||||
self.base_paid_amount = flt(
|
self.base_paid_amount = flt(
|
||||||
self.paid_amount * self.conversion_rate, self.precision("base_paid_amount")
|
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):
|
def set_missing_values(self, for_validate=False):
|
||||||
if frappe.flags.in_test:
|
if frappe.flags.in_test:
|
||||||
|
|||||||
Reference in New Issue
Block a user