Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: consider cases for partially consumed carry-forwarded and new leaves with carry-forwarded expiry #370

Merged
merged 6 commits into from
Mar 9, 2023

Conversation

ruchamahabal
Copy link
Member

@ruchamahabal ruchamahabal commented Mar 6, 2023

Extending the edge cases from #335

Setup:
16 new leaves allocated + 5 carry forwarded leaves that will expire on 28-02-2023
Total 21 leaves allocated

Case 3: Leave Application across carry forwarded leave expiry

cf-leaves

Before:

cf-leave-expiry-before

After:

cf-leave-fixed

Case 4: Leave Application after carry forwarded leave expiry

Leave Application created after carry forwarded leave expiry date (28-02-2023)

image

Before:

cf-case-4-before

After:

cf-case-4-after

  • Consider case of more leaves consumed than allocated cf leaves within the cf leave period

@codecov-commenter
Copy link

codecov-commenter commented Mar 6, 2023

Codecov Report

Merging #370 (cff3d5a) into develop (72c4ffb) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #370      +/-   ##
===========================================
- Coverage    71.69%   71.67%   -0.02%     
===========================================
  Files          181      181              
  Lines         9334     9342       +8     
===========================================
+ Hits          6692     6696       +4     
- Misses        2642     2646       +4     
Impacted Files Coverage Δ
.../hr/doctype/leave_application/leave_application.py 79.69% <100.00%> (+0.31%) ⬆️
hrms/hr/doctype/shift_type/shift_type.py 87.50% <0.00%> (-2.28%) ⬇️
...ms/hr/doctype/shift_assignment/shift_assignment.py 90.77% <0.00%> (-0.49%) ⬇️
hrms/payroll/doctype/salary_slip/salary_slip.py 87.88% <0.00%> (-0.11%) ⬇️

- the above two cases weren't considering the split between cf leaves taken and new leaves taken and substracting all consumed leaves from cf leaves
@ruchamahabal ruchamahabal force-pushed the fix-balance-edge-cases branch from ab9aef9 to 84ee1dd Compare March 9, 2023 07:41
@ruchamahabal ruchamahabal marked this pull request as ready for review March 9, 2023 08:17
@ruchamahabal ruchamahabal changed the title fix: consider leaves taken while calculating expired carry-forwarded leaves fix: consider cases for partially consumed carry-forwarded and new leaves with carry-forwarded expiry Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport version-13-hotfix Needs manual backporting to frappe/erpnext backport version-14-hotfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants