minor fix
This commit is contained in:
parent
b82a559929
commit
bac3c9fd65
|
@ -179,6 +179,7 @@ class Employee:
|
|||
'name': row[4],
|
||||
}])
|
||||
contracts = Contract.search([('employee', '=', employee.id)])
|
||||
|
||||
if not contracts:
|
||||
start_date_contract = row[9]
|
||||
end_date_contract = row[10]
|
||||
|
|
35
payroll.py
35
payroll.py
|
@ -322,7 +322,10 @@ class Payroll(metaclass=PoolMeta):
|
|||
events_lines_to_create.append(res)
|
||||
|
||||
if event.category.wage_type_discount and event.quantity_discount:
|
||||
discounts[event.category.wage_type_discount.id] = event.quantity_discount
|
||||
id_wt_event = event.category.wage_type_discount.id
|
||||
if id_wt_event not in discounts.keys():
|
||||
discounts[id_wt_event] = 0
|
||||
discounts[id_wt_event] += event.quantity_discount
|
||||
|
||||
self.absenteeism_days = absenteeism_days
|
||||
self.save()
|
||||
|
@ -1023,15 +1026,6 @@ class PayrollSheetReport(Report):
|
|||
dom_payroll.append([('period', 'in', data['periods'])])
|
||||
|
||||
payrolls = Payroll.search(dom_payroll, order=[('employee.party.name', 'ASC'), ('period.name', 'ASC')])
|
||||
# num = 0
|
||||
# if payrolls:
|
||||
# for payroll in payrolls:
|
||||
# if hasattr(payroll, 'project'):
|
||||
# if payroll.project:
|
||||
# num = num + 1
|
||||
# if num == 0:
|
||||
# payrolls = Payroll.search(clause)
|
||||
# payrolls = Payroll.search(clause)
|
||||
|
||||
new_objects = []
|
||||
default_vals = cls.default_values()
|
||||
|
@ -1051,16 +1045,11 @@ class PayrollSheetReport(Report):
|
|||
if payroll.contract and payroll.contract.position:
|
||||
position_contract = payroll.contract.position.name
|
||||
values['position'] = position_contract or position_name
|
||||
values['department'] = payroll.employee.department.name \
|
||||
if payroll.employee.department else ''
|
||||
values['company'] = user.company.party.name
|
||||
# payroll_lines = PayrollLine.search([
|
||||
# ('payroll', '=', payroll.id),
|
||||
# ('wage_type.type_concept', '=', 'salary'),
|
||||
# ])
|
||||
# values['legal_salary'] = 0
|
||||
# if payroll_lines:
|
||||
# values['legal_salary'] = payroll_lines[0].unit_value * 240
|
||||
# else:
|
||||
values['legal_salary'] = payroll.contract.get_salary_in_date(payroll.end)
|
||||
values['legal_salary'] = payroll.contract.get_salary_in_date(
|
||||
payroll.end)
|
||||
values['period'] = payroll.period.name
|
||||
values['salary_day'] = payroll.employee.salary_day
|
||||
values['salary_hour'] = (payroll.employee.salary_day / 8)
|
||||
|
@ -1074,7 +1063,7 @@ class PayrollSheetReport(Report):
|
|||
|
||||
if hasattr(payroll.employee, 'project_contract'):
|
||||
if payroll.employee.project_contract and \
|
||||
payroll.employee.project_contract.reference:
|
||||
payroll.employee.project_contract.reference:
|
||||
project = payroll.employee.project_contract.reference
|
||||
values['project'] = project
|
||||
|
||||
|
@ -1105,6 +1094,7 @@ class PayrollSheetReport(Report):
|
|||
'salary_hour',
|
||||
'worked_days',
|
||||
'period',
|
||||
'department',
|
||||
]
|
||||
|
||||
fields_amount = [
|
||||
|
@ -1217,8 +1207,10 @@ class PayrollSheetReport(Report):
|
|||
vals['total_deduction'] += line.amount
|
||||
if line.wage_type.type_concept == 'health':
|
||||
vals['health'] += line.amount
|
||||
vals['health_provision'] += line.get_expense_amount()
|
||||
elif line.wage_type.type_concept == 'retirement':
|
||||
vals['retirement'] += line.amount
|
||||
vals['retirement_provision'] += line.get_expense_amount()
|
||||
else:
|
||||
if line.wage_type.type_concept == 'fsp':
|
||||
vals['fsp'] += line.amount
|
||||
|
@ -1233,8 +1225,7 @@ class PayrollSheetReport(Report):
|
|||
vals['gross_payment'] = vals['salary'] + vals['total_extras'] + vals['transport'] + vals['food'] + vals['bonus']
|
||||
vals['net_payment'] = vals['gross_payment'] - vals['total_deduction']
|
||||
vals['ibc'] = vals['gross_payment']
|
||||
vals['total_benefit'] = vals['unemployment'] + vals['interest'] + vals['holidays'] + vals['bonus_service']
|
||||
vals['retirement_provision'] = vals['retirement'] * Decimal(0.12 / 0.04)
|
||||
vals['total_benefit'] = vals['unemployment'] + vals['interest'] + vals['holidays'] + vals['bonus_service']
|
||||
vals['total_ssi'] = vals['retirement_provision'] + vals['risk']
|
||||
vals['total_cost'] = vals['total_ssi'] + vals['box_family'] + vals['net_payment'] + vals['total_benefit']
|
||||
return vals
|
||||
|
|
Loading…
Reference in New Issue