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: add leaves to the correct allocation for compensatory leave request (backport #2615) #2621

Merged
merged 5 commits into from
Jan 10, 2025

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jan 10, 2025

Problem

Leave Period: 1st Jan 2024 - 31st Dec 2024
Allocation 1: 1st Nov 2024 - 30 Nov 2024
Allocation 2: 1st Dec 2024 - 31st Dec 2024
Compensatory Leave Request: 1st Dec 2024

On submission of this compensatory leave request, 1 leave should be added applicable from 2nd Dec 2024 - 31st Dec 2024

We are greeted with this validation error from the leave ledger
To Date needs to be before From Date 🤡

image

This compensatory leave request is trying to update an existing allocation, but it fetches the first allocation from the entire period instead of the exact leave allocation date is falling into

So it's trying to create a ledger entry from 2nd Dec 2024 (comp leave applicable from) to 31st Mar 2024 (Allocation 1's from date)

Fix

Instead of finding first allocation in the leave period, find the exact allocation in which the compensatory leave falls

Also added more info to the validation and rectified the message

image
This is an automatic backport of pull request #2615 done by [Mergify](https://mergify.com).

…ations in leave periods

(cherry picked from commit f20c15b)

# Conflicts:
#	hrms/hr/doctype/compensatory_leave_request/test_compensatory_leave_request.py
@mergify mergify bot requested a review from ruchamahabal as a code owner January 10, 2025 12:12
@mergify mergify bot added the conflicts label Jan 10, 2025
Copy link
Contributor Author

mergify bot commented Jan 10, 2025

Cherry-pick of f20c15b has failed:

On branch mergify/bp/version-14-hotfix/pr-2615
Your branch is ahead of 'origin/version-14-hotfix' by 1 commit.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit f20c15bb.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   hrms/hr/doctype/compensatory_leave_request/test_compensatory_leave_request.py

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@ruchamahabal ruchamahabal merged commit 9d05b80 into version-14-hotfix Jan 10, 2025
7 checks passed
@frappe-pr-bot
Copy link
Collaborator

🎉 This PR is included in version 14.36.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants