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: comp leave request fails on leave period boundary dates #1255

Merged
merged 2 commits into from
Jan 4, 2024

Conversation

ruchamahabal
Copy link
Member

@ruchamahabal ruchamahabal commented Jan 3, 2024

Steps to replicate:

  1. Leave Period - 1/1/2023 - 31/12/2023
  2. Present Attendance on 31/12/2023
  3. Try creating a compensatory leave request for 31/12/2023. Errors out with this message:
image

Fix:

This is because compensatory leave request is applicable 1 day after work end date. In this case its 1/1/2024. So it should find the relevant allocation from that date but instead it finds allocation for work from & to dates (previous leave period) and tries to create a leave ledger entry from 01-01-2024 (applicable date)- 31-12-2023 (fetched allocation end date) (different leave periods).

Since comp off is applicable from the next date, find relevant leave period & allocation from that day onwards. Also improve error message when relevant leave period is missing instead of "There is no leave period in between {0} and {1}". User won't understand what the system is trying to do behind the scenes.

image

- system tries to find the leave period/allocation for updating balance based on the work from & to dates in comp leave but actual comp leave is applicable 1 day after the work end date

- find the period & allocation 1 day after work end date to update balance + fix relevant error messages
@codecov-commenter
Copy link

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (dfb9712) 72.48% compared to head (7d62a64) 72.40%.
Report is 64 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1255      +/-   ##
===========================================
- Coverage    72.48%   72.40%   -0.09%     
===========================================
  Files          201      201              
  Lines        10946    10946              
===========================================
- Hits          7934     7925       -9     
- Misses        3012     3021       +9     
Files Coverage Δ
hrms/hooks.py 100.00% <ø> (ø)
...satory_leave_request/compensatory_leave_request.py 88.75% <100.00%> (+2.08%) ⬆️
...ms/hr/doctype/interview_detail/interview_detail.py 100.00% <ø> (ø)
...r/doctype/interview_feedback/interview_feedback.py 93.18% <100.00%> (-0.94%) ⬇️
hrms/setup.py 21.37% <ø> (ø)
hrms/hr/doctype/interview_round/interview_round.py 38.88% <0.00%> (ø)
hrms/hr/doctype/job_applicant/job_applicant.py 64.28% <0.00%> (ø)
...roll/doctype/salary_slip/salary_slip_loan_utils.py 27.86% <0.00%> (ø)
hrms/hr/doctype/interview/interview.py 64.41% <88.00%> (+0.44%) ⬆️

... and 3 files with indirect coverage changes

@ruchamahabal ruchamahabal merged commit 513a39a into frappe:develop Jan 4, 2024
8 checks passed
ruchamahabal added a commit that referenced this pull request Jan 4, 2024
…1255

fix: comp leave request fails on leave period boundary dates (backport #1255)
ruchamahabal added a commit that referenced this pull request Jan 5, 2024
…1255

fix: comp leave request fails on leave period boundary dates (backport #1255)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants