添加功能
This commit is contained in:
@@ -79,7 +79,6 @@ class YuthonHrEmployee(models.Model):
|
||||
is_membership = fields.Boolean(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)
|
||||
cumulative_year = fields.Integer(string="累计工作年限(年)")
|
||||
interrupt_work_month = fields.Integer(string="中断工作月数")
|
||||
compute_char = fields.Char(string="工龄", compute='_compute_social_insurance_info')
|
||||
compute_month = fields.Integer(string="工龄(月)")
|
||||
@@ -380,12 +379,12 @@ class YuthonHrEmployee(models.Model):
|
||||
if record.entry_date:
|
||||
today = datetime.now().date()
|
||||
years_diff = today.year - record.entry_date.year
|
||||
record.company_old_year = years_diff + 1
|
||||
months_diff = today.month - record.entry_date.month
|
||||
if today.month < record.entry_date.month:
|
||||
years_diff -= 1
|
||||
months_diff += 12
|
||||
record.company_old = str(years_diff) + '年' + str(months_diff) + '月'
|
||||
record.company_old_year = years_diff
|
||||
else:
|
||||
record.company_old = None
|
||||
record.company_old_year = 0
|
||||
@@ -431,7 +430,6 @@ class YuthonHrEmployee(models.Model):
|
||||
else:
|
||||
result_str = f"{months}个月"
|
||||
record.cumulative_work_years = result_str
|
||||
record.cumulative_year = int(years)
|
||||
|
||||
@api.depends('identification_id') # 只依赖身份证号码
|
||||
def _compute_info(self):
|
||||
|
||||
@@ -60,7 +60,6 @@
|
||||
|
||||
</group>
|
||||
<group string="基本信息">
|
||||
<field name="cumulative_year" invisible="1"/>
|
||||
<field name="identification_id"/>
|
||||
<field name="user_sex"/>
|
||||
<field name="user_number_start_time"/>
|
||||
|
||||
@@ -274,12 +274,13 @@ class InheritHrPayslip(models.Model):
|
||||
}
|
||||
|
||||
@api.depends('year_compute', 'year_jie', 'year_gong', 'jing_te', 'study_on', 'post_salary', 'seniority_allowance',
|
||||
'seniority_salary','commuting_allowance', 'base_salary' , 'performance_bonuses',
|
||||
'seniority_salary','commuting_allowance', 'base_salary' , 'performance_bonuses', 'comprehensive_subsidy',
|
||||
'full_attendance_award', 'overtime_pay', 'based_pay', 'january_performance', 'position_subsidy',
|
||||
'temporary_performance_bonus', 'performance_deduction', 'commuting_deduction', 'base_salary_deduction', 'last_year_performance_evaluation')
|
||||
def _compute_total_before_tax(self):
|
||||
for record in self:
|
||||
record.total_before_tax = (
|
||||
record.comprehensive_subsidy +
|
||||
record.position_subsidy +
|
||||
record.last_year_performance_evaluation +
|
||||
record.temporary_performance_bonus +
|
||||
|
||||
@@ -67,14 +67,16 @@ class YuthonPayrollCommon(models.Model):
|
||||
formula_salary = "result = employee.meal_number * 40 + employee.meal_supplement"
|
||||
if ins.name == '通讯补贴':
|
||||
formula_salary = "result = 300"
|
||||
if ins.name == '全勤奖':
|
||||
if ins.name == '全勤奖' and ins.company_id.name == '集团本部':
|
||||
formula_salary = "result = 200 if employee.last_attendance else 0"
|
||||
if ins.name == '全勤奖' and ins.company_id.name == '天河物管':
|
||||
formula_salary = "result = 100 if employee.last_attendance else 0"
|
||||
if ins.name == '加班费':
|
||||
formula_salary = "result = round(((employee.all_overtime_hours - 40) * (payslip.base_salary /21.75 / 8) * 1.5), 0) if employee.all_overtime_hours > 40 else 0"
|
||||
if ins.name == '安全生产管理补贴':
|
||||
formula_salary = "result = 320 if employee.department_id.name != '领导班子' else 0"
|
||||
if ins.name == '工龄补贴':
|
||||
formula_salary = "result = min(400, employee.cumulative_year * 10 + employee.company_old_year * 20) if employee.department_id.name != '领导班子' else 0"
|
||||
formula_salary = "result = min(400, ((employee.entry_date - employee.open_start_time).days // 30.4375 - employee.interrupt_work_month) // 12) * 10 + employee.company_old_year * 20 if employee.department_id.name != '领导班子' else 0"
|
||||
if ins.name == '岗位绩效':
|
||||
formula_salary = "result = 0"
|
||||
if ins.name == '高温补贴':
|
||||
@@ -95,7 +97,7 @@ class YuthonPayrollCommon(models.Model):
|
||||
formula_salary = "result = 0"
|
||||
if ins.name == '质检员津贴':
|
||||
formula_salary = "result = 0"
|
||||
if ins.name == '工会会费' and ins.company_id.name == '集团本部' or ins.company_id.name == '天河物管':
|
||||
if ins.name == '工会会费' and ins.company_id.name in ['集团本部','天河物管']:
|
||||
formula_salary = "result = round((payslip.base_salary * 0.005), 2)"
|
||||
if ins.name == '工会会费' and ins.company_id.name == '天河粮储':
|
||||
formula_salary = "result = 20 if employee.user_role_id.name in ['总经理', '副总经理'] else \
|
||||
|
||||
Reference in New Issue
Block a user