[FIX]: reviwe payroll and recall lost changes during the merge
bzr revid: mga@tinyerp.com-20100702103715-iew7rlke3we92ipg
This commit is contained in:
parent
13aa45be31
commit
0e61edf922
|
@ -62,4 +62,4 @@
|
|||
'active': False,
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -217,63 +217,28 @@ class payroll_register(osv.osv):
|
|||
slip_line_pool = self.pool.get('hr.payslip.line')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
|
||||
vals = self.read(cr, uid, ids)[0]
|
||||
vals = self.browse(cr, uid, ids)[0]
|
||||
|
||||
emp_ids = emp_pool.search(cr, uid, [])
|
||||
|
||||
for emp in emp_pool.browse(cr, uid, emp_ids):
|
||||
old_slips = slip_pool.search(cr, uid, [('employee_id','=',emp.id), ('date','=',vals['date'])])
|
||||
old_slips = slip_pool.search(cr, uid, [('employee_id','=', emp.id), ('date','=',vals.date)])
|
||||
if old_slips:
|
||||
slip_pool.write(cr, uid, old_slips, {'register_id':ids[0]})
|
||||
for sid in old_slips:
|
||||
wf_service.trg_validate(uid, 'hr.payslip', sid, 'compute_sheet', cr)
|
||||
continue
|
||||
|
||||
sql_req= '''
|
||||
SELECT c.wage as wage, struct_id as function
|
||||
FROM hr_contract c
|
||||
LEFT JOIN hr_employee emp on (c.employee_id=emp.id)
|
||||
LEFT JOIN hr_contract_wage_type cwt on (cwt.id = c.wage_type_id)
|
||||
LEFT JOIN hr_contract_wage_type_period p on (cwt.period_id = p.id)
|
||||
WHERE
|
||||
(emp.id=%s) AND
|
||||
(date_start <= %s) AND
|
||||
(date_end IS NULL OR date_end >= %s)
|
||||
LIMIT 1
|
||||
'''
|
||||
cr.execute(sql_req, (emp.id, vals['date'], vals['date']))
|
||||
contract_info = cr.dictfetchone()
|
||||
|
||||
if not contract_info:
|
||||
continue
|
||||
|
||||
function = contract_info['struct_id']
|
||||
lines = []
|
||||
if function:
|
||||
func = func_pool.read(cr, uid, function, ['line_ids'])
|
||||
lines = slip_line_pool.browse(cr, uid, func['line_ids'])
|
||||
|
||||
res = {
|
||||
'employee_id':emp.id,
|
||||
'basic':contract_info['wage'],
|
||||
'register_id':ids[0],
|
||||
'name':vals['name'],
|
||||
'date':vals['date'],
|
||||
'journal_id':vals['journal_id'][0],
|
||||
'bank_journal_id':vals['bank_journal_id'][0]
|
||||
}
|
||||
slip_id = slip_pool.create(cr, uid, res)
|
||||
|
||||
old_slip_id = slip_line_pool.search(cr, uid, [('slip_id','=',slip_id)])
|
||||
slip_line_pool.unlink(cr, uid, old_slip_id)
|
||||
|
||||
for line in lines:
|
||||
slip_line_pool.copy(cr, uid, line.id, {'slip_id':slip_id, 'employee_id':False, 'function_id':False}, {})
|
||||
|
||||
for line in emp.line_ids:
|
||||
slip_line_pool.copy(cr, uid, line.id, {'slip_id':slip_id, 'employee_id':False, 'function_id':False}, {})
|
||||
|
||||
wf_service.trg_validate(uid, 'hr.payslip', slip_id, 'compute_sheet', cr)
|
||||
else:
|
||||
res = {
|
||||
'employee_id':emp.id,
|
||||
'basic':0.0,
|
||||
'register_id':ids[0],
|
||||
'name':vals.name,
|
||||
'date':vals.date,
|
||||
'journal_id':vals.journal_id.id,
|
||||
'bank_journal_id':vals.bank_journal_id.id
|
||||
}
|
||||
slip_id = slip_pool.create(cr, uid, res)
|
||||
wf_service.trg_validate(uid, 'hr.payslip', slip_id, 'compute_sheet', cr)
|
||||
|
||||
number = self.pool.get('ir.sequence').get(cr, uid, 'salary.register')
|
||||
self.write(cr, uid, ids, {'state':'draft', 'number':number})
|
||||
|
@ -291,30 +256,17 @@ class payroll_register(osv.osv):
|
|||
self.write(cr, uid, ids, {'state':'hr_check'})
|
||||
return True
|
||||
|
||||
def verify_twice_sheet(self, cr, uid, ids, context={}):
|
||||
slip_pool = self.pool.get('hr.payslip')
|
||||
|
||||
for id in ids:
|
||||
sids = slip_pool.search(cr, uid, [('register_id','=',id), ('state','=','hr_check')])
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for sid in sids:
|
||||
wf_service.trg_validate(uid, 'hr.payslip', sid, 'verify_twice_sheet', cr)
|
||||
|
||||
self.write(cr, uid, ids, {'state':'accont_check'})
|
||||
return True
|
||||
|
||||
def final_verify_sheet(self, cr, uid, ids, context={}):
|
||||
slip_pool = self.pool.get('hr.payslip')
|
||||
advice_pool = self.pool.get('hr.payroll.advice')
|
||||
advice_line_pool = self.pool.get('hr.payroll.advice.line')
|
||||
|
||||
for id in ids:
|
||||
sids = slip_pool.search(cr, uid, [('register_id','=',id), ('state','=','accont_check')])
|
||||
sids = slip_pool.search(cr, uid, [('register_id','=',id), ('state','=','hr_check')])
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for sid in sids:
|
||||
wf_service.trg_validate(uid, 'hr.payslip', sid, 'final_verify_sheet', cr)
|
||||
|
||||
|
||||
for reg in self.browse(cr, uid, ids):
|
||||
accs = {}
|
||||
for slip in reg.line_ids:
|
||||
|
@ -538,13 +490,14 @@ class payment_category(osv.osv):
|
|||
('deduction','Deduction'),
|
||||
('other','Others'),
|
||||
],'Type', select=True),
|
||||
'base':fields.char('Based on', size=64, required=True, readonly=False, help='This will use to computer the % fields values, in general its on basic, but You can use all heads code field in small letter as a variable name i.e. hra, ma, lta, etc...., also you can use, static varible basic'),
|
||||
'base':fields.text('Based on', required=True, readonly=False, help='This will use to computer the % fields values, in general its on basic, but You can use all heads code field in small letter as a variable name i.e. hra, ma, lta, etc...., also you can use, static varible basic'),
|
||||
'condition':fields.char('Condition', size=1024, required=True, readonly=False, help='Applied this head for calculation if condition is true'),
|
||||
'sequence': fields.integer('Sequence', required=True, help='Use to arrange calculation sequence'),
|
||||
'note': fields.text('Description'),
|
||||
'user_id':fields.char('User', size=64, required=False, readonly=False),
|
||||
'state':fields.char('Label', size=64, required=False, readonly=False),
|
||||
'company_id':fields.many2one('res.company', 'Company', required=False),
|
||||
'contribute_ids':fields.one2many('company.contribution', 'category_id', 'Contributions', required=False),
|
||||
}
|
||||
_defaults = {
|
||||
'condition': lambda *a: 'True',
|
||||
|
@ -786,11 +739,7 @@ class hr_payslip(osv.osv):
|
|||
'other_pay': fields.function(_calculate, method=True, store=True, multi='dc', string='Others', digits=(16, 2)),
|
||||
'total_pay': fields.function(_calculate, method=True, store=True, multi='dc', string='Total Payment', digits=(16, 2)),
|
||||
'line_ids':fields.one2many('hr.payslip.line', 'slip_id', 'Payslip Line', required=False, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'move_ids':fields.one2many('hr.payslip.account.move', 'slip_id', 'Accounting vouchers', required=False),
|
||||
'move_line_ids':fields.many2many('account.move.line', 'payslip_lines_rel', 'slip_id', 'line_id', 'Accounting Lines', readonly=True),
|
||||
'move_payment_ids':fields.many2many('account.move.line', 'payslip_payment_rel', 'slip_id', 'payment_id', 'Payment Lines', readonly=True),
|
||||
'company_id':fields.many2one('res.company', 'Company', required=False),
|
||||
'period_id': fields.many2one('account.period', 'Force Period', domain=[('state','<>','done')], help="Keep empty to use the period of the validation(Payslip) date."),
|
||||
'holiday_days': fields.integer('No of Leaves', readonly=True),
|
||||
'worked_days': fields.integer('Worked Day', readonly=True),
|
||||
'working_days': fields.integer('Working Days', readonly=True),
|
||||
|
@ -839,162 +788,9 @@ class hr_payslip(osv.osv):
|
|||
return True
|
||||
|
||||
def cancel_sheet(self, cr, uid, ids, context={}):
|
||||
move_pool = self.pool.get('account.move')
|
||||
|
||||
for slip in self.browse(cr, uid, ids, context):
|
||||
for line in slip.move_ids:
|
||||
if slip.move_id:
|
||||
if slip.move_id.state == 'posted':
|
||||
move_pool.button_cancel(cr, uid [slip.move_id.id], context)
|
||||
move_pool.unlink(cr, uid, [slip.move_id.id])
|
||||
|
||||
self.write(cr, uid, ids, {'state':'cancel'})
|
||||
return True
|
||||
|
||||
def process_sheet(self, cr, uid, ids, context={}):
|
||||
move_pool = self.pool.get('account.move')
|
||||
movel_pool = self.pool.get('account.move.line')
|
||||
invoice_pool = self.pool.get('account.invoice')
|
||||
|
||||
for slip in self.browse(cr,uid,ids):
|
||||
line_ids = []
|
||||
partner = False
|
||||
partner_id = False
|
||||
exp_ids = []
|
||||
|
||||
partner = slip.employee_id.address_home_id.partner_id
|
||||
partner_id = partner.id
|
||||
|
||||
fiscal_year_ids = self.pool.get('account.fiscalyear').search(cr, uid, [])
|
||||
if not fiscal_year_ids:
|
||||
raise osv.except_osv(_('Warning !'), _('Please define fiscal year for perticular contract'))
|
||||
fiscal_year_objs = self.pool.get('account.fiscalyear').read(cr, uid, fiscal_year_ids, ['date_start','date_stop'])
|
||||
year_exist = False
|
||||
for fiscal_year in fiscal_year_objs:
|
||||
if ((fiscal_year['date_start'] <= slip.date) and (fiscal_year['date_stop'] >= slip.date)):
|
||||
year_exist = True
|
||||
if not year_exist:
|
||||
raise osv.except_osv(_('Warning !'), _('Fiscal Year is not defined for slip date %s'%slip.date))
|
||||
search_period = self.pool.get('account.period').search(cr,uid,[('date_start','<=',slip.date),('date_stop','>=',slip.date)])
|
||||
if not search_period:
|
||||
raise osv.except_osv(_('Warning !'), _('Period is not defined for slip date %s'%slip.date))
|
||||
period_id = search_period[0]
|
||||
name = 'Payment of Salary to %s' % (slip.employee_id.name)
|
||||
move = {
|
||||
'journal_id': slip.bank_journal_id.id,
|
||||
'period_id': period_id,
|
||||
'date': slip.date,
|
||||
'type':'bank_pay_voucher',
|
||||
'ref':slip.number,
|
||||
'narration': name
|
||||
}
|
||||
move_id = move_pool.create(cr, uid, move)
|
||||
self.create_voucher(cr, uid, [slip.id], name, move_id)
|
||||
|
||||
name = "To %s account" % (slip.employee_id.name)
|
||||
ded_rec = {
|
||||
'move_id':move_id,
|
||||
'name': name,
|
||||
#'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'account_id': slip.employee_id.property_bank_account.id,
|
||||
'debit': 0.0,
|
||||
'credit' : slip.total_pay,
|
||||
'journal_id' : slip.journal_id.id,
|
||||
'period_id' :period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_rec)]
|
||||
name = "By %s account" % (slip.employee_id.property_bank_account.name)
|
||||
cre_rec = {
|
||||
'move_id':move_id,
|
||||
'name': name,
|
||||
'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'account_id': partner.property_account_payable.id,
|
||||
'debit': slip.total_pay,
|
||||
'credit' : 0.0,
|
||||
'journal_id' : slip.journal_id.id,
|
||||
'period_id' :period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, cre_rec)]
|
||||
|
||||
other_pay = slip.other_pay
|
||||
#Process all Reambuse Entries
|
||||
for line in slip.line_ids:
|
||||
if line.type == 'otherpay' and line.expanse_id.invoice_id:
|
||||
if not line.expanse_id.invoice_id.move_id:
|
||||
raise osv.except_osv(_('Warning !'), _('Please Confirm all Expanse Invoice appear for Reimbursement'))
|
||||
invids = [line.expanse_id.invoice_id.id]
|
||||
amount = line.total
|
||||
acc_id = slip.bank_journal_id.default_credit_account_id and slip.bank_journal_id.default_credit_account_id.id
|
||||
period_id = slip.period_id.id
|
||||
journal_id = slip.bank_journal_id.id
|
||||
name = '[%s]-%s' % (slip.number, line.name)
|
||||
invoice_pool.pay_and_reconcile(cr, uid, invids, amount, acc_id, period_id, journal_id, False, period_id, False, context, name)
|
||||
other_pay -= amount
|
||||
#TODO: link this account entries to the Payment Lines also Expanse Entries to Account Lines
|
||||
l_ids = movel_pool.search(cr, uid, [('name','=',name)])
|
||||
line_ids += l_ids
|
||||
|
||||
l_ids = movel_pool.search(cr, uid, [('invoice','=',line.expanse_id.invoice_id.id)])
|
||||
exp_ids += l_ids
|
||||
|
||||
#Process for Other payment if any
|
||||
other_move_id = False
|
||||
if slip.other_pay > 0:
|
||||
narration = 'Payment of Other Payeble amounts to %s' % (slip.employee_id.name)
|
||||
move = {
|
||||
'journal_id': slip.bank_journal_id.id,
|
||||
'period_id': period_id,
|
||||
'date': slip.date,
|
||||
'type':'bank_pay_voucher',
|
||||
'ref':slip.number,
|
||||
'narration': narration
|
||||
}
|
||||
other_move_id = move_pool.create(cr, uid, move)
|
||||
self.create_voucher(cr, uid, [slip.id], narration, move_id)
|
||||
|
||||
name = "To %s account" % (slip.employee_id.name)
|
||||
ded_rec = {
|
||||
'move_id':other_move_id,
|
||||
'name':name,
|
||||
'date':slip.date,
|
||||
'account_id':slip.employee_id.property_bank_account.id,
|
||||
'debit': 0.0,
|
||||
'credit': other_pay,
|
||||
'journal_id':slip.journal_id.id,
|
||||
'period_id':period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_rec)]
|
||||
name = "By %s account" % (slip.employee_id.property_bank_account.name)
|
||||
cre_rec = {
|
||||
'move_id':other_move_id,
|
||||
'name':name,
|
||||
'partner_id':partner_id,
|
||||
'date':slip.date,
|
||||
'account_id':partner.property_account_payable.id,
|
||||
'debit': other_pay,
|
||||
'credit':0.0,
|
||||
'journal_id':slip.journal_id.id,
|
||||
'period_id':period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, cre_rec)]
|
||||
|
||||
rec = {
|
||||
'state':'done',
|
||||
'move_payment_ids':[(6, 0, line_ids)],
|
||||
'paid':True
|
||||
}
|
||||
self.write(cr, uid, [slip.id], rec)
|
||||
for exp_id in exp_ids:
|
||||
self.write(cr, uid, [slip.id], {'move_line_ids':[(4, exp_id)]})
|
||||
|
||||
return True
|
||||
|
||||
def account_check_sheet(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'accont_check'})
|
||||
return True
|
||||
|
@ -1002,365 +798,15 @@ class hr_payslip(osv.osv):
|
|||
def hr_check_sheet(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'hr_check'})
|
||||
return True
|
||||
|
||||
def verify_sheet(self, cr, uid, ids, context={}):
|
||||
|
||||
move_pool = self.pool.get('account.move')
|
||||
movel_pool = self.pool.get('account.move.line')
|
||||
exp_pool = self.pool.get('hr.expense.expense')
|
||||
|
||||
for slip in self.browse(cr,uid,ids):
|
||||
total_deduct = 0.0
|
||||
|
||||
line_ids = []
|
||||
partner = False
|
||||
partner_id = False
|
||||
|
||||
if not slip.employee_id.address_home_id:
|
||||
raise osv.except_osv(_('Integrity Error !'), _('Please defined the Employee Home Address Along with Partners !!'))
|
||||
|
||||
if not slip.employee_id.address_home_id.partner_id:
|
||||
raise osv.except_osv(_('Integrity Error !'), _('Please defined the Partner in Home Address !!'))
|
||||
|
||||
partner = slip.employee_id.address_home_id.partner_id
|
||||
partner_id = slip.employee_id.address_home_id.partner_id.id
|
||||
|
||||
period_id = False
|
||||
|
||||
if slip.period_id:
|
||||
period_id = slip.period_id.id
|
||||
else:
|
||||
fiscal_year_ids = self.pool.get('account.fiscalyear').search(cr, uid, [])
|
||||
if not fiscal_year_ids:
|
||||
raise osv.except_osv(_('Warning !'), _('Please define fiscal year for perticular contract'))
|
||||
fiscal_year_objs = self.pool.get('account.fiscalyear').read(cr, uid, fiscal_year_ids, ['date_start','date_stop'])
|
||||
year_exist = False
|
||||
for fiscal_year in fiscal_year_objs:
|
||||
if ((fiscal_year['date_start'] <= slip.date) and (fiscal_year['date_stop'] >= slip.date)):
|
||||
year_exist = True
|
||||
if not year_exist:
|
||||
raise osv.except_osv(_('Warning !'), _('Fiscal Year is not defined for slip date %s'%slip.date))
|
||||
search_period = self.pool.get('account.period').search(cr,uid,[('date_start','<=',slip.date),('date_stop','>=',slip.date)])
|
||||
if not search_period:
|
||||
raise osv.except_osv(_('Warning !'), _('Period is not defined for slip date %s'%slip.date))
|
||||
period_id = search_period[0]
|
||||
|
||||
move = {
|
||||
#'name': slip.name,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'date': slip.date,
|
||||
'ref':slip.number,
|
||||
'narration': slip.name
|
||||
}
|
||||
move_id = move_pool.create(cr, uid, move)
|
||||
self.create_voucher(cr, uid, [slip.id], slip.name, move_id)
|
||||
|
||||
line = {
|
||||
'move_id':move_id,
|
||||
'name': "By Basic Salary / " + slip.employee_id.name,
|
||||
'date': slip.date,
|
||||
'account_id': slip.employee_id.salary_account.id,
|
||||
'debit': slip.basic,
|
||||
'credit': 0.0,
|
||||
'quantity':slip.working_days,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'analytic_account_id': False,
|
||||
'ref':slip.number
|
||||
}
|
||||
|
||||
#Setting Analysis Account for Basic Salary
|
||||
if slip.employee_id.analytic_account:
|
||||
line['analytic_account_id'] = slip.employee_id.analytic_account.id
|
||||
|
||||
move_line_id = movel_pool.create(cr, uid, line)
|
||||
line_ids += [move_line_id]
|
||||
|
||||
line = {
|
||||
'move_id':move_id,
|
||||
'name': "To Basic Paysble Salary / " + slip.employee_id.name,
|
||||
'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'account_id': slip.employee_id.employee_account.id,
|
||||
'debit': 0.0,
|
||||
'quantity':slip.working_days,
|
||||
'credit': slip.basic,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, line)]
|
||||
|
||||
for line in slip.line_ids:
|
||||
name = "[%s] - %s / %s" % (line.code, line.name, slip.employee_id.name)
|
||||
amount = line.total
|
||||
|
||||
if line.type == 'leaves':
|
||||
continue
|
||||
|
||||
rec = {
|
||||
'move_id':move_id,
|
||||
'name': name,
|
||||
'date': slip.date,
|
||||
'account_id': line.account_id.id,
|
||||
'debit': 0.0,
|
||||
'credit' : 0.0,
|
||||
'journal_id' : slip.journal_id.id,
|
||||
'period_id' :period_id,
|
||||
'analytic_account_id':False,
|
||||
'ref':slip.number,
|
||||
'quantity':1
|
||||
}
|
||||
|
||||
#Setting Analysis Account for Salary Slip Lines
|
||||
if line.analytic_account_id:
|
||||
rec['analytic_account_id'] = line.analytic_account_id.id
|
||||
else:
|
||||
rec['analytic_account_id'] = slip.deg_id.account_id.id
|
||||
|
||||
if line.type == 'allounce' or line.type == 'otherpay':
|
||||
rec['debit'] = amount
|
||||
if not partner.property_account_payable:
|
||||
raise osv.except_osv(_('Integrity Error !'), _('Please Configure Partners Payable Account!!'))
|
||||
ded_rec = {
|
||||
'move_id':move_id,
|
||||
'name': name,
|
||||
'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'account_id': partner.property_account_payable.id,
|
||||
'debit': 0.0,
|
||||
'quantity':1,
|
||||
'credit' : amount,
|
||||
'journal_id' : slip.journal_id.id,
|
||||
'period_id' :period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_rec)]
|
||||
elif line.type == 'deduction' or line.type == 'otherdeduct':
|
||||
if not partner.property_account_receivable:
|
||||
raise osv.except_osv(_('Integrity Error !'), _('Please Configure Partners Receivable Account!!'))
|
||||
rec['credit'] = amount
|
||||
total_deduct += amount
|
||||
ded_rec = {
|
||||
'move_id':move_id,
|
||||
'name': name,
|
||||
'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'quantity':1,
|
||||
'account_id': partner.property_account_receivable.id,
|
||||
'debit': amount,
|
||||
'credit' : 0.0,
|
||||
'journal_id' : slip.journal_id.id,
|
||||
'period_id' :period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_rec)]
|
||||
|
||||
line_ids += [movel_pool.create(cr, uid, rec)]
|
||||
|
||||
if line.company_contrib > 0:
|
||||
company_contrib = line.company_contrib
|
||||
# if line.category_id.amount_type == 'per':
|
||||
# company_contrib = (amount * line.category_id.contribute_per)
|
||||
|
||||
narration = """Company Contribution of %s Encode same as a Company Expanse @ %s""" % (line.name, company_contrib)
|
||||
move = {
|
||||
#'name': slip.name,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'date': slip.date,
|
||||
'ref':slip.number,
|
||||
'narration': narration
|
||||
}
|
||||
company_contrib_move_id = move_pool.create(cr, uid, move)
|
||||
name = "[%s] - %s / %s - Company Contribution" % (line.code, line.name, slip.employee_id.name)
|
||||
self.create_voucher(cr, uid, [slip.id], name, company_contrib_move_id)
|
||||
|
||||
ded_deb = {
|
||||
'move_id':company_contrib_move_id,
|
||||
'name': name,
|
||||
'date': slip.date,
|
||||
'quantity':1,
|
||||
'account_id': line.category_id.account_id.id,
|
||||
'debit': company_contrib,
|
||||
'credit' : 0.0,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_deb)]
|
||||
ded_cre = {
|
||||
'move_id':company_contrib_move_id,
|
||||
'name': name,
|
||||
'date': slip.date,
|
||||
'quantity':1,
|
||||
'account_id': line.category_id.register_id.account_id.id,
|
||||
'debit': 0.0,
|
||||
'credit' : company_contrib,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_cre)]
|
||||
|
||||
if line.category_id.include_in_salary:
|
||||
narration = """Company Contribution of %s Deducted from Employee %s""" % (line.name, company_contrib)
|
||||
move = {
|
||||
#'name': slip.name,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'date': slip.date,
|
||||
'ref':slip.number,
|
||||
'narration': narration
|
||||
}
|
||||
include_in_salary_move_id = move_pool.create(cr, uid, move)
|
||||
self.create_voucher(cr, uid, [slip.id], narration, include_in_salary_move_id)
|
||||
|
||||
total_deduct += company_contrib
|
||||
ded_deb = {
|
||||
'move_id':include_in_salary_move_id,
|
||||
'name': name,
|
||||
'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'quantity':1,
|
||||
'account_id': partner.property_account_receivable.id,
|
||||
'debit': company_contrib,
|
||||
'credit' : 0.0,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_deb)]
|
||||
ded_cre = {
|
||||
'move_id':include_in_salary_move_id,
|
||||
'name': name,
|
||||
'date': slip.date,
|
||||
'quantity':1,
|
||||
'account_id': line.category_id.account_id.id,
|
||||
'debit': 0.0,
|
||||
'credit' : company_contrib,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_cre)]
|
||||
|
||||
#make an entry line to contribution register
|
||||
if line.category_id.register_id:
|
||||
ctr = {
|
||||
'register_id':line.category_id.register_id.id,
|
||||
'name':line.name,
|
||||
'code':line.code,
|
||||
'employee_id':slip.employee_id.id,
|
||||
'period_id':period_id,
|
||||
'emp_deduction':amount,
|
||||
}
|
||||
if line.category_id.contribute:
|
||||
ctr['comp_deduction'] = amount
|
||||
|
||||
company = 0.0
|
||||
employee = 0.0
|
||||
if line.category_id.contribute and line.category_id.include_in_salary and line.category_id.amount_type == 'per':
|
||||
new_amount = (amount * (line.category_id.contribute_per / (1+line.category_id.contribute_per)))
|
||||
company = new_amount
|
||||
employee = amount - company
|
||||
|
||||
elif line.category_id.contribute and line.category_id.include_in_salary and line.category_id.amount_type == 'fix':
|
||||
company = line.category_id.contribute_per
|
||||
employee = amount - company
|
||||
|
||||
elif line.category_id.contribute and line.category_id.include_in_salary and line.category_id.amount_type == 'func':
|
||||
company = self.pool.get('hr.allounce.deduction.categoty').execute_function(cr, uid, line.category_id.id, line.slip_id.basic, context)
|
||||
employee = amount
|
||||
|
||||
elif line.category_id.contribute and not line.category_id.include_in_salary and line.category_id.amount_type == 'per':
|
||||
company = amount * line.category_id.contribute_per
|
||||
employee = amount
|
||||
|
||||
elif line.category_id.contribute and not line.category_id.include_in_salary and line.category_id.amount_type == 'fix':
|
||||
company = line.category_id.contribute_per
|
||||
employee = amount
|
||||
|
||||
elif line.category_id.contribute and not line.category_id.include_in_salary and line.category_id.amount_type == 'func':
|
||||
company = self.pool.get('hr.allounce.deduction.categoty').execute_function(cr, uid, line.category_id.id, line.slip_id.basic, context)
|
||||
employee = amount
|
||||
|
||||
ctr['emp_deduction'] = employee
|
||||
ctr['comp_deduction'] = company
|
||||
|
||||
self.pool.get('hr.contibution.register.line').create(cr, uid, ctr)
|
||||
|
||||
adj_move_id = False
|
||||
if total_deduct > 0:
|
||||
move = {
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'date': slip.date,
|
||||
'ref':slip.number,
|
||||
'narration': 'Adjustment : %s' % (slip.name)
|
||||
}
|
||||
adj_move_id = move_pool.create(cr, uid, move)
|
||||
name = "Adjustment Entry - %s" % (slip.employee_id.name)
|
||||
self.create_voucher(cr, uid, [slip.id], name, adj_move_id)
|
||||
|
||||
ded_rec = {
|
||||
'move_id':adj_move_id,
|
||||
'name': name,
|
||||
'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'account_id': partner.property_account_receivable.id,
|
||||
'debit': 0.0,
|
||||
'quantity':1,
|
||||
'credit' : total_deduct,
|
||||
'journal_id' : slip.journal_id.id,
|
||||
'period_id' :period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_rec)]
|
||||
cre_rec = {
|
||||
'move_id':adj_move_id,
|
||||
'name': name,
|
||||
'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'account_id': partner.property_account_payable.id,
|
||||
'debit': total_deduct,
|
||||
'quantity':1,
|
||||
'credit' : 0.0,
|
||||
'journal_id' : slip.journal_id.id,
|
||||
'period_id' :period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, cre_rec)]
|
||||
|
||||
rec = {
|
||||
'state':'confirm',
|
||||
'move_line_ids':[(6, 0,line_ids)],
|
||||
}
|
||||
if not slip.period_id:
|
||||
rec['period_id'] = period_id
|
||||
|
||||
dates = prev_bounds(slip.date)
|
||||
exp_ids = exp_pool.search(cr, uid, [('date_valid','>=',dates[0]), ('date_valid','<=',dates[1]), ('state','=','invoiced')])
|
||||
if exp_ids:
|
||||
acc = self.pool.get('ir.property').get(cr, uid, 'property_account_expense_categ', 'product.category')
|
||||
for exp in exp_pool.browse(cr, uid, exp_ids):
|
||||
exp_res = {
|
||||
'name':exp.name,
|
||||
'amount_type':'fix',
|
||||
'type':'otherpay',
|
||||
'category_id':exp.category_id.id,
|
||||
'amount':exp.amount,
|
||||
'slip_id':slip.id,
|
||||
'expanse_id':exp.id,
|
||||
'account_id':acc
|
||||
}
|
||||
self.pool.get('hr.payslip.line').create(cr, uid, exp_res)
|
||||
|
||||
self.write(cr, uid, [slip.id], rec)
|
||||
|
||||
|
||||
def process_sheet(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'done'})
|
||||
return True
|
||||
|
||||
|
||||
def verify_sheet(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'confirm'})
|
||||
return True
|
||||
|
||||
def get_contract(self, cr, uid, employee, date, context={}):
|
||||
sql_req= '''
|
||||
SELECT c.id as id, c.wage as wage, struct_id as function
|
||||
|
@ -1530,6 +976,7 @@ class hr_payslip(osv.osv):
|
|||
else:
|
||||
if line.amount_type in ('fix', 'per'):
|
||||
value = line.amount
|
||||
|
||||
elif line.amount_type == 'func':
|
||||
value = self.pool.get('hr.payslip.line').execute_function(cr, uid, line.id, amt, context)
|
||||
line.amount = value
|
||||
|
@ -1549,7 +996,7 @@ class hr_payslip(osv.osv):
|
|||
'base':base
|
||||
}
|
||||
slip_line_pool.copy(cr, uid, line.id, vals, {})
|
||||
|
||||
|
||||
if sal_type in ('gross', 'net'):
|
||||
sal = contract.wage
|
||||
if sal_type == 'net':
|
||||
|
@ -1830,6 +1277,7 @@ class hr_employee(osv.osv):
|
|||
'hospital_id':fields.many2one('res.partner.address', 'ESI Hospital', required=False),
|
||||
'passport_id':fields.many2one('hr.passport', 'Passport', required=False),
|
||||
'otherid':fields.char('Other Id', size=64, required=False),
|
||||
'bank_account_id':fields.many2one('res.partner.bank', 'Bank Account', required=False, readonly=False),
|
||||
'line_ids':fields.one2many('hr.payslip.line', 'employee_id', 'Salary Structure', required=False),
|
||||
'slip_ids':fields.one2many('hr.payslip', 'employee_id', 'Payslips', required=False, readonly=True),
|
||||
'property_bank_account': fields.property(
|
||||
|
@ -1871,4 +1319,4 @@ class hr_employee(osv.osv):
|
|||
}
|
||||
hr_employee()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="hr_passport_tree" model="ir.ui.view">
|
||||
<record id="hr_passport_tree" model="ir.ui.view">
|
||||
<field name="name">hr.passport.tree</field>
|
||||
<field name="model">hr.passport</field>
|
||||
<field name="type">tree</field>
|
||||
|
@ -55,8 +55,8 @@
|
|||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_hr_passport_filter" model="ir.ui.view">
|
||||
|
||||
<record id="view_hr_passport_filter" model="ir.ui.view">
|
||||
<field name="name">hr.passport.select</field>
|
||||
<field name="model">hr.passport</field>
|
||||
<field name="type">search</field>
|
||||
|
@ -159,7 +159,8 @@
|
|||
<group colspan="2" col="2">
|
||||
<separator string="Personal Info" colspan="2"/>
|
||||
<field name="pan_no" select="1"/>
|
||||
<field name="bank_account"/>
|
||||
<!-- <field name="bank_account"/>-->
|
||||
<field name="bank_account_id"/>
|
||||
<field name="place_of_birth"/>
|
||||
<field name="children"/>
|
||||
</group>
|
||||
|
@ -494,6 +495,7 @@
|
|||
<field name="deg_id"/>
|
||||
<field name="contract_id" domain="[('employee_id','=',employee_id)]"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<separator colspan="4" string="Description"/>
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
|
@ -503,10 +505,9 @@
|
|||
<button string="Compute Sheet" icon="terp-stock_format-scientific" name="compute_sheet" states="new"/>
|
||||
<button string="Recompute Sheet" icon="terp-stock_format-scientific" name="compute_sheet" type="object" states="draft"/>
|
||||
<button string="Verify Sheet" icon="terp-camera_test" name="verify_sheet" states="draft"/>
|
||||
<button string="Complete HR Checking" icon="terp-camera_test" name="verify_twice_sheet" states="hr_check"/>
|
||||
<button string="Complete Accountant Checking" icon="terp-camera_test" name="final_verify_sheet" states="accont_check"/>
|
||||
<button string="Complete HR Checking" icon="terp-camera_test" name="final_verify_sheet" states="hr_check"/>
|
||||
<button string="Pay Salary" icon="terp-dolar_ok!" name="process_sheet" states="confirm"/>
|
||||
<button string="Cancel" icon="terp-dialog-close" name="cancel_sheet" states="draft,hr_check,accont_check,confirm"/>
|
||||
<button string="Cancel" icon="terp-dialog-close" name="cancel_sheet" states="draft,hr_check,confirm"/>
|
||||
<button string="Set to Draft" icon="terp-stock_effects-object-colorize" name="set_to_draft" states="cancel"/>
|
||||
</group>
|
||||
</form>
|
||||
|
@ -561,8 +562,11 @@
|
|||
<field name="code" select="1"/>
|
||||
<field name="type" select="1"/>
|
||||
<group col="2" colspan="4">
|
||||
<separator colspan="4" string="Based on"/>
|
||||
<field name="base" colspan="4" nolabel="1"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="4" string="Dynamic Computation"/>
|
||||
<field name="base"/>
|
||||
<field name="condition"/>
|
||||
<field name="sequence"/>
|
||||
</group>
|
||||
|
@ -571,6 +575,9 @@
|
|||
<page string="Description">
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Contribution">
|
||||
<field name="contribute_ids" colspan="4" nolabel="1" height="300"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
|
@ -900,8 +907,7 @@
|
|||
<field name="state"/>
|
||||
<button string="Compute" name="compute_sheet" states="new" icon="terp-document-new" type="object"/>
|
||||
<button string="Verify Sheet" icon="gtk-ok" name="verify_sheet" states="draft" type="object"/>
|
||||
<button string="Complete HR Checking" icon="gtk-apply" name="verify_twice_sheet" type="object" states="hr_check"/>
|
||||
<button string="Complete Accountant Checking" icon="gtk-apply" name="final_verify_sheet" states="accont_check" type="object"/>
|
||||
<button string="Complete HR Checking" icon="gtk-apply" name="final_verify_sheet" type="object" states="hr_check"/>
|
||||
<button string="Pay Salary" icon="gtk-apply" name="process_sheet" states="confirm" type="object" />
|
||||
<button string="Cancel" name="cancel_sheet" icon="gtk-cancel" states="draft,hr_check,accont_check,confirm" type="object"/>
|
||||
<button string="Set to Draft" name="set_to_draft" states="cancel" type="object" icon="gtk-convert" />
|
||||
|
|
|
@ -28,13 +28,6 @@
|
|||
<field name="kind">function</field>
|
||||
</record>
|
||||
|
||||
<record id="act_account_check" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf"/>
|
||||
<field name="name">account_check</field>
|
||||
<field name="action">account_check_sheet()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
|
||||
<record id="act_confirm" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf"/>
|
||||
<field name="name">confirm</field>
|
||||
|
@ -66,30 +59,16 @@
|
|||
<record id="t2" model="workflow.transition">
|
||||
<field name="act_from" ref="act_draft"/>
|
||||
<field name="act_to" ref="act_hr_check"/>
|
||||
<field name="condition">basic>=10000</field>
|
||||
<field name="signal">verify_sheet</field>
|
||||
</record>
|
||||
|
||||
<record id="t3" model="workflow.transition">
|
||||
<field name="act_from" ref="act_hr_check"/>
|
||||
<field name="act_to" ref="act_account_check"/>
|
||||
<field name="signal">verify_twice_sheet</field>
|
||||
</record>
|
||||
|
||||
<record id="t4" model="workflow.transition">
|
||||
<field name="act_from" ref="act_draft"/>
|
||||
<field name="act_to" ref="act_account_check"/>
|
||||
<field name="condition">basic<10000</field>
|
||||
<field name="signal">verify_sheet</field>
|
||||
</record>
|
||||
|
||||
<record id="t5" model="workflow.transition">
|
||||
<field name="act_from" ref="act_account_check"/>
|
||||
<field name="act_to" ref="act_confirm"/>
|
||||
<field name="signal">final_verify_sheet</field>
|
||||
</record>
|
||||
|
||||
<record id="t6" model="workflow.transition">
|
||||
<record id="t4" model="workflow.transition">
|
||||
<field name="act_from" ref="act_confirm"/>
|
||||
<field name="act_to" ref="act_done"/>
|
||||
<field name="signal">process_sheet</field>
|
||||
|
@ -108,12 +87,6 @@
|
|||
</record>
|
||||
|
||||
<record id="t9" model="workflow.transition">
|
||||
<field name="act_from" ref="act_account_check"/>
|
||||
<field name="act_to" ref="act_cancel"/>
|
||||
<field name="signal">cancel_sheet</field>
|
||||
</record>
|
||||
|
||||
<record id="t10" model="workflow.transition">
|
||||
<field name="act_from" ref="act_confirm"/>
|
||||
<field name="act_to" ref="act_cancel"/>
|
||||
<field name="signal">cancel_sheet</field>
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
],
|
||||
'update_xml': [
|
||||
"hr_payroll_account_view.xml",
|
||||
"hr_payroll_account_workflow.xml"
|
||||
],
|
||||
'demo_xml': [
|
||||
],
|
||||
|
|
|
@ -70,23 +70,18 @@ class hr_payslip(osv.osv):
|
|||
|
||||
def cancel_sheet(self, cr, uid, ids, context={}):
|
||||
move_pool = self.pool.get('account.move')
|
||||
|
||||
slip_move = self.pool.get('hr.payslip.account.move')
|
||||
|
||||
move_ids = []
|
||||
for slip in self.browse(cr, uid, ids, context):
|
||||
if slip.move_id:
|
||||
if slip.move_id.state == 'posted':
|
||||
move_pool.button_cancel(cr, uid [slip.move_id.id], context)
|
||||
move_pool.unlink(cr, uid, [slip.move_id.id])
|
||||
|
||||
if slip.adj_move_id:
|
||||
if slip.adj_move_id.state == 'posted':
|
||||
move_pool.button_cancel(cr, uid [slip.adj_move_id.id], context)
|
||||
move_pool.unlink(cr, uid, [slip.adj_move_id.id])
|
||||
|
||||
if slip.other_move_id:
|
||||
if slip.other_move_id.state == 'posted':
|
||||
move_pool.button_cancel(cr, uid [slip.other_move_id.id], context)
|
||||
move_pool.unlink(cr, uid, [slip.other_move_id.id])
|
||||
|
||||
for line in slip.move_ids:
|
||||
move_ids.append(line.id)
|
||||
if line.move_id:
|
||||
if line.move_id.state == 'posted':
|
||||
move_pool.button_cancel(cr, uid [line.move_id.id], context)
|
||||
move_pool.unlink(cr, uid, [line.move_id.id])
|
||||
|
||||
slip_move.unlink(cr, uid, move_ids)
|
||||
self.write(cr, uid, ids, {'state':'cancel'})
|
||||
return True
|
||||
|
||||
|
@ -358,7 +353,7 @@ class hr_payslip(osv.osv):
|
|||
else:
|
||||
rec['analytic_account_id'] = slip.deg_id.account_id.id
|
||||
|
||||
if line.type == 'allounce' or line.type == 'otherpay':
|
||||
if line.type == 'allowance' or line.type == 'otherpay':
|
||||
rec['debit'] = amount
|
||||
if not partner.property_account_payable:
|
||||
raise osv.except_osv(_('Integrity Error !'), _('Please Configure Partners Payable Account!!'))
|
||||
|
@ -398,92 +393,92 @@ class hr_payslip(osv.osv):
|
|||
|
||||
line_ids += [movel_pool.create(cr, uid, rec)]
|
||||
|
||||
if line.company_contrib > 0:
|
||||
company_contrib = line.company_contrib
|
||||
# if line.category_id.amount_type == 'per':
|
||||
# company_contrib = (amount * line.category_id.contribute_per)
|
||||
# if line.company_contrib > 0:
|
||||
# company_contrib = line.company_contrib
|
||||
## if line.category_id.amount_type == 'per':
|
||||
## company_contrib = (amount * line.category_id.contribute_per)
|
||||
|
||||
narration = """Company Contribution of %s Encode same as a Company Expanse @ %s""" % (line.name, company_contrib)
|
||||
move = {
|
||||
#'name': slip.name,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'date': slip.date,
|
||||
'ref':slip.number,
|
||||
'narration': narration
|
||||
}
|
||||
company_contrib_move_id = move_pool.create(cr, uid, move)
|
||||
name = "[%s] - %s / %s - Company Contribution" % (line.code, line.name, slip.employee_id.name)
|
||||
self.create_voucher(cr, uid, [slip.id], name, company_contrib_move_id)
|
||||
|
||||
ded_deb = {
|
||||
'move_id':company_contrib_move_id,
|
||||
'name': name,
|
||||
'date': slip.date,
|
||||
'quantity':1,
|
||||
'account_id': line.category_id.account_id.id,
|
||||
'debit': company_contrib,
|
||||
'credit' : 0.0,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_deb)]
|
||||
ded_cre = {
|
||||
'move_id':company_contrib_move_id,
|
||||
'name': name,
|
||||
'date': slip.date,
|
||||
'quantity':1,
|
||||
'account_id': line.category_id.register_id.account_id.id,
|
||||
'debit': 0.0,
|
||||
'credit' : company_contrib,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_cre)]
|
||||
|
||||
if line.category_id.include_in_salary:
|
||||
narration = """Company Contribution of %s Deducted from Employee %s""" % (line.name, company_contrib)
|
||||
move = {
|
||||
#'name': slip.name,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'date': slip.date,
|
||||
'ref':slip.number,
|
||||
'narration': narration
|
||||
}
|
||||
include_in_salary_move_id = move_pool.create(cr, uid, move)
|
||||
self.create_voucher(cr, uid, [slip.id], narration, include_in_salary_move_id)
|
||||
|
||||
total_deduct += company_contrib
|
||||
ded_deb = {
|
||||
'move_id':include_in_salary_move_id,
|
||||
'name': name,
|
||||
'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'quantity':1,
|
||||
'account_id': partner.property_account_receivable.id,
|
||||
'debit': company_contrib,
|
||||
'credit' : 0.0,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_deb)]
|
||||
ded_cre = {
|
||||
'move_id':include_in_salary_move_id,
|
||||
'name': name,
|
||||
'date': slip.date,
|
||||
'quantity':1,
|
||||
'account_id': line.category_id.account_id.id,
|
||||
'debit': 0.0,
|
||||
'credit' : company_contrib,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_cre)]
|
||||
# narration = """Company Contribution of %s Encode same as a Company Expanse @ %s""" % (line.name, company_contrib)
|
||||
# move = {
|
||||
# #'name': slip.name,
|
||||
# 'journal_id': slip.journal_id.id,
|
||||
# 'period_id': period_id,
|
||||
# 'date': slip.date,
|
||||
# 'ref':slip.number,
|
||||
# 'narration': narration
|
||||
# }
|
||||
# company_contrib_move_id = move_pool.create(cr, uid, move)
|
||||
# name = "[%s] - %s / %s - Company Contribution" % (line.code, line.name, slip.employee_id.name)
|
||||
# self.create_voucher(cr, uid, [slip.id], name, company_contrib_move_id)
|
||||
#
|
||||
# ded_deb = {
|
||||
# 'move_id':company_contrib_move_id,
|
||||
# 'name': name,
|
||||
# 'date': slip.date,
|
||||
# 'quantity':1,
|
||||
# 'account_id': line.category_id.account_id.id,
|
||||
# 'debit': company_contrib,
|
||||
# 'credit' : 0.0,
|
||||
# 'journal_id': slip.journal_id.id,
|
||||
# 'period_id': period_id,
|
||||
# 'ref':slip.number
|
||||
# }
|
||||
# line_ids += [movel_pool.create(cr, uid, ded_deb)]
|
||||
# ded_cre = {
|
||||
# 'move_id':company_contrib_move_id,
|
||||
# 'name': name,
|
||||
# 'date': slip.date,
|
||||
# 'quantity':1,
|
||||
# 'account_id': line.category_id.register_id.account_id.id,
|
||||
# 'debit': 0.0,
|
||||
# 'credit' : company_contrib,
|
||||
# 'journal_id': slip.journal_id.id,
|
||||
# 'period_id': period_id,
|
||||
# 'ref':slip.number
|
||||
# }
|
||||
# line_ids += [movel_pool.create(cr, uid, ded_cre)]
|
||||
#
|
||||
# if line.category_id.include_in_salary:
|
||||
# narration = """Company Contribution of %s Deducted from Employee %s""" % (line.name, company_contrib)
|
||||
# move = {
|
||||
# #'name': slip.name,
|
||||
# 'journal_id': slip.journal_id.id,
|
||||
# 'period_id': period_id,
|
||||
# 'date': slip.date,
|
||||
# 'ref':slip.number,
|
||||
# 'narration': narration
|
||||
# }
|
||||
# include_in_salary_move_id = move_pool.create(cr, uid, move)
|
||||
# self.create_voucher(cr, uid, [slip.id], narration, include_in_salary_move_id)
|
||||
#
|
||||
# total_deduct += company_contrib
|
||||
# ded_deb = {
|
||||
# 'move_id':include_in_salary_move_id,
|
||||
# 'name': name,
|
||||
# 'partner_id': partner_id,
|
||||
# 'date': slip.date,
|
||||
# 'quantity':1,
|
||||
# 'account_id': partner.property_account_receivable.id,
|
||||
# 'debit': company_contrib,
|
||||
# 'credit' : 0.0,
|
||||
# 'journal_id': slip.journal_id.id,
|
||||
# 'period_id': period_id,
|
||||
# 'ref':slip.number
|
||||
# }
|
||||
# line_ids += [movel_pool.create(cr, uid, ded_deb)]
|
||||
# ded_cre = {
|
||||
# 'move_id':include_in_salary_move_id,
|
||||
# 'name': name,
|
||||
# 'date': slip.date,
|
||||
# 'quantity':1,
|
||||
# 'account_id': line.category_id.account_id.id,
|
||||
# 'debit': 0.0,
|
||||
# 'credit' : company_contrib,
|
||||
# 'journal_id': slip.journal_id.id,
|
||||
# 'period_id': period_id,
|
||||
# 'ref':slip.number
|
||||
# }
|
||||
# line_ids += [movel_pool.create(cr, uid, ded_cre)]
|
||||
|
||||
#make an entry line to contribution register
|
||||
# if line.category_id.register_id:
|
||||
|
|
|
@ -9,23 +9,17 @@
|
|||
<field name="kind">function</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_payroll.t2" model="workflow.transition">
|
||||
<field name="act_from" ref="hr_payroll.act_draft"/>
|
||||
<field name="act_to" ref="hr_payroll.act_hr_check"/>
|
||||
<record id="hr_payroll.t4" model="workflow.transition">
|
||||
<field name="act_from" ref="hr_payroll.act_confirm"/>
|
||||
<field name="act_to" ref="act_account_check"/>
|
||||
<field name="condition">True</field>
|
||||
<field name="signal">verify_sheet</field>
|
||||
<field name="signal">account_verify_sheet</field>
|
||||
</record>
|
||||
|
||||
<record id="t3" model="workflow.transition">
|
||||
<field name="act_from" ref="hr_payroll.act_hr_check"/>
|
||||
<field name="act_to" ref="act_account_check"/>
|
||||
<field name="condition">True</field>
|
||||
<field name="signal">verify_twice_sheet</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_payroll.t5" model="workflow.transition">
|
||||
<field name="act_from" ref="act_account_check"/>
|
||||
<field name="act_to" ref="hr_payroll.act_confirm"/>
|
||||
<field name="act_to" ref="hr_payroll.act_done"/>
|
||||
<field name="condition">True</field>
|
||||
<field name="signal">final_verify_sheet</field>
|
||||
</record>
|
||||
|
||||
|
|
Loading…
Reference in New Issue