From 33ce5ce0482e6dd5a88ea95d93f33775358bbde6 Mon Sep 17 00:00:00 2001 From: Sun Howwrongbum Date: Fri, 23 Aug 2019 12:25:18 +0530 Subject: [PATCH] fix: pos return validation (#18810) --- erpnext/accounts/doctype/sales_invoice/sales_invoice.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index bfe82a0c3e5..5cf76728e62 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -206,9 +206,9 @@ class SalesInvoice(SellingController): total_amount_in_payments = 0 for payment in self.payments: total_amount_in_payments += payment.amount - - if total_amount_in_payments < self.rounded_total: - frappe.throw(_("Total payments amount can't be greater than {}".format(-self.rounded_total))) + invoice_total = self.rounded_total or self.grand_total + if total_amount_in_payments < invoice_total: + frappe.throw(_("Total payments amount can't be greater than {}".format(-invoice_total))) def validate_pos_paid_amount(self): if len(self.payments) == 0 and self.is_pos: