Merge pull request !3490 from 李鹏宇/dev
This commit is contained in:
李鹏宇
2025-06-23 10:20:29 +00:00
committed by Gitee
2 changed files with 4 additions and 7 deletions
@@ -450,22 +450,18 @@ class YuthonHrEmployee(models.Model):
for record in self:
if record.entry_date:
today = datetime.now().date()
record.company_old_year = today.year - record.entry_date.year + 1
# 原有的完整年月计算保持不变
years_diff = today.year - record.entry_date.year
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
record.is_accum_salary = True
if record.entry_date:
if record.entry_date.year == fields.Date.today().year and record.entry_date.month == fields.Date.today().month:
record.is_accum_salary = False
@api.depends('open_start_time', 'interrupt_work_month')
def _compute_social_insurance_info(self):
for record in self:
+2 -1
View File
@@ -279,11 +279,12 @@ 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', 'comprehensive_subsidy',
'full_attendance_award', 'overtime_pay', 'based_pay', 'january_performance', 'position_subsidy',
'full_attendance_award', 'overtime_pay', 'based_pay', 'january_performance', 'position_subsidy', 'safety_incentives',
'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.safety_incentives +
record.comprehensive_subsidy +
record.position_subsidy +
record.last_year_performance_evaluation +