mirror of
https://bitbucket.org/presik/trytonpsk-staff_payroll_co.git
synced 2023-12-14 06:42:56 +01:00
minor changes
This commit is contained in:
parent
4eda2ea480
commit
5193fcfe85
27
payroll.py
27
payroll.py
|
@ -1934,27 +1934,40 @@ class PayrollExportReport(Report):
|
|||
"""Check account code in dict account debit and party"""
|
||||
if not line.party:
|
||||
continue
|
||||
line_ = {
|
||||
'date': line.move.date,
|
||||
'code': '---',
|
||||
'party': employee.party.id_number,
|
||||
'description': line.description,
|
||||
'department': employee.department.name if employee.department else '---',
|
||||
'amount': line.amount,
|
||||
'type': 'D',
|
||||
}
|
||||
if line.debit > 0:
|
||||
if line.account.id in accountdb_ids:
|
||||
line.party = accdb_party[line.account.id]
|
||||
id_number = accdb_party[line.account.id].id_number
|
||||
else:
|
||||
print(line.account.code, line.party.name)
|
||||
id_number = line.party.id_number
|
||||
id_number = None
|
||||
print('------------>', line.account.code, line.party.name)
|
||||
|
||||
if id_number in ENTITY_ACCOUNTS.keys():
|
||||
print('debit ------------->', id_number)
|
||||
line.account.code = ENTITY_ACCOUNTS[id_number][1]
|
||||
line_['code'] = ENTITY_ACCOUNTS[id_number][1]
|
||||
else:
|
||||
line_['code'] = line.account.code
|
||||
else:
|
||||
line_['type'] = 'C'
|
||||
id_number = line.party.id_number
|
||||
if id_number in ENTITY_ACCOUNTS.keys():
|
||||
line.account.code = ENTITY_ACCOUNTS[id_number][0]
|
||||
line_['code'] = ENTITY_ACCOUNTS[id_number][0]
|
||||
else:
|
||||
line_['code'] = line.account.code
|
||||
|
||||
if line.account.code not in records.keys():
|
||||
records[line.account.code] = {
|
||||
'name': line.account.name,
|
||||
'lines': []
|
||||
}
|
||||
records[line.account.code]['lines'].append(line)
|
||||
records[line.account.code]['lines'].append(line_)
|
||||
|
||||
report_context['records'] = records
|
||||
report_context['start_date'] = start_period.name
|
||||
|
|
Loading…
Reference in a new issue