reportService = $reportService; $this->exportService = $exportService; } public function getTable(): array { return [ Column::make('account_code') ->label('Account Code') ->toggleable() ->alignment(Alignment::Center), Column::make('account_name') ->label('Account') ->alignment(Alignment::Left), Column::make('debit_balance') ->label('Debit') ->toggleable() ->alignment(Alignment::Right), Column::make('credit_balance') ->label('Credit') ->toggleable() ->alignment(Alignment::Right), ]; } public function form(Form $form): Form { return $form ->inlineLabel() ->columns([ 'lg' => 1, '2xl' => 2, ]) ->live() ->schema([ $this->getDateRangeFormComponent(), Cluster::make([ $this->getStartDateFormComponent(), $this->getEndDateFormComponent(), ])->hiddenLabel(), ]); } protected function buildReport(array $columns): ReportDTO { return $this->reportService->buildTrialBalanceReport($this->startDate, $this->endDate, $columns); } protected function getTransformer(ReportDTO $reportDTO): ExportableReport { return new TrialBalanceReportTransformer($reportDTO); } public function exportCSV(): StreamedResponse { return $this->exportService->exportToCsv($this->company, $this->report, $this->startDate, $this->endDate); } public function exportPDF(): StreamedResponse { return $this->exportService->exportToPdf($this->company, $this->report, $this->startDate, $this->endDate); } }