From c2090939d74b5b3b52df70a8190550448315e25b Mon Sep 17 00:00:00 2001 From: Jay Parikh Date: Sat, 2 Mar 2019 12:19:32 +0000 Subject: [PATCH] Fix Sales Invoice Return Validation "validate_pos" --- erpnext/accounts/doctype/sales_invoice/sales_invoice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 4cf3a1acf5..10a9dc6da5 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -523,8 +523,8 @@ class SalesInvoice(SellingController): def validate_pos(self): if self.is_return: - if flt(self.paid_amount) + flt(self.write_off_amount) - flt(self.grand_total) < \ - 1/(10**(self.precision("grand_total") + 1)): + if flt(self.paid_amount) + flt(self.write_off_amount) - flt(self.grand_total) > \ + 1.0/(10.0**(self.precision("grand_total") + 1.0)): frappe.throw(_("Paid amount + Write Off Amount can not be greater than Grand Total")) def validate_item_code(self):