diff --git a/yuthon_salary/models/inherit_hr_payslip.py b/yuthon_salary/models/inherit_hr_payslip.py index cabdb29bd..cbbda427f 100644 --- a/yuthon_salary/models/inherit_hr_payslip.py +++ b/yuthon_salary/models/inherit_hr_payslip.py @@ -152,6 +152,10 @@ class InheritHrPayslip(models.Model): self.env['hr.payslip.line'].create(payslips._get_payslip_lines()) return True + @api.onchange('employee_id') + def _onchange_salary_group_id(self): + self.salary_group_id = self.employee_id.contract_id.salary_group_id + @api.depends('line_ids', 'social_security') def _compute_salary(self): for rec in self: diff --git a/yuthon_salary/models/yuthon_payroll_project.py b/yuthon_salary/models/yuthon_payroll_project.py index aa677be9a..db705902e 100644 --- a/yuthon_salary/models/yuthon_payroll_project.py +++ b/yuthon_salary/models/yuthon_payroll_project.py @@ -224,14 +224,14 @@ class YuthonPayrollInsurances (models.Model): formula_salary = "result = employee.social_base_on * " + str(number) if ins.name == '住房公积金': code = 'ZFGJJ' - formula_salary = "result = 0.0 if employee.total_coefficients == 0 else round((employee.converted/employee.total_coefficients * employee.conversion_factor * 0.08 * 0.5)/12, 2)" + formula_salary = "result = (round((employee.housing_fund_base * " + str(number) + "), 0)) if employee.is_accum_salary else 0" if ins.name == '工会会费': code = 'GHHF' formula_salary = "result = round((payslip.base_salary * 0.005), 2)" if ins.name == '企业(职业)年金': if ins.company_id.name == '天河物管': code = 'WGQYNJ' - formula_salary = "result = round((employee.converted/(employee.total_coefficients * employee.conversion_factor * 0.08 * 0.5))/12, 2)" + formula_salary = "result = 0.0 if employee.total_coefficients == 0 else round((employee.converted/employee.total_coefficients * employee.calculation_totals * 0.08 * 0.5)/12, 2)" else: code = 'QYNJ' formula_salary = "result = round((employee.last_year_salary * 0.02), 0)" diff --git a/yuthon_salary/views/inherit_hr_payslip_views.xml b/yuthon_salary/views/inherit_hr_payslip_views.xml index 0ca086da1..aea5333d7 100644 --- a/yuthon_salary/views/inherit_hr_payslip_views.xml +++ b/yuthon_salary/views/inherit_hr_payslip_views.xml @@ -117,6 +117,7 @@ +