removed closing date and add it into env
This commit is contained in:
@@ -109,7 +109,6 @@ class BudgetControlController extends Controller
|
||||
'periode_year' => 'required|numeric',
|
||||
'amount' => 'required|numeric',
|
||||
'remarks' => 'nullable|string',
|
||||
'closing_at' => 'required|date',
|
||||
]);
|
||||
|
||||
$cabang_id = Admin::find($validated['receiver_id'])->getMyCabangAndRegionId()['cabang'];
|
||||
@@ -121,7 +120,7 @@ class BudgetControlController extends Controller
|
||||
'periode_year' => $validated['periode_year'],
|
||||
'amount' => $validated['amount'],
|
||||
'remarks' => $validated['remarks'],
|
||||
'closing_at' => $validated['closing_at'],
|
||||
'closing_at' => null,
|
||||
'status' => 'Assigned',
|
||||
]);
|
||||
|
||||
|
||||
@@ -21,35 +21,36 @@ class DashboardController extends Controller
|
||||
public function index()
|
||||
{
|
||||
$role = auth()->user()->getRoleNames()[0];
|
||||
$closing_date = env('CLOSING_DATE');
|
||||
$forms = [
|
||||
'vehicle' => FormVehicleRunningCost::whereMonth('tanggal', date('m'))
|
||||
->whereYear('tanggal', date('Y'))
|
||||
->where('tanggal', '<=', date('Y-m-20'))
|
||||
->whereRaw('DAY(CURDATE()) <= 20')
|
||||
->where('tanggal', '<=', date('Y-m-'.$closing_date))
|
||||
->whereRaw('DAY(CURDATE()) <= '.$closing_date)
|
||||
->orderBy('tanggal', 'desc')
|
||||
->get(),
|
||||
'upcountry' => FormUpCountry::whereMonth('tanggal', date('m'))
|
||||
->whereYear('tanggal', date('Y'))
|
||||
->where('tanggal', '<=', date('Y-m-20'))
|
||||
->whereRaw('DAY(CURDATE()) <= 20')
|
||||
->where('tanggal', '<=', date('Y-m-'.$closing_date))
|
||||
->whereRaw('DAY(CURDATE()) <= '.$closing_date)
|
||||
->orderBy('tanggal', 'desc')
|
||||
->get(),
|
||||
'entertainment' => FormEntertaimentPresentation::whereMonth('tanggal', date('m'))
|
||||
->whereYear('tanggal', date('Y'))
|
||||
->where('tanggal', '<=', date('Y-m-20'))
|
||||
->whereRaw('DAY(CURDATE()) <= 20')
|
||||
->where('tanggal', '<=', date('Y-m-'.$closing_date))
|
||||
->whereRaw('DAY(CURDATE()) <= '.$closing_date)
|
||||
->orderBy('tanggal', 'desc')
|
||||
->get(),
|
||||
'meeting' => FormMeetingSeminar::whereMonth('created_at', date('m'))
|
||||
->whereYear('created_at', date('Y'))
|
||||
->where('created_at', '<=', date('Y-m-20'))
|
||||
->whereRaw('DAY(CURDATE()) <= 20')
|
||||
->where('created_at', '<=', date('Y-m-'.$closing_date))
|
||||
->whereRaw('DAY(CURDATE()) <= '.$closing_date)
|
||||
->orderBy('created_at', 'desc')
|
||||
->get(),
|
||||
'others' => FormOthers::whereMonth('tanggal', date('m'))
|
||||
->whereYear('tanggal', date('Y'))
|
||||
->where('tanggal', '<=', date('Y-m-20'))
|
||||
->whereRaw('DAY(CURDATE()) <= 20')
|
||||
->where('tanggal', '<=', date('Y-m-'.$closing_date))
|
||||
->whereRaw('DAY(CURDATE()) <= '.$closing_date)
|
||||
->orderBy('tanggal', 'desc')
|
||||
->get(),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user