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: filter out old allocation's carry-forwarded leaves while fetching leave details #411

Merged
merged 2 commits into from
Mar 22, 2023

Conversation

ruchamahabal
Copy link
Member

@ruchamahabal ruchamahabal commented Mar 22, 2023

Problem:

While fetching allocation details for leave dashboard, all the previous carry forwarded records are being considered.
Only the record marked in green should be considered

entries

Causing weird balance calculations 😵‍💫

image

Actual balance is 0

fix

Fix

In the cf leaves query, add a condition to make sure only current allocation's leaves are being considered

image

The Ledger Period can vary in case of carry forwarded leaves
Ex: Allocation Period can be - 1st Jan 2023 to 31st Dec 2023
But carry forwarded leaves can have an early expiry (if they have to be used in the first 2-3 months)

So just comparing balance dates with Ledger dates won't help here

Edge case missed while fixing another edge case in #335

  • Tests

@ruchamahabal ruchamahabal marked this pull request as draft March 22, 2023 07:00
@ruchamahabal ruchamahabal changed the title fix: get leave records based on allocation period instead of ledger period fix: filter out old allocation's cf leaves while fetching leave details Mar 22, 2023
@ruchamahabal ruchamahabal changed the title fix: filter out old allocation's cf leaves while fetching leave details fix: filter out old allocation's carry-forwarded leaves while fetching leave details Mar 22, 2023
@ruchamahabal ruchamahabal marked this pull request as ready for review March 22, 2023 13:08
@ruchamahabal ruchamahabal merged commit b5797bf into frappe:develop Mar 22, 2023
ruchamahabal added a commit that referenced this pull request Mar 22, 2023
fix: filter out old allocation's carry-forwarded leaves while fetching leave details (backport #411)
@ruchamahabal ruchamahabal added the backport version-13-hotfix Needs manual backporting to frappe/erpnext label Apr 3, 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.

1 participant