[IMP] l10n_in_hr_payroll: merged salary rules of 'HRAM' and 'HRANM'

bzr revid: mtr@tinyerp.com-20120713132304-21dy22w9ytdbyt8g
This commit is contained in:
Meera Trambadia (OpenERP)
2012-07-13 18:53:04 +05:30
parent 8d94232e0a
commit 08a411a680
2 changed files with 14 additions and 30 deletions
@@ -14,39 +14,20 @@
</record>
<record id="hr_salary_rule_houserentallowancemetro" model="hr.salary.rule">
<field name="code">HRAM</field>
<field name="code">HRA</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">result = payslip.company_id.dearness_allowance and ((contract.wage + DA) * 0.50) or (contract.wage * 0.50)</field>
<field name="amount_python_compute">result=payslip.company_id.dearness_allowance and ((contract.wage + DA) * 0.50) or (contract.wage * 0.50) if (contract.city_type=='metro') else payslip.company_id.dearness_allowance and ((contract.wage + DA) * 0.40) or (contract.wage * 0.40) if (contract.city_type=='non-metro') else 0.00</field>
<field name="category_id" ref="hr_payroll.ALW"/>
<field name="name">House Rent Allowance for metro city</field>
<field name="name">House Rent Allowance</field>
<field name="sequence" eval="51"/>
<field name="condition_select">python</field>
<field name="condition_python">result = (contract.city_type=='metro')</field>
<field name="note">Rent receipts can be shown for taking tax benefit for living in a rented house.
Income tax exemption for HRA will be least of following:
1. The actual amount of HRA received as a part of salary.
2. 40% (if living in non-metro area).
2. 50% (if living in metro area) and 40% (if living in non-metro area) of (basic salary+Dearness allowance(if applicable)).
3. Rent paid minus 10% of (basic salary+DA).
</field>
</record>
<record id="hr_salary_rule_houserentallowancenonmetro" model="hr.salary.rule">
<field name="amount_select">code</field>
<field name="amount_python_compute">result = payslip.company_id.dearness_allowance and ((contract.wage + DA) * 0.40) or (contract.wage * 0.40)</field>
<field name="code">HRANM</field>
<field name="category_id" ref="hr_payroll.ALW"/>
<field name="name">House Rent Allowance for non metro city</field>
<field name="sequence" eval="52"/>
<field name="condition_select">python</field>
<field name="condition_python">result = (contract.city_type=='non-metro')</field>
<field name="note">Rent receipts can be shown for taking tax benefit for living in a rented house.
Income tax exemption for HRA will be least of following:
1. The actual amount of HRA received as a part of salary.
2. 50% (if living in metro area) of (basic salary+Dearness allowance (DA)).
3. Rent paid minus 10% of (basic salary+DA).
</field>
</record>
<record id="hr_salary_trans_allownce" model="hr.salary.rule">
<field name="code">TCA</field>
<field name="name">Transport/Conveyance Allownace</field>
@@ -38,7 +38,7 @@ class hr_contract(osv.osv):
_inherit = 'hr.contract'
_description = 'HR Contract'
_columns = {
'tds': fields.float('TDS', digits_compute=dp.get_precision('Payroll'), help="Amount for Tax Deduction at Source"),
'driver_salay': fields.boolean('Driver Salary', help=" Allowance for company provided driver"),
@@ -49,12 +49,15 @@ class hr_contract(osv.osv):
('non-metro', 'Non-Metro'),
], 'Type of City', readonly=False),
}
_defaults = {
'city_type': 'non-metro',
}
hr_contract()
class hr_employee(osv.osv):
'''
Employee's Join date allows to compute total working
Employee's Join date allows to compute total working
experience of Employee and it is used to calculate Gratuity rule.
'''
@@ -89,12 +92,12 @@ class hr_employee(osv.osv):
else:
res[employee.id] = 0.0
return res
_columns = {
'join_date': fields.date('Join Date', help="Joining date of employee"),
'number_of_year': fields.function(_compute_year, string='No. of Years of Service', type="float", store=True, help="Total years of work experience"),
}
hr_employee()
class payroll_advice(osv.osv):
@@ -119,7 +122,7 @@ class payroll_advice(osv.osv):
'company_id':fields.many2one('res.company', 'Company', required=True, readonly=True, states={'draft': [('readonly', False)]}),
'bank_id':fields.many2one('res.bank', 'Bank', readonly=True, states={'draft': [('readonly', False)]}, help="Select the Bank from which the salary is going to be paid"),
}
_defaults = {
'date': lambda * a: time.strftime('%Y-%m-%d'),
'state': lambda * a: 'draft',
@@ -132,7 +135,7 @@ class payroll_advice(osv.osv):
def compute_advice(self, cr, uid, ids, context=None):
"""
Advice - Create Advice lines in Payment Advice and
Advice - Create Advice lines in Payment Advice and
compute Advice lines.
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@@ -244,7 +247,7 @@ class res_company(osv.osv):
}
_defaults = {
'dearness_allowance': True,
}
}
res_company()