minor fix

This commit is contained in:
Wilson Gomez 2023-09-15 17:43:35 -05:00
parent fdef50d8e5
commit a90861773f
1 changed files with 19 additions and 17 deletions

View File

@ -573,25 +573,27 @@ class Liquidation(Workflow, ModelSQL, ModelView):
moves = [p.move.id for p in payrolls]
for payroll in payrolls:
for l in payroll.lines:
if not l.wage_type.contract_finish and not l.wage_type.provision_cancellation:
continue
if self.kind == 'contract':
if l.wage_type.type_concept not in CONTRACT:
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
if self.kind == 'contract':
if wage.type_concept not in CONTRACT:
continue
elif self.kind != wage.type_concept:
continue
elif self.kind != l.wage_type.type_concept:
continue
if l.wage_type.id not in wages_target.keys():
mlines = self.get_moves_lines_pending(
payroll.employee, l.wage_type, date_end, moves
)
if not mlines:
continue
wages_target[l.wage_type.id] = [
l.wage_type.credit_account.id,
mlines,
l.wage_type,
]
if wage.id not in wages_target.keys():
mlines = self.get_moves_lines_pending(
payroll.employee, wage, date_end, moves
)
if not mlines:
continue
wages_target[wage.id] = [
wage.credit_account.id,
mlines,
wage,
]
for (account_id, lines, wage_type) in wages_target.values():
values = []