fixing OutstandingHelper
This commit is contained in:
@@ -28,7 +28,13 @@ class OutstandingHelper
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$status = $form->status;
|
$status = (string) $form->status;
|
||||||
|
$normalizedStatus = strtolower($status);
|
||||||
|
|
||||||
|
if (in_array($normalizedStatus, ['rejected', 'closed'], true)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
switch ($role) {
|
switch ($role) {
|
||||||
case 'Admin Region':
|
case 'Admin Region':
|
||||||
if ($status !== 'On Progress') {
|
if ($status !== 'On Progress') {
|
||||||
@@ -70,6 +76,10 @@ class OutstandingHelper
|
|||||||
return is_null($form->final_approved_at) || is_null($form->final_approved_by);
|
return is_null($form->final_approved_at) || is_null($form->final_approved_by);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
if (!in_array($normalizedStatus, ['on progress', 'approved 1', 'approved 2'], true)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return is_null($form->final_approved_at) || is_null($form->final_approved_by);
|
return is_null($form->final_approved_at) || is_null($form->final_approved_by);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user