[IMP]: improvement in payroll module

bzr revid: mga@tinyerp.com-20100707130347-r4zlz7ktthfet0ai
This commit is contained in:
Mantavya Gajjar 2010-07-07 18:33:47 +05:30
parent 975b6c4988
commit f8efca986f
3 changed files with 22 additions and 16 deletions

View File

@ -522,7 +522,7 @@ class company_contribution(osv.osv):
'category_id':fields.many2one('hr.allounce.deduction.categoty', 'Heads', required=False),
'name':fields.char('Name', size=256, required=True, readonly=False),
'code':fields.char('Code', size=64, required=True, readonly=False),
'include_in_salary':fields.boolean('Included in Salary ?', help='If company contribute on this deduction then should company contribution is also deducted from Employee Salary'),
# 'include_in_salary':fields.boolean('Included in Salary ?', help='If company contribute on this deduction then should company contribution is also deducted from Employee Salary'),
'gratuity':fields.boolean('Use for Gratuity ?', required=False),
'line_ids':fields.one2many('company.contribution.line', 'contribution_id', 'Calculations', required=False),
'register_id':fields.property(
@ -537,19 +537,20 @@ class company_contribution(osv.osv):
),
'amount_type':fields.selection([
('fix','Fixed Amount'),
('per','Percentage'),
('func','Function Calculation'),
],'Amount Type', select=True),
'contribute_per':fields.float('Contribution', digits=(16, 4), help='Define Company contribution ratio 1.00=100% contribution, If Employee Contribute 5% then company will and here 0.50 defined then company will contribute 50% on employee 5% contribution'),
'account_id':fields.property(
'account.account',
type='many2one',
relation='account.account',
string="Account",
method=True,
view_load=True,
help="Expanse account where company expanse will be encoded",
required=False
),
# 'account_id':fields.property(
# 'account.account',
# type='many2one',
# relation='account.account',
# string="Account",
# method=True,
# view_load=True,
# help="Expanse account where company expanse will be encoded",
# required=False
# ),
'company_id':fields.many2one('res.company', 'Company', required=False),
'active':fields.boolean('Active', required=False),
'note': fields.text('Description'),

View File

@ -644,8 +644,6 @@
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="category_id"/>
<field name="company_id" select="1"/>
<field name="active" select="1"/>
</group>
<group col="2" colspan="2">
<separator colspan="2" string="Contributions"/>
@ -654,9 +652,11 @@
<field name="register_id" attrs="{'required': [('contribute','=',True)]}"/>
</group>
<group col="2" colspan="2">
<separator colspan="2" string="Accounts"/>
<field name="include_in_salary" />
<field name="account_id" attrs="{'required': [('include_in_salary','=',True)]}"/>
<separator colspan="2" string="Other Information"/>
<field name="company_id" select="1"/>
<field name="active" select="1"/>
<!-- <field name="include_in_salary" />-->
<!-- <field name="account_id" attrs="{'required': [('include_in_salary','=',True)]}"/>-->
</group>
<notebook colspan="4">
<page string="Function" attrs="{'readonly': [('amount_type','!=','func')]}">

View File

@ -393,6 +393,11 @@ class hr_payslip(osv.osv):
line_ids += [movel_pool.create(cr, uid, rec)]
for contrub in line.category_id.contribute_ids:
print contrib.name, contrub.code, contrub.amount_type, contrib.contribute_per, line.total
# if line.company_contrib > 0:
# company_contrib = line.company_contrib
## if line.category_id.amount_type == 'per':