Update BudgetControlController.php
This commit is contained in:
@@ -124,17 +124,22 @@ class BudgetControlController extends Controller
|
||||
]);
|
||||
|
||||
$cabang_id = Admin::find($validated['receiver_id'])->getMyCabangAndRegionId()['cabang'];
|
||||
BudgetControl::updateOrCreate(['cabang_id' => $cabang_id],
|
||||
[
|
||||
'sender_id' => auth()->user()->id,
|
||||
'receiver_id' => $validated['receiver_id'],
|
||||
$periode = [
|
||||
'periode_month' => $validated['periode_month'],
|
||||
'periode_year' => $validated['periode_year'],
|
||||
'amount' => $validated['amount'],
|
||||
'remarks' => $validated['remarks'],
|
||||
'closing_at' => null,
|
||||
'status' => 'Assigned',
|
||||
]);
|
||||
];
|
||||
|
||||
BudgetControl::updateOrCreate(
|
||||
array_merge(['cabang_id' => $cabang_id], $periode),
|
||||
array_merge($periode, [
|
||||
'sender_id' => auth()->user()->id,
|
||||
'receiver_id' => $validated['receiver_id'],
|
||||
'amount' => $validated['amount'],
|
||||
'remarks' => $validated['remarks'],
|
||||
'closing_at' => null,
|
||||
'status' => 'Assigned',
|
||||
])
|
||||
);
|
||||
|
||||
BudgetControlLog::create([
|
||||
'cabang_id' => $cabang_id,
|
||||
|
||||
Reference in New Issue
Block a user