[IMP] hr_payroll: improved payslip state as per workflow changes and removed unrequired methods
bzr revid: mtr@mtr-20110525091234-ih8c8e9vei8vfhbp
This commit is contained in:
parent
c002b2df9e
commit
60794632f8
|
@ -304,12 +304,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)
|
||||
|
||||
|
@ -343,9 +337,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
|
||||
|
||||
|
@ -493,7 +484,7 @@ class hr_payslip(osv.osv):
|
|||
result = 0.0
|
||||
self.cr.execute("SELECT sum(quantity) 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]
|
||||
|
@ -507,7 +498,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()
|
||||
|
@ -528,7 +519,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()
|
||||
|
|
Loading…
Reference in New Issue