fix: Allow allocating advance amount against Expense Claim taxes

This commit is contained in:
Rucha Mahabal
2022-07-28 13:21:29 +05:30
parent 0602848caa
commit 42f3592e95

View File

@@ -305,12 +305,11 @@ class ExpenseClaim(AccountsController):
if self.total_advance_amount:
precision = self.precision("total_advance_amount")
if flt(self.total_advance_amount, precision) > flt(self.total_claimed_amount, precision):
frappe.throw(_("Total advance amount cannot be greater than total claimed amount"))
amount_with_taxes = flt(self.total_sanctioned_amount, precision) + flt(
self.total_taxes_and_charges, precision
)
if self.total_sanctioned_amount and flt(self.total_advance_amount, precision) > flt(
self.total_sanctioned_amount, precision
):
if flt(self.total_advance_amount, precision) > amount_with_taxes:
frappe.throw(_("Total advance amount cannot be greater than total sanctioned amount"))
def validate_sanctioned_amount(self):