From 7cabcdd9a2dc911e862f7a3ba5940fcbe692cfd0 Mon Sep 17 00:00:00 2001 From: Sun Howwrongbum Date: Fri, 13 Sep 2019 11:08:02 +0530 Subject: [PATCH] fix: precision rounding issue during pos return validation (#19034) --- erpnext/accounts/doctype/sales_invoice/sales_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 5cf76728e62..a56411ad1fc 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -207,7 +207,7 @@ class SalesInvoice(SellingController): for payment in self.payments: total_amount_in_payments += payment.amount invoice_total = self.rounded_total or self.grand_total - if total_amount_in_payments < invoice_total: + if flt(total_amount_in_payments, self.precision("grand_total")) < invoice_total: frappe.throw(_("Total payments amount can't be greater than {}".format(-invoice_total))) def validate_pos_paid_amount(self):