Skip to content

fix: disable leave application against expired allocations#2463

Closed
AyshaHakeem wants to merge 3 commits intofrappe:developfrom
AyshaHakeem:fix-leave-allocation
Closed

fix: disable leave application against expired allocations#2463
AyshaHakeem wants to merge 3 commits intofrappe:developfrom
AyshaHakeem:fix-leave-allocation

Conversation

@AyshaHakeem
Copy link
Collaborator

@AyshaHakeem AyshaHakeem commented Nov 28, 2024

Fixes an issue where employees could apply for leaves marked as expired. Updated the condition to exclude expired leave allocations when fetching available leaves.

Before:
before

After:
after-2

& (Ledger.transaction_type == "Leave Allocation")
& (Ledger.employee == employee)
& (Ledger.is_expired == 0)
& (LeaveAllocation.expired == 0)
Copy link
Member

Choose a reason for hiding this comment

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

Ledger getting expired and allocation getting expired is the same right? How does the earlier one not work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Expired leaves were still shown despite the ledger filter applied

@ruchamahabal ruchamahabal self-assigned this Dec 10, 2024
@AyshaHakeem
Copy link
Collaborator Author

AyshaHakeem commented Jan 14, 2025

When a Leave Allocation is marked as expired, a Leave Ledger Entry is created with a negative value for unused leaves and 'is_expired' checked, while previously submitted entries remain unchanged.

The filter excluding expired entries when fetching allocated leaves has now been removed for accurate leave balance calculation.

@asmitahase
Copy link
Member

Fixed by #3335, closing

@asmitahase asmitahase closed this Aug 29, 2025
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.

3 participants