fix: consider rounded_total in returns (#23631)

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
This commit is contained in:
Sun Howwrongbum
2020-10-19 11:30:48 +05:30
committed by GitHub
parent 3ae9bbc0a7
commit 334c282f7b

View File

@@ -570,7 +570,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"))