hrms icon indicating copy to clipboard operation
hrms copied to clipboard

feat: leave policy correction

Open rtdany10 opened this issue 1 year ago • 1 comments

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.

image

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

rtdany10 avatar Jun 07 '23 13:06 rtdany10

Codecov Report

Merging #579 (9bc1183) into develop (ec56aaf) will decrease coverage by 0.25%. The diff coverage is 2.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:

codecov-commenter avatar Jun 07 '23 13:06 codecov-commenter

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.

ruchamahabal avatar Jun 07 '24 10:06 ruchamahabal