mirror of
https://bitbucket.org/presik/trytonpsk-staff_payroll_co.git
synced 2023-12-14 06:42:56 +01:00
minor fix create line payrolls
This commit is contained in:
parent
e44b3cafaa
commit
fba19a8b52
1 changed files with 12 additions and 1 deletions
13
payroll.py
13
payroll.py
|
@ -332,7 +332,8 @@ class Payroll(metaclass=PoolMeta):
|
|||
])
|
||||
lines_to_reconcile = []
|
||||
values = []
|
||||
if line.wage_type.type_concept == 'holidays':
|
||||
res = self.validate_wage_type(line, concept='holidays')
|
||||
if res == 'holidays':
|
||||
amount = line.amount
|
||||
for m in move_lines:
|
||||
values.append(abs(m.debit - m.credit))
|
||||
|
@ -353,6 +354,16 @@ class Payroll(metaclass=PoolMeta):
|
|||
'move_lines': [('add', lines_to_reconcile)]
|
||||
})
|
||||
|
||||
def validate_wage_type(self, line, concept=None):
|
||||
if concept == 'holidays':
|
||||
Event = Pool().get('staff.event')
|
||||
event, = Event.search([
|
||||
('employee', '=', self.employee),
|
||||
('state', '=', 'done'),
|
||||
('line_payroll', '=', line.id)
|
||||
])
|
||||
return 'holidays'
|
||||
|
||||
def search_salary_month(self, wage):
|
||||
res = _ZERO
|
||||
payrolls = self._get_payrolls_month()
|
||||
|
|
Loading…
Reference in a new issue