fix: setting paid amount to 0 when is_paid is unchecked in purchase invoice

This commit is contained in:
ljain112
2025-05-22 13:49:26 +05:30
committed by ruthra kumar
parent b2696bf659
commit e358a9e53f
2 changed files with 5 additions and 0 deletions

View File

@@ -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();

View File

@@ -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: