fix: Default party account getting overriden in invoices

(cherry picked from commit 88648570d7)
This commit is contained in:
Deepesh Garg
2021-11-12 12:39:30 +05:30
committed by mergify-bot
parent da64d0b0f9
commit a9452f1277
4 changed files with 30 additions and 9 deletions

View File

@@ -1409,8 +1409,8 @@ class AccountsController(TransactionBase):
grand_total -= self.get("total_advance")
base_grand_total = flt(grand_total * self.get("conversion_rate"), self.precision("base_grand_total"))
if flt(total, self.precision("grand_total")) != flt(grand_total, self.precision("grand_total")) or \
flt(base_total, self.precision("base_grand_total")) != flt(base_grand_total, self.precision("base_grand_total")):
if flt(total, self.precision("grand_total")) - flt(grand_total, self.precision("grand_total")) > 0.1 or \
flt(base_total, self.precision("base_grand_total")) - flt(base_grand_total, self.precision("base_grand_total")) > 0.1:
frappe.throw(_("Total Payment Amount in Payment Schedule must be equal to Grand / Rounded Total"))
def is_rounded_total_disabled(self):