Compare commits

...

2 Commits

Author SHA1 Message Date
Wilson Gomez 3a37eceaef minor fix 2023-09-21 09:32:35 -05:00
Wilson Gomez b3806af9d4 fix sorted global report
fix get liquidation
2023-09-21 09:30:19 -05:00
3 changed files with 20 additions and 16 deletions

Binary file not shown.

View File

@ -531,16 +531,21 @@ class Liquidation(Workflow, ModelSQL, ModelView):
('account', '=', account_id),
('party', '=', employee.party.id),
('reconciliation', '=', None),
('move.origin', 'not ilike', 'staff.payroll'),
('move.origin', '=', None),
]
lines1 = MoveLine.search(domain)
lines2 = []
if moves:
domain.append(
[
'OR',
('move', 'in', moves),
('move.origin', 'not ilike', 'staff.payroll'),
('move.origin', '=', None),
])
lines = MoveLine.search(domain)
domain = [
('credit', '>', 0),
('account', '=', account_id),
('party', '=', employee.party.id),
('reconciliation', '=', None),
('move', 'in', moves),
]
lines2 = MoveLine.search(domain)
lines = set(lines1 + lines2)
return lines
@classmethod
@ -574,15 +579,17 @@ class Liquidation(Workflow, ModelSQL, ModelView):
for payroll in payrolls:
for l in payroll.lines:
wage = l.wage_type
if l.wage_type.contract_finish or l.wage_type.provision_cancellation:
if l.wage_type.provision_cancellation and not l.wage_type.contract_finish:
wage = l.wage_type.provision_cancellation
print(wage, wage.contract_finish, wage.provision_cancellation, self.kind, 'asasdasd')
if wage.contract_finish or wage.provision_cancellation:
if wage.provision_cancellation and not wage.contract_finish:
wage = wage.provision_cancellation
if self.kind == 'contract':
print(wage.type_concept, 'validate2323')
if wage.type_concept not in CONTRACT:
continue
elif self.kind != wage.type_concept:
continue
print('va a buscar')
if wage.id not in wages_target.keys():
mlines = self.get_moves_lines_pending(
payroll.employee, wage, date_end, moves

View File

@ -1185,10 +1185,7 @@ class PayrollGlobalReport(Report):
sum_total_deductions.append(payroll.total_deductions)
sum_net_payment.append(payroll.net_payment)
employee_dict = {e['employee_id_number']: e for e in parties.values()}
report_context['records'] = sorted(
employee_dict.items(), key=lambda t: t[0])
report_context['records'] = sorted(parties.values(), key=lambda x: x['employee'])
report_context['department'] = department
report_context['periods_number'] = periods_number
report_context['start_period'] = start_period