Edit task creation start time
This commit is contained in:
@@ -28,8 +28,9 @@ class LatePenaltyService
|
||||
];
|
||||
}
|
||||
|
||||
$entered = Carbon::parse($enteredAt);
|
||||
$threshold = $entered->copy()->setTimeFromTimeString(self::WORK_START);
|
||||
// فقط تا دقیقه؛ ثانیه نادیده گرفته میشود
|
||||
$entered = Carbon::parse($enteredAt)->startOfMinute();
|
||||
$threshold = $entered->copy()->setTimeFromTimeString(self::WORK_START)->startOfMinute();
|
||||
|
||||
if ($entered->lte($threshold)) {
|
||||
return [
|
||||
@@ -40,7 +41,7 @@ class LatePenaltyService
|
||||
];
|
||||
}
|
||||
|
||||
$lateMinutes = (int) ceil($threshold->diffInSeconds($entered) / 60);
|
||||
$lateMinutes = (int) $threshold->diffInMinutes($entered);
|
||||
// تأخیر داخل بازه ارفاق روزانه (۸:۳۰ تا ۸:۴۵) — مبنای جریمه هفتگی
|
||||
$graceLateMinutes = min($lateMinutes, self::DAILY_GRACE_MINUTES);
|
||||
$dailyFineMinutes = max(0, $lateMinutes - self::DAILY_GRACE_MINUTES);
|
||||
|
||||
Reference in New Issue
Block a user