Skip to content

Commit

Permalink
feat: fetch leave encashment amount from ssa
Browse files Browse the repository at this point in the history
  • Loading branch information
iamejaaz authored Oct 6, 2024
1 parent 1966adb commit 2e36ba5
Show file tree
Hide file tree
Showing 2 changed files with 280 additions and 265 deletions.
9 changes: 8 additions & 1 deletion hrms/hr/doctype/leave_encashment/leave_encashment.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,14 @@ def set_encashment_amount(self):
self.set_salary_structure()

per_day_encashment = frappe.db.get_value(
"Salary Structure", self._salary_structure, "leave_encashment_amount_per_day"
"Salary Structure Assignment",
{
"employee": self.employee,
"docstatus": 1,
"from_date": ("<=", self.encashment_date)
},
"leave_encashment_amount_per_day",
order_by="from_date desc"
)
self.encashment_amount = self.encashment_days * per_day_encashment if per_day_encashment > 0 else 0

Expand Down
Loading

0 comments on commit 2e36ba5

Please sign in to comment.