From 2d212119fc0499258ffd2d46fb07535a2212d121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Sat, 11 Jan 2025 16:02:32 +0000 Subject: [PATCH] Fixed report print, pdf and export styling.. --- app/Abstracts/Report.php | 4 ++-- app/Exports/Common/Reports.php | 2 +- resources/views/components/reports/detail/table/row.blade.php | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Abstracts/Report.php b/app/Abstracts/Report.php index c1bac74af..e4e9ceedb 100644 --- a/app/Abstracts/Report.php +++ b/app/Abstracts/Report.php @@ -256,12 +256,12 @@ abstract class Report public function print() { - return view($this->views['print'])->with('class', $this); + return view($this->views['print'], ['print' => true])->with('class', $this); } public function pdf() { - $view = view($this->views['print'])->with('class', $this)->render(); + $view = view($this->views['print'], ['print' => true])->with('class', $this)->render(); $html = mb_convert_encoding($view, 'HTML-ENTITIES', 'UTF-8'); diff --git a/app/Exports/Common/Reports.php b/app/Exports/Common/Reports.php index 32716f5a2..482ebc696 100644 --- a/app/Exports/Common/Reports.php +++ b/app/Exports/Common/Reports.php @@ -24,7 +24,7 @@ class Reports implements FromView, ShouldAutoSize, WithTitle public function view(): View { - return view($this->view, ['class' => $this->class]); + return view($this->view, ['class' => $this->class, 'print' => true]); } public function title(): string diff --git a/resources/views/components/reports/detail/table/row.blade.php b/resources/views/components/reports/detail/table/row.blade.php index f911de415..b22831f5a 100644 --- a/resources/views/components/reports/detail/table/row.blade.php +++ b/resources/views/components/reports/detail/table/row.blade.php @@ -49,12 +49,13 @@
{{ $class->row_names[$table_key][$id] }} - @if (array_sum($parent_row_values) != array_sum($class->row_values[$table_key][$id])) + @if (! $print && array_sum($parent_row_values) != array_sum($class->row_values[$table_key][$id])) @endif
+ @foreach($parent_row_values as $row) {{ $class->has_money ? money($row) : $row }}