Skip to content

Commit

Permalink
fix(Employee Advance): check if return amount is set before validating (
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchamahabal committed Jul 11, 2023
1 parent 9c3ec41 commit beaf13e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions erpnext/hr/doctype/employee_advance/employee_advance.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ def set_total_advance_paid(self):
EmployeeAdvanceOverPayment,
)

if flt(return_amount) > self.paid_amount - self.claimed_amount:
frappe.throw(_("Return amount cannot be greater unclaimed amount"))
if flt(return_amount) > 0 and flt(return_amount) > (self.paid_amount - self.claimed_amount):
frappe.throw(_("Return amount cannot be greater than unclaimed amount"))

self.db_set("paid_amount", paid_amount)
self.db_set("return_amount", return_amount)
Expand Down

0 comments on commit beaf13e

Please sign in to comment.