fix: Allow allocating advance amount against Expense Claim taxes
This commit is contained in:
@@ -305,12 +305,11 @@ class ExpenseClaim(AccountsController):
|
|||||||
|
|
||||||
if self.total_advance_amount:
|
if self.total_advance_amount:
|
||||||
precision = self.precision("total_advance_amount")
|
precision = self.precision("total_advance_amount")
|
||||||
if flt(self.total_advance_amount, precision) > flt(self.total_claimed_amount, precision):
|
amount_with_taxes = flt(self.total_sanctioned_amount, precision) + flt(
|
||||||
frappe.throw(_("Total advance amount cannot be greater than total claimed amount"))
|
self.total_taxes_and_charges, precision
|
||||||
|
)
|
||||||
|
|
||||||
if self.total_sanctioned_amount and flt(self.total_advance_amount, precision) > flt(
|
if flt(self.total_advance_amount, precision) > amount_with_taxes:
|
||||||
self.total_sanctioned_amount, precision
|
|
||||||
):
|
|
||||||
frappe.throw(_("Total advance amount cannot be greater than total sanctioned amount"))
|
frappe.throw(_("Total advance amount cannot be greater than total sanctioned amount"))
|
||||||
|
|
||||||
def validate_sanctioned_amount(self):
|
def validate_sanctioned_amount(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user