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(Payroll): incorrect tax period calculation when payroll period starts after the first day of the month (backport #2130) #2132

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Aug 28, 2024

Closes #1992 Closes #837

If payroll period is from
16th July 2024 - 15th July 2025

Tax period gets calculated as 13 months because of the month_diff function in the framework leading to incorrect CTC calculation and thereby incorrect tax breakup

Before:

before

After:

after

There was attempt to fix this in the framework frappe/frappe#10938 but the inclusion of both the months is on purpose and this function doesn't exactly consider the dates. Wrote a custom helper function to handle this case for payroll


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

…r first day of a month

- framework's month_diff counts both start & end dates months as inclusive

- count the last month only if end date's day > start date's day to handle cases like 16th Jul 2024 - 15th Jul 2025, where framework's month_diff will calculate diff as 13 months

(cherry picked from commit b545687)
@ruchamahabal
Copy link
Member

Unrelated test case failure

@ruchamahabal ruchamahabal merged commit ea19cac into version-15-hotfix Aug 28, 2024
7 of 8 checks passed
@mergify mergify bot deleted the mergify/bp/version-15-hotfix/pr-2130 branch August 28, 2024 17:35
@frappe-pr-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 15.27.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