[IMP/REM]l10n_in_hr_payroll:removed gratuity rules and all calculations for that rule,improved performance,bonus and supplementary rules
bzr revid: kbh@tinyerp.com-20120822112153-l3zlveq0afuu40mx
This commit is contained in:
parent
0015c913f5
commit
83ec6f517b
|
@ -93,8 +93,10 @@
|
|||
<field name="code">SA</field>
|
||||
<field name="name">Grade/Special/Management/Supplementary Allowance</field>
|
||||
<field name="category_id" ref="hr_payroll.ALW"/>
|
||||
<field name="amount_select">fix</field>
|
||||
<field eval="0.0" name="amount_fix"/>
|
||||
<field name="condition_select">python</field>
|
||||
<field name="condition_python">result = bool(contract.supplementary_allowance)</field>
|
||||
<field name="amount_select">code</field>
|
||||
<field name="amount_python_compute">result = contract.supplementary_allowance</field>
|
||||
<field name="sequence" eval="20"/>
|
||||
<field name="note">This allowance is normally given as an additional benefit to employees and is fully taxable.</field>
|
||||
</record>
|
||||
|
@ -163,19 +165,6 @@ One would need to compute income tax on the arrears if it would have been receiv
|
|||
Now difference of income tax between payment year and actual year would be allowed for deduction.</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_salary_rule_gratuity" model="hr.salary.rule">
|
||||
<field name="code">GRA</field>
|
||||
<field name="name">Gratuity</field>
|
||||
<field name="category_id" ref="hr_payroll.ALW"/>
|
||||
<field name="condition_select">none</field>
|
||||
<field name="amount_select">code</field>
|
||||
<field name="amount_python_compute">result = payslip.company_id.dearness_allowance and ((contract.wage + DA) * 15 * employee.number_of_year / worked_days.WORK100.number_of_days) or (contract.wage * 15 * employee.number_of_year / worked_days.WORK100.number_of_days)</field>
|
||||
<field name="sequence" eval="57"/>
|
||||
<field name="note">Covered under the Payment of Gratuity Act, 1971:
|
||||
(Last drawn monthly basic salary + dearness allowance)/26 x 15 days x
|
||||
number of years of service (date of joining – date of retirement/leaving job)</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_salary_rule_lta" model="hr.salary.rule">
|
||||
<field name="code">LTA</field>
|
||||
<field name="name">Leave Travel Allowance</field>
|
||||
|
@ -202,16 +191,27 @@ number of years of service (date of joining – date of retirement/leaving job)<
|
|||
4.Rs. 3 Lakh</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_salary_rule_bonus" model="hr.salary.rule">
|
||||
<record id="hr_salary_rule_performance" model="hr.salary.rule">
|
||||
<field name="code">PI</field>
|
||||
<field name="name">Performance Incentive/Bonus</field>
|
||||
<field name="name">Performance Incentive</field>
|
||||
<field name="category_id" ref="hr_payroll.ALW"/>
|
||||
<field name="amount_select">fix</field>
|
||||
<field eval="0.0" name="amount_fix"/>
|
||||
<field name="amount_select">code</field>
|
||||
<field name="amount_python_compute">result = inputs.PERF.amount</field>
|
||||
<field name="sequence" eval="31"/>
|
||||
<field name="note">This would be fully taxable based on incentive.</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_salary_rule_bonus" model="hr.salary.rule">
|
||||
<field name="code">BONUS</field>
|
||||
<field name="name">Bonus</field>
|
||||
<field name="category_id" ref="hr_payroll.ALW"/>
|
||||
<field name="amount_select">code</field>
|
||||
<field name="amount_python_compute">result = inputs.BNS.amount</field>
|
||||
<field name="sequence" eval="41"/>
|
||||
<field name="note">This would be fully taxable based on Bonus.</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="hr_salary_rule_medical" model="hr.salary.rule">
|
||||
<field name="code">MEDA</field>
|
||||
<field name="name">Medical Reimbursement</field>
|
||||
|
@ -467,5 +467,18 @@ number of years of service (date of joining – date of retirement/leaving job)<
|
|||
<field name="note">Both the employees and employer contribute to the fund at the rate of 12% of the basic wages, dearness allowance and retaining allowance, if any, payable to employees per month.</field>
|
||||
</record>
|
||||
|
||||
<!-- Rule Inputs -->
|
||||
|
||||
<record id="hr_rule_input_performance" model="hr.rule.input">
|
||||
<field name="code">PERF</field>
|
||||
<field name="name">Performance of Employee</field>
|
||||
<field name="input_id" ref="hr_salary_rule_performance"/>
|
||||
</record>
|
||||
|
||||
<record id="hr_rule_input_bonus" model="hr.rule.input">
|
||||
<field name="code">BNS</field>
|
||||
<field name="name">Bonus</field>
|
||||
<field name="input_id" ref="hr_salary_rule_bonus"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -50,6 +50,7 @@ class hr_contract(osv.osv):
|
|||
('non-metro', 'Non Metro'),
|
||||
], 'Type of City'),
|
||||
'house_rent_allowance_metro_nonmetro': fields.float('House Rent Allowance for Metro and Non Metro City', digits_compute=dp.get_precision('Payroll'), help="HRA computed as percentage(%)"),
|
||||
'supplementary_allowance': fields.float('Supplementary Allowance', digits_compute=dp.get_precision('Payroll')),
|
||||
}
|
||||
_defaults = {
|
||||
'city_type': 'non-metro',
|
||||
|
@ -57,51 +58,6 @@ class hr_contract(osv.osv):
|
|||
|
||||
hr_contract()
|
||||
|
||||
class hr_employee(osv.osv):
|
||||
'''
|
||||
Employee's Join date allows to compute total working
|
||||
experience of Employee and it is used to calculate Gratuity rule.
|
||||
'''
|
||||
|
||||
_inherit = 'hr.employee'
|
||||
_description = 'Employee'
|
||||
|
||||
def _compute_year(self, cr, uid, ids, fields, args, context=None):
|
||||
"""
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of employee’s IDs
|
||||
@return: No. of years of experience.
|
||||
@param context: A standard dictionary for contextual values
|
||||
"""
|
||||
res = {}
|
||||
c_date = time.strftime(DATETIME_FORMAT)
|
||||
current_date = datetime.strptime(c_date, DATETIME_FORMAT)
|
||||
for employee in self.browse(cr, uid, ids, context=context):
|
||||
if employee.join_date:
|
||||
date_start = datetime.strptime(employee.join_date, DATETIME_FORMAT)
|
||||
diffyears = current_date.year - date_start.year
|
||||
difference = current_date - date_start.replace(current_date.year)
|
||||
days_in_year = isleap(current_date.year) and 366 or 365
|
||||
difference_in_years = diffyears + (difference.days + difference.seconds / 86400.0) / days_in_year
|
||||
total_years = relativedelta(current_date, date_start).years
|
||||
total_months = relativedelta(current_date, date_start).months
|
||||
if total_months < 10:
|
||||
year_month = float(total_months) / 10 + total_years
|
||||
else:
|
||||
year_month = float(total_months) / 100 + total_years
|
||||
res[employee.id] = year_month
|
||||
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):
|
||||
'''
|
||||
Bank Advice
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<record id="hr_payroll_salary_structure_ind_emp" model="hr.payroll.structure">
|
||||
<field name="code">NE</field>
|
||||
<field name="name">Non-Executive Employee</field>
|
||||
<field eval="[(6, 0, [ref('hr_salary_rule_medical'), ref('hr_salary_rule_da'), ref('hr_salary_rule_lta'), ref('hr_salary_rule_telephone'), ref('hr_salary_rule_internet'), ref('hr_payroll_rule_child1'), ref('hr_salary_rule_gratuity')])]" name="rule_ids"/>
|
||||
<field eval="[(6, 0, [ref('hr_salary_rule_medical'), ref('hr_salary_rule_da'), ref('hr_salary_rule_lta'), ref('hr_salary_rule_telephone'), ref('hr_salary_rule_internet'), ref('hr_payroll_rule_child1')])]" name="rule_ids"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="parent_id" ref="hr_payroll.structure_base"/>
|
||||
</record>
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
<field name="driver_salay"/>
|
||||
<field name="city_type"/>
|
||||
<field name="house_rent_allowance_metro_nonmetro"/>
|
||||
<field name="supplementary_allowance"/>
|
||||
</group>
|
||||
<group col="2" colspan="2" name="left_column">
|
||||
<separator colspan="2" string="Deduction"/>
|
||||
|
@ -27,21 +28,6 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_employee_form_in_inherit" model="ir.ui.view">
|
||||
<field name="name">hr.employee.form.inherit</field>
|
||||
<field name="model">hr.employee</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="hr.view_employee_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='active']" position="before">
|
||||
<field name="join_date"/>
|
||||
<field name="number_of_year"/>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_payslip_run_form_inherit" model="ir.ui.view">
|
||||
<field name="name">hr.payslip.run.form.inherit</field>
|
||||
<field name="model">hr.payslip.run</field>
|
||||
|
|
Loading…
Reference in New Issue