diff --git a/yuthon_hr_employee/models/yuthon_hr_employee.py b/yuthon_hr_employee/models/yuthon_hr_employee.py index 0a3215461..e16e073fe 100644 --- a/yuthon_hr_employee/models/yuthon_hr_employee.py +++ b/yuthon_hr_employee/models/yuthon_hr_employee.py @@ -76,7 +76,8 @@ class YuthonHrEmployee(models.Model): entry_date = fields.Date(string="入职时间") confirmation_date = fields.Date(string="转正时间") company_old = fields.Char(string="司龄", compute='_compute_company_old') - company_old_year = fields.Integer(string="司龄(年)", compute='_compute_company_old') + company_old_year = fields.Integer(string="司龄(年)", compute='_compute_company_old', store=True) + regularization_year = fields.Integer(string="转正(年)", compute='_compute_regularization_year', store=True) open_start_time = fields.Date(string="参加工作时间") cumulative_work_month = fields.Integer(string="累计工作月数", compute='_compute_social_insurance_info', store=True) cumulative_work_years = fields.Char(string="累计工作年限", compute='_compute_cumulative_work_years', store=True) @@ -289,6 +290,12 @@ class YuthonHrEmployee(models.Model): "target": "new", } + @api.depends('confirmation_date') + def _compute_regularization_year(self): + for record in self: + if record.confirmation_date: + record.regularization_year = fields.Date.today().year - record.confirmation_date.year() + @api.depends('entry_date') def _compute_company_old(self): """司龄计算""" diff --git a/yuthon_hr_employee/views/yuthon_hr_employee_views.xml b/yuthon_hr_employee/views/yuthon_hr_employee_views.xml index 8a2573cf8..d6be47590 100644 --- a/yuthon_hr_employee/views/yuthon_hr_employee_views.xml +++ b/yuthon_hr_employee/views/yuthon_hr_employee_views.xml @@ -118,6 +118,7 @@ + diff --git a/yuthon_salary/models/inherit_hr_payslip.py b/yuthon_salary/models/inherit_hr_payslip.py index b76377ffc..ef73abe66 100644 --- a/yuthon_salary/models/inherit_hr_payslip.py +++ b/yuthon_salary/models/inherit_hr_payslip.py @@ -47,7 +47,7 @@ class InheritHrPayslip(models.Model): housing_provident_fund = fields.Float(string='住房公积金', compute='_compute_salary', store=True) b_year = fields.Float(string='企业(职业)年金', compute='_compute_salary', store=True) total_before_tax = fields.Float(string='本期收入', compute='_compute_total_before_tax', store=True) - total_before_tax = fields.Float(string='税前合计', compute='_compute_total_before_tax', store=True) + total_tax = fields.Float(string='本期应收', compute='_compute_total_before_tax', store=True) year_compute = fields.Float(string='年度清算') year_jie = fields.Float(string='年度结余') year_gong = fields.Float(string='年功奖') @@ -60,6 +60,15 @@ class InheritHrPayslip(models.Model): is_push = fields.Boolean(string='推送') is_salary_push = fields.Boolean(string='工资推送') + commercial_health_insurance = fields.Float(string='商业健康保险') + tax_deferred_pension_insurance = fields.Float(string='税延养老保险') + others = fields.Float(string='其他') + deductible_donations = fields.Float(string='准予扣除的捐赠额') + total_pre_tax_deductions = fields.Float(string='税前扣除项目合计') + tax_reduction = fields.Float(string='减免税额') + deduction_standard = fields.Float(string='减除费用标准') + paid_tax = fields.Float(string='已缴税额') + @api.depends('line_ids') 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 1d553aef6..af60c8ff9 100644 --- a/yuthon_salary/models/yuthon_payroll_project.py +++ b/yuthon_salary/models/yuthon_payroll_project.py @@ -47,11 +47,13 @@ class YuthonPayrollCommon(models.Model): if ins.name == '工龄工资': formula_salary = "result = (employee.company_old_year + 1) * 10" if ins.name == '工会会费': - formula_salary = "result = contract.wage * 0.05" + formula_salary = "result = payslip.base_salary * 0.05" if ins.name == '误餐费': formula_salary = "result = employee.meal_number * 40" if ins.name == '通讯补贴': formula_salary = "result = 300" + if ins.name == '企业(职业)年金': + formula_salary = "result = employee.last_year_salary * 0.02 if employee.confirmation_year >= 1 else ((payslip.base_salary + payslip.rank_salary) * 0.02)" if ins.name == '全勤奖': formula_salary = "result = 200 if employee.last_attendance else 0" if ins.name == '加班费': @@ -156,19 +158,19 @@ class YuthonPayrollInsurances (models.Model): 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.last_year_salary * " + 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.last_year_salary * " + 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.last_year_salary * " + 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.last_year_salary * " + 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.last_year_salary * " + 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/security/yuthon_salary_group.xml b/yuthon_salary/security/yuthon_salary_group.xml index 2f9fc0190..d282b1578 100644 --- a/yuthon_salary/security/yuthon_salary_group.xml +++ b/yuthon_salary/security/yuthon_salary_group.xml @@ -64,9 +64,6 @@ 工资单公司过滤 [('yuthon_company', '=', user.employee_id.yuthon_company)] - - - - + \ No newline at end of file diff --git a/yuthon_salary/views/inherit_hr_payslip_views.xml b/yuthon_salary/views/inherit_hr_payslip_views.xml index f11efd806..04c0f218b 100644 --- a/yuthon_salary/views/inherit_hr_payslip_views.xml +++ b/yuthon_salary/views/inherit_hr_payslip_views.xml @@ -136,6 +136,14 @@ + + + + + + + + @@ -198,6 +206,14 @@ + + + + + + + +