Доработал отчет для экономистов
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user