add amount to pay in get_events

This commit is contained in:
Camilo Sarmiento 2020-05-13 18:21:22 -05:00
parent 07f7dacfb1
commit 7b344e271e
1 changed files with 4 additions and 1 deletions

View File

@ -314,7 +314,10 @@ class Payroll(metaclass=PoolMeta):
qty_pay = event.quantity_pay
wage = event.category.wage_type
salary_args = self.get_salary_full(wage)
unit_value = wage.compute_unit_price(salary_args)
if event.amount_to_pay:
unit_value = Decimal(event.amount_to_pay)
else:
unit_value = wage.compute_unit_price(salary_args)
res = self.get_line(wage, qty_pay, unit_value)
events_lines_to_create.append(res)