[MERGE] branch merged with trunk-payroll

bzr revid: mtr@mtr-20110526085043-psf4ph1ywl5b3sxd
This commit is contained in:
mtr 2011-05-26 14:20:43 +05:30
commit 2b8e537224
3 changed files with 9 additions and 18 deletions

View File

@ -309,12 +309,6 @@ class hr_payslip(osv.osv):
def cancel_sheet(self, cr, uid, ids, context=None):
return self.write(cr, uid, ids, {'state': 'cancel'}, context=context)
def account_check_sheet(self, cr, uid, ids, context=None):
return self.write(cr, uid, ids, {'state': 'accont_check'}, context=context)
def hr_check_sheet(self, cr, uid, ids, context=None):
return self.write(cr, uid, ids, {'state': 'hr_check'}, context=context)
def process_sheet(self, cr, uid, ids, context=None):
return self.write(cr, uid, ids, {'paid': True, 'state': 'done'}, context=context)
@ -348,9 +342,6 @@ class hr_payslip(osv.osv):
'context': {}
}
def verify_sheet(self, cr, uid, ids, context=None):
return self.write(cr, uid, ids, {'state': 'confirm'}, context=context)
def check_done(self, cr, uid, ids, context=None):
return True
@ -496,9 +487,9 @@ class hr_payslip(osv.osv):
if to_date is None:
to_date = datetime.now().strftime('%Y-%m-%d')
result = 0.0
self.cr.execute("SELECT sum(quantity) as sum\
self.cr.execute("SELECT sum(amount) as sum\
FROM hr_payslip as hp, hr_payslip_input as pi \
WHERE hp.employee_id = %s AND hp.state in ('confirm','done') \
WHERE hp.employee_id = %s AND hp.state = 'done' \
AND hp.date_from >= %s AND hp.date_to <= %s AND hp.id = pi.payslip_id AND pi.code = %s",
(self.employee_id, from_date, to_date, code))
res = self.cr.fetchone()[0]
@ -512,7 +503,7 @@ class hr_payslip(osv.osv):
result = 0.0
self.cr.execute("SELECT sum(number_of_days) as number_of_days, sum(number_of_hours) as number_of_hours\
FROM hr_payslip as hp, hr_payslip_worked_days as pi \
WHERE hp.employee_id = %s AND hp.state in ('confirm','done') \
WHERE hp.employee_id = %s AND hp.state = 'done'\
AND hp.date_from >= %s AND hp.date_to <= %s AND hp.id = pi.payslip_id AND pi.code = %s",
(self.employee_id, from_date, to_date, code))
return self.cr.fetchone()
@ -533,7 +524,7 @@ class hr_payslip(osv.osv):
to_date = datetime.now().strftime('%Y-%m-%d')
self.cr.execute("SELECT sum(case when hp.credit_note = False then (pl.total) else (-pl.total) end)\
FROM hr_payslip as hp, hr_payslip_line as pl \
WHERE hp.employee_id = %s AND hp.state in ('confirm','done') \
WHERE hp.employee_id = %s AND hp.state = 'done' \
AND hp.date_from >= %s AND hp.date_to <= %s AND hp.id = pl.slip_id AND pl.code = %s",
(self.employee_id, from_date, to_date, code))
res = self.cr.fetchone()
@ -733,13 +724,13 @@ class hr_payslip_input(osv.osv):
'payslip_id': fields.many2one('hr.payslip', 'Pay Slip', required=True),
'sequence': fields.integer('Sequence', required=True,),
'code': fields.char('Code', size=52, required=True, help="The code that can be used in the salary rules"),
'quantity': fields.float('Quantity', help="It is used in computation. For e.g. A rule for sales having 1% commission of basic salary for per product can defined in expression like result = inputs.SASUS.qunatity * contract.wage*0.01."),
'amount': fields.float('Amount', help="It is used in computation. For e.g. A rule for sales having 1% commission of basic salary for per product can defined in expression like result = inputs.SALEURO.amount * contract.wage*0.01."),
'contract_id': fields.many2one('hr.contract', 'Contract', required=True, help="The contract for which applied this input"),
}
_order = 'payslip_id, sequence'
_defaults = {
'sequence': 10,
'quantity': 0.0,
'amount': 0.0,
}
hr_payslip_input()

View File

@ -67,7 +67,7 @@
<field name="category_id" ref="hr_payroll.ALW"/>
<field name="name">Get 1% of sales</field>
<field name="sequence" eval="17"/>
<field name="amount_python_compute">result = (inputs.SALEURO.quantity + inputs.SALASIA.quantity) * contract.wage * 0.01</field>
<field name="amount_python_compute">result = (inputs.SALEURO.amount + inputs.SALASIA.amount) * contract.wage * 0.01</field>
</record>
<!-- Rule Inputs -->

View File

@ -298,7 +298,7 @@
<tree string="Input Data" editable="bottom">
<field name="name"/>
<field name="code"/>
<field name="quantity"/>
<field name="amount"/>
<field name="contract_id" groups="base.group_extended"/>
<field name="sequence" invisible="True"/>
</tree>
@ -308,7 +308,7 @@
<field name="code" select="1"/>
<field name="payslip_id"/>
<field name="sequence" groups="base.group_extended"/>
<field name="quantity"/>
<field name="amount"/>
<field name="contract_id" groups="base.group_extended"/>
</group>
</form>