v2.10.2: 휴일 근무 카운터 초 표시 수정
원격 v2.10.1(cmd창 깜빡임 hotfix) 위에 rebase → 2.10.2. - 휴일 분기 표시용 remaining을 초 정밀도 timedelta로 분리 (적립 계산은 퇴근 시 분 단위 그대로 — 영향 없음) - pytest 189 + 통합 53 green
This commit is contained in:
+11
-9
@@ -757,15 +757,17 @@ class MainWindow(QMainWindow):
|
||||
is_holiday = is_non_working or is_full_day_leave
|
||||
|
||||
if is_holiday:
|
||||
actual_ot, _ = self.time_calc.calculate_holiday_overtime(
|
||||
self.clock_in_time, now,
|
||||
include_lunch=self.lunch_break_enabled,
|
||||
include_dinner=self.dinner_break_enabled,
|
||||
break_minutes=break_minutes,
|
||||
)
|
||||
# 사용한 추가근무 차감만 반영 (leave_used는 holiday/override 케이스에서 의미 없음)
|
||||
actual_ot = max(0, actual_ot - overtime_used_today)
|
||||
remaining = -timedelta(minutes=actual_ot)
|
||||
# 표시는 초 단위로 부드럽게 — 적립(분 절삭)은 퇴근 시 별도 계산.
|
||||
# calculate_holiday_overtime와 동일한 차감 항목을 timedelta로 적용.
|
||||
deduction_min = break_minutes + overtime_used_today
|
||||
if self.lunch_break_enabled:
|
||||
deduction_min += self.time_calc.lunch_duration_minutes
|
||||
if self.dinner_break_enabled:
|
||||
deduction_min += self.time_calc.dinner_duration_minutes
|
||||
worked = (now - self.clock_in_time) - timedelta(minutes=deduction_min)
|
||||
if worked.total_seconds() < 0:
|
||||
worked = timedelta(0)
|
||||
remaining = -worked
|
||||
else:
|
||||
# 평일: 정상 남은 시간 계산. 부분 연차(반차/시간연차)는 leave_used_today에
|
||||
# 그대로 반영되어 카운트다운이 단축됨.
|
||||
|
||||
Reference in New Issue
Block a user