Update ReportController.php

This commit is contained in:
Jagad R R
2025-06-27 16:19:28 +07:00
parent c052d8508b
commit d95d6ff368
@@ -649,29 +649,29 @@ class ReportController extends Controller
// Fetch semua forms berdasarkan periode range // Fetch semua forms berdasarkan periode range
$forms = [ $forms = [
'Up Country' => FormUpCountry::whereIn('user_id', $userIds) 'Up Country' => FormUpCountry::whereIn('user_id', $userIds)
->whereBetween('tanggal', [$startDate, $endDate]) ->whereBetween('final_approved_at', [$startDate, $endDate])
->whereIn('status', ['Approved', 'Closed']) ->whereIn('status', ['Approved', 'Closed'])
->get(), ->get(),
'Vehicle Running Cost' => FormVehicleRunningCost::whereIn('user_id', $userIds) 'Vehicle Running Cost' => FormVehicleRunningCost::whereIn('user_id', $userIds)
->whereBetween('tanggal', [$startDate, $endDate]) ->whereBetween('final_approved_at', [$startDate, $endDate])
->whereIn('status', ['Approved', 'Closed']) ->whereIn('status', ['Approved', 'Closed'])
->get(), ->get(),
'Entertainment' => FormEntertaimentPresentation::whereIn('user_id', $userIds) 'Entertainment' => FormEntertaimentPresentation::whereIn('user_id', $userIds)
->whereBetween('tanggal', [$startDate, $endDate]) ->whereBetween('final_approved_at', [$startDate, $endDate])
->whereIn('status', ['Approved', 'Closed']) ->whereIn('status', ['Approved', 'Closed'])
->get(), ->get(),
'Meeting / Seminar' => FormMeetingSeminar::whereIn('user_id', $userIds) 'Meeting / Seminar' => FormMeetingSeminar::whereIn('user_id', $userIds)
->whereBetween('created_at', [$startDate, $endDate]) ->whereBetween('final_approved_at', [$startDate, $endDate])
->whereIn('status', ['Approved', 'Closed']) ->whereIn('status', ['Approved', 'Closed'])
->get(), ->get(),
]; ];
// Forms "Others" dikelompokkan berdasarkan kategori // Forms "Others" dikelompokkan berdasarkan kategori
$otherForms = FormOthers::whereIn('user_id', $userIds) $otherForms = FormOthers::whereIn('user_id', $userIds)
->whereBetween('tanggal', [$startDate, $endDate]) ->whereBetween('final_approved_at', [$startDate, $endDate])
->whereIn('status', ['Approved', 'Closed']) ->whereIn('status', ['Approved', 'Closed'])
->get(); ->get();