minor fix
This commit is contained in:
parent
a3d0fde0b6
commit
0d114e0146
12
payroll.py
12
payroll.py
|
@ -1808,13 +1808,15 @@ class Exo2276Report(Report):
|
|||
pag_wage = WageType.search_read([
|
||||
('type_concept', 'in', [
|
||||
'unemployment', 'interest', 'holidays']),
|
||||
], fields_names=['credit_account', 'type_concept'])
|
||||
], fields_names=['credit_account', 'type_concept', 'debit_account'])
|
||||
|
||||
accounts_id = {'cesanpag': [], 'holidays': []}
|
||||
for p in pag_wage:
|
||||
if p['type_concept'] in ('unemployment', 'interest'):
|
||||
accounts_id['cesanpag'].append(p['credit_account'])
|
||||
accounts_id['cesanpag'].append(p['debit_account'])
|
||||
else:
|
||||
accounts_id['holidays'].append(p['debit_account'])
|
||||
accounts_id['holidays'].append(p['credit_account'])
|
||||
|
||||
# accounts_id_c = ['cesanpagp':['credit_account'] for p in pag_wage]
|
||||
|
@ -1887,13 +1889,13 @@ class Exo2276Report(Report):
|
|||
('move.date', '<=', data['end_period']),
|
||||
('account', 'in',
|
||||
accounts_id['cesanpag']+accounts_id['holidays']),
|
||||
('debit', '>', 0),
|
||||
], fields_names=['debit', 'move', 'account'])
|
||||
# ('debit', '>', 0),
|
||||
], fields_names=['debit', 'credit', 'move', 'account'])
|
||||
if lines_liquid:
|
||||
_cesanpag = sum(
|
||||
[l['debit'] for l in lines_liquid if l['account'] in accounts_id['cesanpag']])
|
||||
[abs(l['debit']-l['credit']) for l in lines_liquid if l['account'] in accounts_id['cesanpag']])
|
||||
_holidays = sum(
|
||||
[l['debit'] for l in lines_liquid if l['account'] in accounts_id['holidays']])
|
||||
[abs(l['debit']-l['credit']) for l in lines_liquid if l['account'] in accounts_id['holidays']])
|
||||
new_objects[party.id]['cesanpag'] = _cesanpag
|
||||
new_objects[party.id]['holidays'] = _holidays
|
||||
|
||||
|
|
Loading…
Reference in New Issue