fix: consider rounded_total in returns (#23609)

Co-authored-by: Marica <maricadsouza221197@gmail.com>
This commit is contained in:
Sun Howwrongbum 2020-10-13 21:23:26 +05:30 committed by GitHub
parent 06268e5f57
commit 93da52941e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -572,7 +572,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) > \
invoice_total = self.rounded_total or self.grand_total
if flt(self.paid_amount) + flt(self.write_off_amount) - flt(invoice_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"))