1
This commit is contained in:
@@ -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):
|
||||
"""司龄计算"""
|
||||
|
||||
@@ -118,6 +118,7 @@
|
||||
<field name="confirmation_date"/>
|
||||
<field name="company_old"/>
|
||||
<field name="company_old_year" invisible="1"/>
|
||||
<field name="regularization_year" invisible="1"/>
|
||||
<field name="open_start_time"/>
|
||||
<field name="cumulative_work_month"/>
|
||||
<field name="cumulative_work_years"/>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -74,6 +74,5 @@ class SalaryComputeWizard(models.Model):
|
||||
payslip.compute_sheet()
|
||||
|
||||
def _get_chinese_month(self, month):
|
||||
chinese_months = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月',
|
||||
'十二月']
|
||||
chinese_months = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
|
||||
return chinese_months[month - 1]
|
||||
Reference in New Issue
Block a user