fix: check if absence is ended

Signed-off-by: miguel456 <me@nogueira.codes>
This commit is contained in:
2022-11-08 01:19:58 +00:00
parent 27ba576678
commit 35d112a5ca
2 changed files with 1 additions and 3 deletions

View File

@@ -174,7 +174,7 @@ class AbsenceService
{
foreach (Absence::all() as $absence)
{
if (!Carbon::parse($absence->predicted_end)->isFuture()) {
if (!Carbon::parse($absence->predicted_end)->isFuture() && $absence->status !== 'ENDED') {
$this->endAbsence($absence);
}
}