添加功能
This commit is contained in:
@@ -51,6 +51,17 @@ class YuthonMedicalManage(models.Model):
|
||||
elif employee.marital == 'married':
|
||||
final_quota += rule.allowance_married_women
|
||||
|
||||
entry_date = fields.Date.from_string(employee.entry_date)
|
||||
current_year = current_date.year
|
||||
entry_year = entry_date.year
|
||||
|
||||
# 判断是否为当年入职
|
||||
if entry_year == current_year:
|
||||
entry_month = entry_date.month
|
||||
ratio = (12 - entry_month + 1) / 12
|
||||
final_quota = final_quota * ratio
|
||||
final_quota = max(final_quota, 0.0)
|
||||
|
||||
if rule.cap > 0:
|
||||
final_quota = min(base_quota, rule.cap)
|
||||
|
||||
@@ -111,6 +122,7 @@ class YuthonMedicalManage(models.Model):
|
||||
'prev_last_year_balance': prev_last_year_rec.current_year_remaining,
|
||||
})
|
||||
|
||||
|
||||
def button_details(self):
|
||||
form_id = self.env.ref('yuthon_hr_employee.view_yuthon_medical_manage_form').id
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user