enhanced by codex
This commit is contained in:
@@ -93,10 +93,16 @@ class FormEntertainmentPresentationController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
$outstandingForms = $forms->filter(function ($form) {
|
||||
return is_null($form->final_approved_at) || is_null($form->final_approved_by);
|
||||
});
|
||||
|
||||
session()->put('redirect_url', route('forms.entertainment'));
|
||||
return view('backend.pages.forms.entertainment.index', [
|
||||
'forms' => $forms,
|
||||
'availableBudget' => $availableBudget,
|
||||
'outstandingCount' => $outstandingForms->count(),
|
||||
'outstandingTotal' => $outstandingForms->sum('total'),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -697,13 +703,18 @@ class FormEntertainmentPresentationController extends Controller
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
public function reject($id)
|
||||
public function reject(Request $request, $id)
|
||||
{
|
||||
$this->checkAuthorization(auth()->user(), ['approval.reject']);
|
||||
|
||||
$request->validate([
|
||||
'remarks' => 'required|string|max:500',
|
||||
]);
|
||||
|
||||
$form = FormEntertaimentPresentation::findOrfail($id);
|
||||
$form->update([
|
||||
'status' => 'Rejected'
|
||||
'status' => 'Rejected',
|
||||
'remarks' => $request->remarks,
|
||||
]);
|
||||
|
||||
$heads = $form->user->getCabangAndRegionHead();
|
||||
@@ -795,4 +806,4 @@ class FormEntertainmentPresentationController extends Controller
|
||||
session()->flash('success', 'Form has been deleted.');
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user