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

feat: display tax break up on salary slip #267

Merged

Conversation

saurabh6790
Copy link
Member

@saurabh6790 saurabh6790 commented Jan 17, 2023

Provision to display income tax deduction on salary slip.

  • Salary Structure Assignment

    • Selected Tax regime as New Tax Regime where there are no standard deductions
    • Not considering Tax Exemption Declaration as New Tax Regime is selected

Screenshot 2023-02-13 at 2 07 27 PM

  • Income tax breakup on Salary Slip

Screenshot 2023-02-13 at 2 11 04 PM

Income Tax Deducted Till Date + Future Income Tax Deductions
9,583.33+1,05,416.67 = 1,15,000

  • Total payable tax as per Income tax computation

Screenshot 2023-02-13 at 2 11 51 PM

Calculations / Formula

  • Calculate CTC
ctc = ( 
	previous_taxable_earnings 
	+ current_structured_taxable_earnings 
	+ future_structured_taxable_earnings 
	+ current_additional_earnings 
	+ other_incomes 
	+ unclaimed_taxable_benefits 
	+ non_taxable_earnings
)
  • Calculate non-taxable earnings
non_taxable_earnings = (
	prev_period_non_taxable_earnings
	+ current_period_non_taxable_earnings
	+ future_period_non_taxable_earnings
	+ non_taxable_additional_salary
)
  • Calculate Income from other sources
income_from_other_sources = fetch details from `Employee Other Income` based on payroll period
  • Total Earnings
total_earnings = ctc + income_from_other_sources
  • Annual deductions before tax calculations
annual_deductions_before_tax_calculation =  (
	prev_period_exempted_amount 
	+ current_period_exempted_amount 
	+ future_period_exempted_amount
)
  • Standard deductions
standard_tax_exemption_amount = based on the selected tax slab
  • Tax exemption declaration
tax_exemption_declaration =  total_declared_exemption_amount + standard_tax_exemption_amount
  • Annual taxable amount
annual_taxable_amount = total_earnings - (
	non_taxable_earnings
	+ deductions_before_tax_calculation
	+ tax_exemption_declaration
	+ standard_tax_exemption_amount
)
  • Income tax deducted up-to the current month
tax_deducted_till_date = previous_total_paid_taxes + current_structured_tax_amount
  • Future taxable amount
future_income_tax_deductions = total_structured_tax_amount - income_tax_deducted_till_date

Re-write queries

Re-write queries in frappe ORM format for Salary Slip DocType

@saurabh6790 saurabh6790 force-pushed the display-tax-calculation-on-salary-slip branch 4 times, most recently from 12a51d7 to bd421ba Compare January 27, 2023 10:56
@codecov-commenter
Copy link

codecov-commenter commented Jan 27, 2023

Codecov Report

Merging #267 (86428d1) into develop (bcc4c17) will increase coverage by 0.32%.
The diff coverage is 93.17%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #267      +/-   ##
===========================================
+ Coverage    71.00%   71.33%   +0.32%     
===========================================
  Files          181      181              
  Lines         9195     9321     +126     
===========================================
+ Hits          6529     6649     +120     
- Misses        2666     2672       +6     
Impacted Files Coverage Δ
hrms/payroll/doctype/salary_slip/salary_slip.py 87.69% <93.10%> (+0.44%) ⬆️
...s/payroll/doctype/payroll_period/payroll_period.py 90.38% <100.00%> (+4.11%) ⬆️
...t/employee_leave_balance/employee_leave_balance.py 94.82% <0.00%> (+0.23%) ⬆️
...ype/employee_other_income/employee_other_income.py 100.00% <0.00%> (+100.00%) ⬆️

@saurabh6790 saurabh6790 marked this pull request as ready for review February 13, 2023 07:03
@saurabh6790 saurabh6790 force-pushed the display-tax-calculation-on-salary-slip branch 5 times, most recently from 4d3bb88 to c1dcc3b Compare February 15, 2023 06:05
@nabinhait
Copy link
Member

@saurabh6790 Income Tax Breakup fields can be organised like below:
Screenshot 2023-02-16 at 2 27 39 PM

hrms/payroll/doctype/payroll_period/payroll_period.py Outdated Show resolved Hide resolved
hrms/payroll/doctype/salary_slip/salary_slip.py Outdated Show resolved Hide resolved
hrms/payroll/doctype/salary_slip/salary_slip.py Outdated Show resolved Hide resolved
hrms/payroll/doctype/salary_slip/salary_slip.py Outdated Show resolved Hide resolved
hrms/payroll/doctype/salary_slip/salary_slip.py Outdated Show resolved Hide resolved
hrms/payroll/doctype/salary_slip/salary_slip.py Outdated Show resolved Hide resolved
hrms/payroll/doctype/salary_slip/salary_slip.py Outdated Show resolved Hide resolved
@saurabh6790 saurabh6790 force-pushed the display-tax-calculation-on-salary-slip branch from 65707e6 to 861fc85 Compare February 16, 2023 11:34
@saurabh6790
Copy link
Member Author

@ruchamahabal fixed!

@saurabh6790
Copy link
Member Author

@nabinhait Reorganised as per the suggestion

Screenshot 2023-02-16 at 4 05 30 PM

@ruchamahabal
Copy link
Member

@saurabh6790 can you address the unresolved conversations about splitting functions?

@saurabh6790 saurabh6790 force-pushed the display-tax-calculation-on-salary-slip branch 2 times, most recently from e102dd0 to de219e8 Compare February 17, 2023 06:35
@saurabh6790
Copy link
Member Author

@ruchamahabal Added test case. PR is ready to merge

@saurabh6790 saurabh6790 force-pushed the display-tax-calculation-on-salary-slip branch from 40aa049 to b1ca898 Compare February 17, 2023 10:13
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.

4 participants