[IMP]improved rules for gratuity,leave,uniform,telephone,proffessional developement. And implement method for gratuity rule.
bzr revid: kbh@tinyerp.com-20120521070643-523rov1a8v63f13p
This commit is contained in:
parent
38bc8ca8f0
commit
00dd3743f8
|
@ -22,12 +22,49 @@
|
|||
from osv import fields, osv
|
||||
import decimal_precision as dp
|
||||
|
||||
import time
|
||||
from datetime import datetime
|
||||
from datetime import timedelta
|
||||
from datetime import date
|
||||
from calendar import isleap
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
class hr_contract_in(osv.osv):
|
||||
_inherit = 'hr.contract'
|
||||
|
||||
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 Openday’s IDs
|
||||
@return: No. of years of experience.
|
||||
@param context: A standard dictionary for contextual values
|
||||
"""
|
||||
res = {}
|
||||
for contract in self.browse(cr, uid, ids, context=context):
|
||||
c_date = time.strftime('%Y-%m-%d')
|
||||
DATETIME_FORMAT = "%Y-%m-%d"
|
||||
date_start = datetime.strptime(contract.date_start, DATETIME_FORMAT)
|
||||
current_date = datetime.strptime(c_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
|
||||
years = relativedelta(current_date, date_start).years
|
||||
months = relativedelta(current_date, date_start).months
|
||||
mnth = months * 0.01
|
||||
if months < 10:
|
||||
year_month= float(mnth) + float(years)
|
||||
res[contract.id] = year_month
|
||||
else:
|
||||
year_months = float(mnth) + float(years)
|
||||
res[contract.id] = year_months
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'tds': fields.float('TDS', digits_compute=dp.get_precision('Payroll')),
|
||||
'food_coupon_amount': fields.float('Food Coupons ', digits_compute=dp.get_precision('Payroll')),
|
||||
'No_of_year':fields.function(_compute_year, string='No. of Years of service',type="float",readonly=True),
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ for more details : http://www.rupeetalk.com/finance-basics/income-tax-basics/inc
|
|||
<field name="name">Arrears</field>
|
||||
<field name="category_id" ref="hr_payroll.ALW"/>
|
||||
<field name="amount_select">fix</field>
|
||||
<field eval="100.0" name="amount_fix"/>
|
||||
<field eval="0.0" name="amount_fix"/>
|
||||
<field name="sequence" eval="30"/>
|
||||
<field name="note">
|
||||
Generally arrears are fully taxable, but employee may claim exemption u/s 89(1).
|
||||
|
@ -112,7 +112,7 @@ Read more: http://www.pankajbatra.com/finance/income-tax-calculator-2012-2013-20
|
|||
<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 = (categories.NET/26) * 15 * 5</field>
|
||||
<field name="amount_python_compute">result = (contract.wage + DA) * 15 * contract.No_of_year / worked_days.WORK100.number_of_days</field>
|
||||
<field name="sequence" eval="500"/>
|
||||
<field name="note">
|
||||
Covered under the Payment of Gratuity Act, 1971:
|
||||
|
@ -165,7 +165,7 @@ is to be limited to minimum of all below:
|
|||
<field name="name">Performance Incentive/Bonus</field>
|
||||
<field name="category_id" ref="hr_payroll.ALW"/>
|
||||
<field name="amount_select">fix</field>
|
||||
<field eval="5000.0" name="amount_fix"/>
|
||||
<field eval="0.0" name="amount_fix"/>
|
||||
<field name="sequence" eval="34"/>
|
||||
<field name="note">This would be fully taxable based on incentive.</field>
|
||||
</record>
|
||||
|
@ -198,7 +198,7 @@ business growth.This part would become non taxable on providing original bills.<
|
|||
<field name="name">Uniform/Dress Allowance</field>
|
||||
<field name="category_id" ref="hr_payroll.ALW"/>
|
||||
<field name="amount_select">fix</field>
|
||||
<field eval="500.0" name="amount_fix"/>
|
||||
<field eval="0.0" name="amount_fix"/>
|
||||
<field name="sequence" eval="37"/>
|
||||
<field name="note">
|
||||
Some sections of employees mat get allowance for purchase of office dress/uniform.
|
||||
|
@ -210,7 +210,7 @@ In such case, the component would become non-taxable.</field>
|
|||
<field name="name">Telephone Reimbursement</field>
|
||||
<field name="category_id" ref="hr_payroll.ALW"/>
|
||||
<field name="amount_select">fix</field>
|
||||
<field eval="500.0" name="amount_fix"/>
|
||||
<field eval="18000.0" name="amount_fix"/>
|
||||
<field name="sequence" eval="38"/>
|
||||
<field name="note">
|
||||
In some of the cases, companies may provide a component for telephone bills.
|
||||
|
@ -220,6 +220,15 @@ Read more: http://www.pankajbatra.com/finance/income-tax-calculator-2012-2013-20
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_salary_rule_prof_develope" model="hr.salary.rule">
|
||||
<field name="code">PDA</field>
|
||||
<field name="name">Professional Development 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="sequence" eval="49"/>
|
||||
</record>
|
||||
|
||||
<record id="hr_payroll_rule_car" model="hr.salary.rule">
|
||||
<field name="code">CAR</field>
|
||||
<field name="name">Car Expenses Reimbursement</field>
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<xpath expr="/form/notebook/page[@name='information']/group[@name='right_column']/field[@name='struct_id']" position="after">
|
||||
<field name="tds"/>
|
||||
<field name="food_coupon_amount"/>
|
||||
<field name="No_of_year"/>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
|
|
Loading…
Reference in New Issue