From b8ff5476f9d7bf1b3428acf6127ca15b2a1471b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Fri, 8 May 2026 09:54:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_holiday/models/inherit_hr_leave.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yuthon_holiday/models/inherit_hr_leave.py b/yuthon_holiday/models/inherit_hr_leave.py index ede280a05..8a5d868a7 100644 --- a/yuthon_holiday/models/inherit_hr_leave.py +++ b/yuthon_holiday/models/inherit_hr_leave.py @@ -1217,19 +1217,19 @@ class HolidaysRequestBatch(models.Model): if leave_type_name not in leave_type_mapping or leave_days <= 0: continue type_config = leave_type_mapping[leave_type_name] - remaining_hours = leave_days * 8 + remaining_hours = leave_days * 8 if type_config['prev']: - prev_balance = leave_balance[type_config['prev']] + prev_balance = leave_balance[type_config['prev']] * 8 if prev_balance > 0: deduct = round(min(remaining_hours, prev_balance), 1) - leave_balance[type_config['prev']] = round(leave_balance[type_config['prev']] - deduct, 1) + leave_balance[type_config['prev']] = round((prev_balance - deduct) / 8, 1) remaining_hours = round(remaining_hours - deduct, 1) if remaining_hours > 0 and type_config['curr']: - curr_balance = leave_balance[type_config['curr']] + curr_balance = leave_balance[type_config['curr']] * 8 deduct = round(min(remaining_hours, curr_balance), 1) - leave_balance[type_config['curr']] = round(leave_balance[type_config['curr']] - deduct, 1) + leave_balance[type_config['curr']] = round((curr_balance - deduct) / 8, 1) remaining_hours = round(remaining_hours - deduct, 1) if type_config['prev']: