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 #2130

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

ruchamahabal
Copy link
Member

@ruchamahabal ruchamahabal 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

…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
@ruchamahabal ruchamahabal changed the title fix: incorrect tax period calculation when payroll period starts after the first day of the month fix(Payroll): incorrect tax period calculation when payroll period starts after the first day of the month Aug 28, 2024
@ruchamahabal ruchamahabal merged commit 58c4800 into frappe:develop Aug 28, 2024
7 checks passed
ruchamahabal added a commit that referenced this pull request Aug 28, 2024
…2130

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

CTC calculation error ? Income Tax Wrong calculation (wrong month count)
1 participant