mirror of
https://gitlab.com/datalifeit/trytond-staff_profile
synced 2023-12-14 04:32:57 +01:00
parent
d249fdab7d
commit
9869ed4bf5
1 changed files with 6 additions and 3 deletions
|
@ -64,7 +64,7 @@ class Employee(metaclass=PoolMeta):
|
|||
payroll_date = Transaction().context.get('date', None)
|
||||
return self.compute_payroll_price(payroll_date)
|
||||
|
||||
def get_employee_prices(self):
|
||||
def get_employee_prices(self, date=None):
|
||||
pool = Pool()
|
||||
if not self.profile:
|
||||
return 0
|
||||
|
@ -73,6 +73,9 @@ class Employee(metaclass=PoolMeta):
|
|||
('profile', '=', self.profile),
|
||||
], order=[('date', 'ASC')])
|
||||
|
||||
return self.get_payroll_employee_costs(payroll_prices, date)
|
||||
|
||||
def get_payroll_employee_costs(self, payroll_prices, date=None):
|
||||
employee_costs = []
|
||||
for payroll_price in payroll_prices:
|
||||
employee_costs.append(
|
||||
|
@ -91,7 +94,7 @@ class Employee(metaclass=PoolMeta):
|
|||
date = Date.today()
|
||||
|
||||
if self.profile:
|
||||
employee_prices = self.get_employee_prices()
|
||||
employee_prices = self.get_employee_prices(date)
|
||||
|
||||
if employee_prices and date >= employee_prices[0][0]:
|
||||
for profile_edate, eprice, _ in employee_prices:
|
||||
|
@ -121,7 +124,7 @@ class Employee(metaclass=PoolMeta):
|
|||
date = Date.today()
|
||||
|
||||
if self.profile:
|
||||
employee_prices = self.get_employee_prices()
|
||||
employee_prices = self.get_employee_prices(date)
|
||||
|
||||
# compute the cost price for the given date
|
||||
if employee_prices and date >= employee_prices[0][0]:
|
||||
|
|
Loading…
Reference in a new issue