[fix] validate advance only if invoice total is positive
This commit is contained in:
parent
b38fac8bf1
commit
adc0923c7e
@ -404,7 +404,7 @@ class calculate_taxes_and_totals(object):
|
|||||||
invoice_total = flt(self.doc.grand_total * self.doc.conversion_rate,
|
invoice_total = flt(self.doc.grand_total * self.doc.conversion_rate,
|
||||||
self.doc.precision("grand_total"))
|
self.doc.precision("grand_total"))
|
||||||
|
|
||||||
if self.doc.total_advance > invoice_total:
|
if invoice_total > 0 and self.doc.total_advance > invoice_total:
|
||||||
frappe.throw(_("Advance amount cannot be greater than {0} {1}")
|
frappe.throw(_("Advance amount cannot be greater than {0} {1}")
|
||||||
.format(self.doc.party_account_currency, invoice_total))
|
.format(self.doc.party_account_currency, invoice_total))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user