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 CTC Calculation): compute future non taxable earnings with full payment days #2302

Merged
merged 2 commits into from
Oct 18, 2024

Conversation

ruchamahabal
Copy link
Member

@ruchamahabal ruchamahabal commented Oct 18, 2024

Before

Create a salary slip for a month with payment days < total working days

Employee joined on May 6th. Taxable Earnings from previous employer have been set in SSA (Note: this step is not mandatory to replicate the issue. Just a partial payment days salary slip should work):

image

May month salary:

month

Payment Days (26) < Total Working Days (31)

image

Income Tax Breakup

ctc-before

CTC calculation = gross pay

So here the calculation should have been:

Previous employer taxable earnings = 136577
May month salary (gross pay) = 1,44,747.04 (as per 26 payment days)
Upcoming 10-month salary = 172583 (full payment days salary) ×10 (remaining 10 months) = 1725830
Actual CTC = 2007154.04
System's calculated CTC = 2005863.74
Difference = 1290.3

Problem

This was how system was calculating future month's non taxable earnings:

future_period_non_taxable_earnings = current_period_non_taxable_earnings * (
	ceil(self.remaining_sub_periods) - 1
)

Here this reduces future earnings if current month has less payment days. Fixed it to consider full payment days for future tax calculations

After

ctc-after

  • Check similar cases where future calculations use current calculations as anchor - (all other places already factor out payment days variable)
  • Add tests

@ruchamahabal ruchamahabal marked this pull request as draft October 18, 2024 08:37
@ruchamahabal ruchamahabal marked this pull request as ready for review October 18, 2024 11:33
@ruchamahabal ruchamahabal merged commit 9953a48 into frappe:develop Oct 18, 2024
11 checks passed
ruchamahabal added a commit that referenced this pull request Oct 18, 2024
…2302

fix(Payroll CTC Calculation): compute future non taxable earnings with full payment days (backport #2302)
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.

1 participant