From b6b2c48340d4f3248973a97c37b4bc215a49cc48 Mon Sep 17 00:00:00 2001 From: Anurag Mishra <32095923+Anurag810@users.noreply.github.com> Date: Tue, 13 Aug 2019 12:53:17 +0530 Subject: [PATCH] fix: condition (#18708) --- 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 0ae275f846a..bfe82a0c3e5 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -205,9 +205,9 @@ class SalesInvoice(SellingController): if self.is_pos and self.is_return: total_amount_in_payments = 0 for payment in self.payments: - total_amount_in_payments = payment.amount + total_amount_in_payments += payment.amount - if -total_amount_in_payments > -self.rounded_total: + if total_amount_in_payments < self.rounded_total: frappe.throw(_("Total payments amount can't be greater than {}".format(-self.rounded_total))) def validate_pos_paid_amount(self):