hrms
hrms copied to clipboard
feat: leave policy correction
Leave Policy Correction allows users to assign a different leave policy for an employee who already has one assigned. Currently, if an employee has a policy assigned for a period and has taken leave based on the allocations created out of it, there is no way to cancel or change the leave policy for that user.
Leave Policy Correction does the following:
- Ends the selected leave policy assignment and associated leave allocations on the given effective from date minus 1.
- Reverts all leave ledger entries created by auto allocation from the given date (associated to the selected assignment)
- Creates a new leave policy assignment from the given date with the given new policy
Codecov Report
Merging #579 (9bc1183) into develop (ec56aaf) will decrease coverage by
0.25%
. The diff coverage is2.85%
.
Additional details and impacted files
@@ Coverage Diff @@
## develop #579 +/- ##
===========================================
- Coverage 73.06% 72.81% -0.25%
===========================================
Files 190 191 +1
Lines 9867 9902 +35
===========================================
+ Hits 7209 7210 +1
- Misses 2658 2692 +34
Impacted Files | Coverage Δ | |
---|---|---|
...leave_policy_correction/leave_policy_correction.py | 0.00% <0.00%> (ø) |
|
...leave_policy_assignment/leave_policy_assignment.py | 87.71% <50.00%> (-0.45%) |
:arrow_down: |
Planning to add something more generic for Leave Balance Adjustment in allocations/policy assignments: https://github.com/orgs/frappe/projects/54?query=is%3Aopen+sort%3Aupdated-desc&pane=issue&itemId=29601609
This also needs to handle many edge cases: earned leaves, carry-forwarded leaves, and leaves already taken/expired when this correction happens.
Hence closing this.