fix some revisi
This commit is contained in:
@@ -133,9 +133,8 @@ class FormMeetingSeminarController extends Controller
|
||||
$closingDateNextMonth = date('Y-m-', strtotime('+1 month')) . env('CLOSING_DATE');
|
||||
|
||||
if ($currentDate < $startDate || $currentDate > $closingDateNextMonth) {
|
||||
return response()->json([
|
||||
'error' => 'Current date is not within the valid range.'
|
||||
], 400);
|
||||
session()->flash('error', 'Gagal, Input expense sudah melewati periode input 12-10');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
$cabang = UserHasCabang::with('cabang')->where('user_id', auth()->user()->id)->first()->cabang;
|
||||
@@ -195,9 +194,8 @@ class FormMeetingSeminarController extends Controller
|
||||
];
|
||||
|
||||
// Check if the total nominal exceeds the available budget
|
||||
$cabang_id = UserHasCabang::where('user_id', auth()->user()->id)->first()->cabang_id;
|
||||
if(array_sum($data_nominal) > BudgetHelper::getAvailableBudget($cabang_id)) {
|
||||
session()->flash('error', 'The total nominal exceeds the available budget.');
|
||||
if(array_sum($data_nominal) > BudgetHelper::getAvailableBudget($cabang->id)) {
|
||||
session()->flash('error', 'Alokasi budget bulanan cabang tidak mencukupi,silahkan ajukan pada periode expense berikutnya');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user