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

feat: allow mid-period leave policy change #1910

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

JK-1117
Copy link
Contributor

@JK-1117 JK-1117 commented Jun 21, 2024

Feature Overview:
Added the ability to allow mid-period policy changes to enable changing an employee's leave policy assignment in the middle of a period. For detailed use cases, refer to issue Closes #640 .

Implementation Details:

  • Added a checkbox labeled "Allow mid-period policy change" in the Leave Policy Assignment.
  • When this checkbox is ticked, the following actions occur before submit:
    • Validates if there are any leave applications that span across the old and new Leave Allocations.
    • Updates the end date of the old Leave Policy Assignment, Leave Allocation, and Leave Ledger Entry.

User Impact:

  • A new checkbox "Allow mid-period policy change" is added in the Leave Policy Assignment form.image

  • If the new checkbox is ticked, upon submitting the Leave Policy Assignment, a confirmation dialog will appear to warn the user that this action is irreversible.
    image

Testing:
Unit tests have been written to ensure:

  • An error is prompted if there are leave applications that span across both Leave Allocations.
  • After changing the Leave Policy, the new leave balance is accurately reflected.

@JK-1117 JK-1117 marked this pull request as ready for review June 21, 2024 04:47
@JK-1117
Copy link
Contributor Author

JK-1117 commented Jun 28, 2024

Hi @ruchamahabal , I would like to contribute to the Frappe HR documentation. When I tried to edit it, I was prompted to log in, but I couldn't find a registration page. Could you guide me on how to create an account? Also if you have any suggestions or concerns regarding the changes I proposed, please let me know.

Copy link
Member

@ruchamahabal ruchamahabal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,
Thanks for the contribution. This makes sense for earned leaves because leaves are allocated on a prorata basis.

But if we think about a scenario where leaves are allocated all at once:
The employee will have all the leaves available from the previous balance (until the end date, so backdated leaves are possible) + new leaves allocated as per new policy. Not sure if this is intended behavior in general use cases?

@JK-1117
Copy link
Contributor Author

JK-1117 commented Aug 28, 2024

Hello,

Thank you for the feedback. I will check with my client and discuss this with my team to explore possible solutions. Once we have some ideas, we can discuss them together to ensure the best approach.

I appreciate your input and look forward to collaborating on this.

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

Successfully merging this pull request may close these issues.

Change in Leave policy assignment in mid period
2 participants