update
This commit is contained in:
@@ -107,6 +107,18 @@ class BudgetControlController extends Controller
|
||||
'status' => 'Assigned',
|
||||
]);
|
||||
|
||||
BudgetControlLog::create([
|
||||
'cabang_id' => $cabang_id,
|
||||
'sender_id' => auth()->user()->id,
|
||||
'receiver_id' => $validated['receiver_id'],
|
||||
'periode_month' => $validated['periode_month'],
|
||||
'periode_year' => $validated['periode_year'],
|
||||
'amount' => $validated['amount'],
|
||||
'remarks' => $validated['remarks'],
|
||||
'closing_at' => null,
|
||||
'status' => 'Assigned',
|
||||
]);
|
||||
|
||||
session()->flash('success', 'Budget has been added or updated successfully');
|
||||
return redirect()->route('budget_control');
|
||||
}
|
||||
|
||||
@@ -631,7 +631,9 @@ class ReportController extends Controller
|
||||
$year = $params['year'];
|
||||
$month = $params['month'];
|
||||
|
||||
// get last data
|
||||
$budget = BudgetControlLog::where('cabang_id', $cabang->id)->where('periode_year', $year)->where('periode_month', $month)->orderBy('created_at', 'desc')->first();
|
||||
|
||||
$userIds = UserHasCabang::where('cabang_id', $cabang->id)->pluck('user_id');
|
||||
|
||||
// Fetch all relevant forms in one batch
|
||||
|
||||
Reference in New Issue
Block a user