@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
<field name="company_base_floor"/>
|
||||
<field name="employee_base_ceiling"/>
|
||||
<field name="employee_base_floor"/>
|
||||
<field name="payroll_structure_ids" widget="many2many_tags"/>
|
||||
<field name="documents_ids" widget="preview_many2many"/>
|
||||
<field name="remarks"/>
|
||||
<field name="start_date"/>
|
||||
|
||||
@@ -335,11 +335,11 @@
|
||||
parent="human_resources_salary_root_board"
|
||||
action="hr_payroll.action_view_hr_payslip_month_form"
|
||||
sequence="7"/>
|
||||
<menuitem id="hr_payroll_structure_type_board"
|
||||
name="职级类型"
|
||||
parent="human_resources_salary_root_board"
|
||||
action="yuthon_salary.action_view_hr_payroll_structure_type_form1"
|
||||
sequence="9"/>
|
||||
<!-- <menuitem id="hr_payroll_structure_type_board"-->
|
||||
<!-- name="职级类型"-->
|
||||
<!-- parent="human_resources_salary_root_board"-->
|
||||
<!-- action="yuthon_salary.action_view_hr_payroll_structure_type_form1"-->
|
||||
<!-- sequence="9"/>-->
|
||||
<menuitem id="human_resources_salary_root_board1"
|
||||
name="职级"
|
||||
parent="human_resources_salary_root_board"
|
||||
|
||||
Reference in New Issue
Block a user