Skip to content

Commit

Permalink
fix: add check for expense claim in pre-process validation (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
agritheory authored Jun 11, 2023
1 parent 2e87a26 commit 1503fa9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions check_run/check_run/doctype/check_run/check_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@ def not_outstanding_or_cancelled(self, transaction):
)
if outstanding_based_on_gle and not outstanding_based_on_gle[0].outstanding_amount:
return True
elif transaction["doctype"] == "Expense Claim":
ec = frappe.get_value(
transaction["doctype"],
filters,
["grand_total", "total_amount_reimbursed"],
as_dict=True,
)
if ec.grand_total <= ec.total_amount_reimbursed:
return True
else:
if frappe.get_value(transaction["doctype"], filters, "outstanding_amount") == 0.0:
return True
Expand Down

0 comments on commit 1503fa9

Please sign in to comment.