Доработал отчет для экономистов

This commit is contained in:
brusnitsyn
2026-06-25 17:04:42 +09:00
parent 7495b0e3cb
commit d322317d06
6 changed files with 873 additions and 396 deletions

View File

@@ -62,7 +62,10 @@ class StatisticController extends Controller
$isRangeOneDay = $this->dateService->isRangeOneDay($startDate, $endDate);
$finalData = $this->statisticsService->getStatisticsData($user, $startDate, $endDate, $isRangeOneDay);
$profitTypeData = $user->isEconomist()
? $this->statisticsService->getProfitTypeBreakdown($user, $startDate, $endDate)
: [];
return Excel::download(new StatisticsExport($finalData['data'], [$startDate, $endDate]), 'statistics.xlsx');
return Excel::download(new StatisticsExport($finalData['data'], [$startDate, $endDate], $user, $profitTypeData), 'statistics.xlsx');
}
}