Skip to content

Commit

Permalink
feat: show tax breakup on salary slip
Browse files Browse the repository at this point in the history
  • Loading branch information
saurabh6790 committed Feb 17, 2023
1 parent bcc4c17 commit b752684
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 2 deletions.
75 changes: 75 additions & 0 deletions hrms/payroll/doctype/salary_slip/salary_slip.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@
"total_in_words",
"column_break_69",
"base_total_in_words",
"income_tax_calculation_breakup_section",
"ctc",
"income_from_other_sources",
"total_earnings",
"non_taxable_earnings",
"column_break_0rsw",
"deductions_before_tax_calculation",
"tax_exemption_declaration",
"standard_tax_exemption_amount",
"annual_taxable_amount",
"income_tax_deducted_till_date",
"section_break_75",
"journal_entry",
"amended_from",
Expand Down Expand Up @@ -645,7 +656,71 @@
},
{
"fieldname": "column_break_ghjr",
"fieldtype": "Column Break",
},
{
"collapsible": 1,
"fieldname": "income_tax_calculation_breakup_section",
"fieldtype": "Section Break",
"label": "Income Tax Breakup"
},
{
"fieldname": "ctc",
"fieldtype": "Currency",
"label": "CTC",
"read_only": 1
},
{
"fieldname": "income_from_other_sources",
"fieldtype": "Currency",
"label": "Income from Other Sources",
"read_only": 1
},
{
"fieldname": "total_earnings",
"fieldtype": "Currency",
"label": "Total Earnings",
"read_only": 1
},
{
"fieldname": "non_taxable_earnings",
"fieldtype": "Currency",
"label": "Non Taxable Earnings",
"read_only": 1
},
{
"fieldname": "column_break_0rsw",
"fieldtype": "Column Break"
},
{
"fieldname": "deductions_before_tax_calculation",
"fieldtype": "Currency",
"label": "Deductions before tax calculation",
"read_only": 1
},
{
"fieldname": "tax_exemption_declaration",
"fieldtype": "Currency",
"label": "Tax Exemption Declaration",
"read_only": 1
},
{
"fieldname": "standard_tax_exemption_amount",
"fieldtype": "Currency",
"label": "Standard Tax Exemption Amount",
"read_only": 1
},
{
"fieldname": "annual_taxable_amount",
"fieldtype": "Currency",
"label": "Annual Taxable Amount",
"read_only": 1
},
{
"fieldname": "income_tax_deducted_till_date",
"fieldtype": "Currency",
"label": "Income Tax Deducted Till Date",
"read_only": 1
}
],
"icon": "fa fa-file-text",
Expand Down
16 changes: 14 additions & 2 deletions hrms/payroll/doctype/salary_slip/salary_slip.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt

import math
from datetime import date, timedelta

import math
from datetime import datetime, timedelta
import frappe
from frappe import _, msgprint
from frappe.model.naming import make_autoname
Expand Down Expand Up @@ -609,6 +609,18 @@ def set_net_pay(self):
flt(self.hour_rate) * flt(self.exchange_rate), self.precision("base_hour_rate")
)
self.set_net_total_in_words()
self.set_income_tax_breakup()

def set_income_tax_breakup(self):
self.ctc = self.base_gross_pay * 12
self.income_from_other_sources = self.income_from_other_sources
self.total_earnings = self.ctc + self.income_from_other_sources
self.non_taxable_earnings = 0
self.deductions_before_tax_calculation = 0
self.tax_exemption_declaration = 0
self.standard_tax_exemption_amount = 0
self.annual_taxable_amount = 0
self.income_tax_deducted_till_date = 0

def calculate_component_amounts(self, component_type):
if not getattr(self, "_salary_structure_doc", None):
Expand Down

0 comments on commit b752684

Please sign in to comment.