From adc0923c7e3eb5b92e6c064cfccfc84ef20734bb Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 9 Feb 2016 10:31:11 +0530 Subject: [PATCH] [fix] validate advance only if invoice total is positive --- erpnext/controllers/taxes_and_totals.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py index d4d4de0edf..d4a64f2e7f 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -404,7 +404,7 @@ class calculate_taxes_and_totals(object): invoice_total = flt(self.doc.grand_total * self.doc.conversion_rate, 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}") .format(self.doc.party_account_currency, invoice_total))