user(); $isManager = self::hasAnyRole([Role::OWNER, Role::DEVELOPER, Role::ADMIN_TOKO, Role::DIREKTUR]); $startDate = $request->input('start_date'); $endDate = $request->input('end_date'); $attendance = $this->service->getAttendanceStats($startDate, $endDate); $myAttendance = $this->service->getMyAttendance($user, $startDate, $endDate); $cashOverview = $this->service->getCashOverview(); $rawMaterialStock = $this->service->getRawMaterialStock(); $productStock = $this->service->getProductStock(); $revenueSummary = $this->service->getRevenueSummary($startDate, $endDate); $monthlyRevenue = $this->service->getMonthlyRevenue($startDate, $endDate); $monthlyRevenueByChannel = $this->service->getMonthlyRevenueByChannel($startDate, $endDate); $revenueByPaymentType = $this->service->getRevenueByPaymentType($startDate, $endDate); $expenseSummary = $this->service->getExpenseSummary($startDate, $endDate); $monthlyExpense = $this->service->getMonthlyExpense($startDate, $endDate); $busyHours = $this->service->getBusyHours($startDate, $endDate); $profitMetrics = $this->service->getProfitMetrics($startDate, $endDate); $topSuppliers = $this->service->getTopSuppliers($startDate, $endDate); $topCustomers = $this->service->getTopCustomers($startDate, $endDate); $topProducts = $this->service->getTopProducts($startDate, $endDate); $marketingSales = $this->service->getMarketingSales($startDate, $endDate); return Inertia::render('admin/analysis/index', [ 'filters' => [ 'start_date' => $startDate, 'end_date' => $endDate, ], 'attendance' => $attendance, 'myAttendance' => $myAttendance, 'isManager' => $isManager, 'cashOverview' => $cashOverview, 'rawMaterialStock' => $rawMaterialStock, 'productStock' => $productStock, 'revenueSummary' => $revenueSummary, 'monthlyRevenue' => $monthlyRevenue, 'monthlyRevenueByChannel' => $monthlyRevenueByChannel, 'revenueByPaymentType' => $revenueByPaymentType, 'expenseSummary' => $expenseSummary, 'monthlyExpense' => $monthlyExpense, 'busyHours' => $busyHours, 'profitMetrics' => $profitMetrics, 'topSuppliers' => $topSuppliers, 'topCustomers' => $topCustomers, 'topProducts' => $topProducts, 'marketingSales' => $marketingSales, ]); } }