diff --git a/yuthon_hr_employee/wizard/hr_employee_wizard.py b/yuthon_hr_employee/wizard/hr_employee_wizard.py
index 2efdf5608..3324641c3 100644
--- a/yuthon_hr_employee/wizard/hr_employee_wizard.py
+++ b/yuthon_hr_employee/wizard/hr_employee_wizard.py
@@ -176,9 +176,11 @@ class YuthonHrEmployeeWizard(models.Model):
employee_id = self.env['hr.employee'].search([('name', '=', row[0].value)])
social_base_on = row[1].value if row[1].value else None
social_base_off = row[2].value if row[2].value else None
+ last_year_salary = row[3].value if row[3].value else None
employee_date = {
'social_base_on': social_base_on,
'social_base_off': social_base_off,
+ 'last_year_salary':last_year_salary,
}
if employee_id:
employee_id.write(employee_date)
diff --git a/yuthon_salary/models/yuthon_payroll_project.py b/yuthon_salary/models/yuthon_payroll_project.py
index b21f0ff2b..9d697e80b 100644
--- a/yuthon_salary/models/yuthon_payroll_project.py
+++ b/yuthon_salary/models/yuthon_payroll_project.py
@@ -130,6 +130,7 @@ class YuthonPayrollInsurances (models.Model):
employee_base_ceiling = fields.Float(string='个人缴纳基数上限')
employee_base_floor = fields.Float(string='个人缴纳基数下限')
documents_ids = fields.Many2many('ir.attachment', string="附件")
+ payroll_structure_ids = fields.Many2many('hr.payroll.structure', string="排除职级范围")
remarks = fields.Text(string="备注")
start_date = fields.Date(string="生效日期", default=fields.Date.today())
end_date = fields.Date(string="失效日期")
@@ -154,24 +155,26 @@ class YuthonPayrollInsurances (models.Model):
for ins in insurances_ids:
salary_lv_ids = self.env["hr.payroll.structure"].search([])
for sal in salary_lv_ids:
+ if sal.id in ins.payroll_structure_ids.ids:
+ continue
rule_list = []
formula_salary = ''
if ins.name not in sal.rule_ids.mapped('name'):
if ins.name == '基本医疗保险费':
number = ins.proportion_employee
- formula_salary = "result = employee.last_year_salary * " + str(number * 0.01)
+ formula_salary = "result = employee.social_base_on * " + str(number * 0.01)
if ins.name == '基本养老保险费':
number = ins.proportion_employee
- formula_salary = "result = employee.last_year_salary * " + str(number * 0.01)
+ formula_salary = "result = employee.social_base_on * " + str(number * 0.01)
if ins.name == '失业保险费':
number = ins.proportion_employee
- formula_salary = "result = employee.last_year_salary * " + str(number * 0.01)
+ formula_salary = "result = employee.social_base_on * " + str(number * 0.01)
if ins.name == '工伤保险费':
number = ins.proportion_employee
- formula_salary = "result = employee.last_year_salary * " + str(number * 0.01)
+ formula_salary = "result = employee.social_base_on * " + str(number * 0.01)
if ins.name == '住房公积金':
number = ins.proportion_employee
- formula_salary = "result = employee.last_year_salary * " + str(number * 0.01)
+ formula_salary = "result = employee.social_base_on * " + str(number * 0.01)
rule_list.append([0, 0, {
'name': ins.name,
'category_id': self.env['hr.salary.rule.category'].search([('name', '=', '五险一金')], limit=1).id,
diff --git a/yuthon_salary/views/yuthon_payroll_project_views.xml b/yuthon_salary/views/yuthon_payroll_project_views.xml
index 9b62328a7..ffcc11d5d 100644
--- a/yuthon_salary/views/yuthon_payroll_project_views.xml
+++ b/yuthon_salary/views/yuthon_payroll_project_views.xml
@@ -69,6 +69,7 @@
+
diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml
index bf2a4f03c..847ebba64 100644
--- a/yuthon_work_brand/views/hr_menus.xml
+++ b/yuthon_work_brand/views/hr_menus.xml
@@ -335,11 +335,11 @@
parent="human_resources_salary_root_board"
action="hr_payroll.action_view_hr_payslip_month_form"
sequence="7"/>
-
+
+
+
+
+