Bladeren bron

account transactions report wip

3.x
Andrew Wallo 1 jaar geleden
bovenliggende
commit
41d284b73b

+ 2
- 0
app/Contracts/ExportableReport.php Bestand weergeven

@@ -18,4 +18,6 @@ interface ExportableReport
18 18
     public function getOverallTotals(): array;
19 19
 
20 20
     public function getColumns(): array;
21
+
22
+    public function getPdfView(): string;
21 23
 }

+ 1
- 1
app/DTO/ReportCategoryDTO.php Bestand weergeven

@@ -7,6 +7,6 @@ class ReportCategoryDTO
7 7
     public function __construct(
8 8
         public array $header,
9 9
         public array $data,
10
-        public array $summary,
10
+        public array $summary = [],
11 11
     ) {}
12 12
 }

+ 5
- 0
app/Filament/Company/Pages/Reports/BaseReportPage.php Bestand weergeven

@@ -178,6 +178,11 @@ abstract class BaseReportPage extends Page
178 178
             ->statePath('toggledTableColumns');
179 179
     }
180 180
 
181
+    protected function hasToggleableColumns(): bool
182
+    {
183
+        return ! empty($this->getTableColumnToggleFormSchema());
184
+    }
185
+
181 186
     /**
182 187
      * @return array<Checkbox>
183 188
      */

+ 17
- 6
app/Services/ExportService.php Bestand weergeven

@@ -10,7 +10,7 @@ use Symfony\Component\HttpFoundation\StreamedResponse;
10 10
 
11 11
 class ExportService
12 12
 {
13
-    public function exportToCsv(Company $company, ExportableReport $report, string $startDate, string $endDate): StreamedResponse
13
+    public function exportToCsv(Company $company, ExportableReport $report, string $startDate, string $endDate, bool $separateCategoryHeaders = false): StreamedResponse
14 14
     {
15 15
         $formattedStartDate = Carbon::parse($startDate)->format('Y-m-d');
16 16
         $formattedEndDate = Carbon::parse($endDate)->format('Y-m-d');
@@ -24,7 +24,7 @@ class ExportService
24 24
             'Content-Disposition' => 'attachment; filename="' . $filename . '"',
25 25
         ];
26 26
 
27
-        $callback = function () use ($report, $company, $formattedStartDate, $formattedEndDate) {
27
+        $callback = function () use ($report, $company, $formattedStartDate, $formattedEndDate, $separateCategoryHeaders) {
28 28
             $file = fopen('php://output', 'wb');
29 29
 
30 30
             fputcsv($file, [$report->getTitle()]);
@@ -35,17 +35,28 @@ class ExportService
35 35
             fputcsv($file, $report->getHeaders());
36 36
 
37 37
             foreach ($report->getCategories() as $category) {
38
-                fputcsv($file, $category->header);
38
+                if (isset($category->header[0]) && is_array($category->header[0])) {
39
+                    foreach ($category->header as $headerRow) {
40
+                        fputcsv($file, $headerRow);
41
+                    }
42
+                } else {
43
+                    fputcsv($file, $category->header);
44
+                }
39 45
 
40 46
                 foreach ($category->data as $accountRow) {
41 47
                     fputcsv($file, $accountRow);
42 48
                 }
43 49
 
44
-                fputcsv($file, $category->summary);
50
+                if (filled($category->summary)) {
51
+                    fputcsv($file, $category->summary);
52
+                }
53
+
45 54
                 fputcsv($file, []); // Empty row for spacing
46 55
             }
47 56
 
48
-            fputcsv($file, $report->getOverallTotals());
57
+            if (filled($report->getOverallTotals())) {
58
+                fputcsv($file, $report->getOverallTotals());
59
+            }
49 60
 
50 61
             fclose($file);
51 62
         };
@@ -62,7 +73,7 @@ class ExportService
62 73
 
63 74
         $filename = $company->name . ' ' . $report->getTitle() . ' ' . $formattedStartDate . ' to ' . $formattedEndDate . ' ' . $timestamp . '.pdf';
64 75
 
65
-        $pdf = Pdf::loadView('components.company.reports.report-pdf', [
76
+        $pdf = Pdf::loadView($report->getPdfView(), [
66 77
             'company' => $company,
67 78
             'report' => $report,
68 79
             'startDate' => Carbon::parse($startDate)->format('M d, Y'),

+ 1
- 2
app/Services/ReportService.php Bestand weergeven

@@ -9,7 +9,6 @@ use App\DTO\AccountTransactionDTO;
9 9
 use App\DTO\ReportDTO;
10 10
 use App\Enums\Accounting\AccountCategory;
11 11
 use App\Models\Accounting\Account;
12
-use App\Models\Accounting\JournalEntry;
13 12
 use App\Support\Column;
14 13
 use App\Utilities\Currency\CurrencyAccessor;
15 14
 use Illuminate\Database\Eloquent\Builder;
@@ -173,7 +172,7 @@ class ReportService
173 172
 
174 173
             $reportCategories[] = [
175 174
                 'category' => $account->name,
176
-                'under' => 'Under: ' . $account->category->getLabel() . ' > ' . $account->subtype->name,
175
+                'under' => $account->category->getLabel() . ' > ' . $account->subtype->name,
177 176
                 'transactions' => $accountTransactions,
178 177
             ];
179 178
         }

+ 15
- 17
app/Transformers/AccountTransactionReportTransformer.php Bestand weergeven

@@ -2,13 +2,17 @@
2 2
 
3 3
 namespace App\Transformers;
4 4
 
5
-use App\DTO\AccountDTO;
6 5
 use App\DTO\AccountTransactionDTO;
7 6
 use App\DTO\ReportCategoryDTO;
8 7
 use App\Support\Column;
9 8
 
10 9
 class AccountTransactionReportTransformer extends BaseReportTransformer
11 10
 {
11
+    public function getPdfView(): string
12
+    {
13
+        return 'components.company.reports.account-transactions-report-pdf';
14
+    }
15
+
12 16
     public function getTitle(): string
13 17
     {
14 18
         return 'Account Transactions';
@@ -28,17 +32,19 @@ class AccountTransactionReportTransformer extends BaseReportTransformer
28 32
 
29 33
         foreach ($this->report->categories as $categoryData) {
30 34
             // Initialize header with account and category information
35
+
31 36
             $header = [
32
-                [
33
-                    'column' => 'category',
34
-                    'value' => $categoryData['category'],
35
-                ],
36
-                [
37
-                    'column' => 'under',
38
-                    'value' => $categoryData['under'],
39
-                ],
37
+                array_fill(0, count($this->getColumns()), ''),
38
+                array_fill(0, count($this->getColumns()), ''),
40 39
             ];
41 40
 
41
+            foreach ($this->getColumns() as $index => $column) {
42
+                if ($column->getName() === 'date') {
43
+                    $header[0][$index] = $categoryData['category'];
44
+                    $header[1][$index] = $categoryData['under'];
45
+                }
46
+            }
47
+
42 48
             // Map transaction data
43 49
             $data = array_map(function (AccountTransactionDTO $transaction) {
44 50
                 $row = [];
@@ -57,17 +63,9 @@ class AccountTransactionReportTransformer extends BaseReportTransformer
57 63
                 return $row;
58 64
             }, $categoryData['transactions']);
59 65
 
60
-            // Extract summary from the last transaction if it's "Totals and Ending Balance"
61
-            $summary = [];
62
-            if (count($data) > 1) {
63
-                $summaryTransaction = end($data);
64
-                $summary = array_slice($summaryTransaction, 1); // Skip the first element, which is the date
65
-            }
66
-
67 66
             $categories[] = new ReportCategoryDTO(
68 67
                 header: $header,
69 68
                 data: $data,
70
-                summary: $summary
71 69
             );
72 70
         }
73 71
 

+ 5
- 0
app/Transformers/BaseReportTransformer.php Bestand weergeven

@@ -21,6 +21,11 @@ abstract class BaseReportTransformer implements ExportableReport, Wireable
21 21
         return $this->report->fields;
22 22
     }
23 23
 
24
+    public function getPdfView(): string
25
+    {
26
+        return 'components.company.reports.report-pdf';
27
+    }
28
+
24 29
     public function getAlignmentClass(int $index): string
25 30
     {
26 31
         $column = $this->getColumns()[$index];

+ 24
- 24
composer.lock Bestand weergeven

@@ -497,16 +497,16 @@
497 497
         },
498 498
         {
499 499
             "name": "aws/aws-sdk-php",
500
-            "version": "3.315.4",
500
+            "version": "3.315.5",
501 501
             "source": {
502 502
                 "type": "git",
503 503
                 "url": "https://github.com/aws/aws-sdk-php.git",
504
-                "reference": "8d2cf34e22262b983ce3d7e38d11667c5792b93f"
504
+                "reference": "3e6d619d45d8e1a8681dd58de61ddfe90e8341e6"
505 505
             },
506 506
             "dist": {
507 507
                 "type": "zip",
508
-                "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/8d2cf34e22262b983ce3d7e38d11667c5792b93f",
509
-                "reference": "8d2cf34e22262b983ce3d7e38d11667c5792b93f",
508
+                "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/3e6d619d45d8e1a8681dd58de61ddfe90e8341e6",
509
+                "reference": "3e6d619d45d8e1a8681dd58de61ddfe90e8341e6",
510 510
                 "shasum": ""
511 511
             },
512 512
             "require": {
@@ -586,9 +586,9 @@
586 586
             "support": {
587 587
                 "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
588 588
                 "issues": "https://github.com/aws/aws-sdk-php/issues",
589
-                "source": "https://github.com/aws/aws-sdk-php/tree/3.315.4"
589
+                "source": "https://github.com/aws/aws-sdk-php/tree/3.315.5"
590 590
             },
591
-            "time": "2024-07-02T18:09:03+00:00"
591
+            "time": "2024-07-03T18:12:51+00:00"
592 592
         },
593 593
         {
594 594
             "name": "aws/aws-sdk-php-laravel",
@@ -4401,16 +4401,16 @@
4401 4401
         },
4402 4402
         {
4403 4403
             "name": "livewire/livewire",
4404
-            "version": "v3.5.1",
4404
+            "version": "v3.5.2",
4405 4405
             "source": {
4406 4406
                 "type": "git",
4407 4407
                 "url": "https://github.com/livewire/livewire.git",
4408
-                "reference": "da044261bb5c5449397f18fda3409f14acf47c0a"
4408
+                "reference": "636725c1f87bc7844dd80277488268db27eec1aa"
4409 4409
             },
4410 4410
             "dist": {
4411 4411
                 "type": "zip",
4412
-                "url": "https://api.github.com/repos/livewire/livewire/zipball/da044261bb5c5449397f18fda3409f14acf47c0a",
4413
-                "reference": "da044261bb5c5449397f18fda3409f14acf47c0a",
4412
+                "url": "https://api.github.com/repos/livewire/livewire/zipball/636725c1f87bc7844dd80277488268db27eec1aa",
4413
+                "reference": "636725c1f87bc7844dd80277488268db27eec1aa",
4414 4414
                 "shasum": ""
4415 4415
             },
4416 4416
             "require": {
@@ -4465,7 +4465,7 @@
4465 4465
             "description": "A front-end framework for Laravel.",
4466 4466
             "support": {
4467 4467
                 "issues": "https://github.com/livewire/livewire/issues",
4468
-                "source": "https://github.com/livewire/livewire/tree/v3.5.1"
4468
+                "source": "https://github.com/livewire/livewire/tree/v3.5.2"
4469 4469
             },
4470 4470
             "funding": [
4471 4471
                 {
@@ -4473,7 +4473,7 @@
4473 4473
                     "type": "github"
4474 4474
                 }
4475 4475
             ],
4476
-            "time": "2024-06-18T11:10:42+00:00"
4476
+            "time": "2024-07-03T17:22:45+00:00"
4477 4477
         },
4478 4478
         {
4479 4479
             "name": "masterminds/html5",
@@ -10816,16 +10816,16 @@
10816 10816
         },
10817 10817
         {
10818 10818
             "name": "phpunit/phpunit",
10819
-            "version": "10.5.24",
10819
+            "version": "10.5.25",
10820 10820
             "source": {
10821 10821
                 "type": "git",
10822 10822
                 "url": "https://github.com/sebastianbergmann/phpunit.git",
10823
-                "reference": "5f124e3e3e561006047b532fd0431bf5bb6b9015"
10823
+                "reference": "831bf82312be6037e811833ddbea0b8de60ea314"
10824 10824
             },
10825 10825
             "dist": {
10826 10826
                 "type": "zip",
10827
-                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5f124e3e3e561006047b532fd0431bf5bb6b9015",
10828
-                "reference": "5f124e3e3e561006047b532fd0431bf5bb6b9015",
10827
+                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/831bf82312be6037e811833ddbea0b8de60ea314",
10828
+                "reference": "831bf82312be6037e811833ddbea0b8de60ea314",
10829 10829
                 "shasum": ""
10830 10830
             },
10831 10831
             "require": {
@@ -10897,7 +10897,7 @@
10897 10897
             "support": {
10898 10898
                 "issues": "https://github.com/sebastianbergmann/phpunit/issues",
10899 10899
                 "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
10900
-                "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.24"
10900
+                "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.25"
10901 10901
             },
10902 10902
             "funding": [
10903 10903
                 {
@@ -10913,7 +10913,7 @@
10913 10913
                     "type": "tidelift"
10914 10914
                 }
10915 10915
             ],
10916
-            "time": "2024-06-20T13:09:54+00:00"
10916
+            "time": "2024-07-03T05:49:17+00:00"
10917 10917
         },
10918 10918
         {
10919 10919
             "name": "rector/rector",
@@ -12272,16 +12272,16 @@
12272 12272
         },
12273 12273
         {
12274 12274
             "name": "spatie/laravel-ray",
12275
-            "version": "1.36.3",
12275
+            "version": "1.37.0",
12276 12276
             "source": {
12277 12277
                 "type": "git",
12278 12278
                 "url": "https://github.com/spatie/laravel-ray.git",
12279
-                "reference": "9becea4bf279d9bc5e11f89ef36894239d2be60e"
12279
+                "reference": "f57b294a3815be37effa9d13f54f2fbe5a2fff37"
12280 12280
             },
12281 12281
             "dist": {
12282 12282
                 "type": "zip",
12283
-                "url": "https://api.github.com/repos/spatie/laravel-ray/zipball/9becea4bf279d9bc5e11f89ef36894239d2be60e",
12284
-                "reference": "9becea4bf279d9bc5e11f89ef36894239d2be60e",
12283
+                "url": "https://api.github.com/repos/spatie/laravel-ray/zipball/f57b294a3815be37effa9d13f54f2fbe5a2fff37",
12284
+                "reference": "f57b294a3815be37effa9d13f54f2fbe5a2fff37",
12285 12285
                 "shasum": ""
12286 12286
             },
12287 12287
             "require": {
@@ -12343,7 +12343,7 @@
12343 12343
             ],
12344 12344
             "support": {
12345 12345
                 "issues": "https://github.com/spatie/laravel-ray/issues",
12346
-                "source": "https://github.com/spatie/laravel-ray/tree/1.36.3"
12346
+                "source": "https://github.com/spatie/laravel-ray/tree/1.37.0"
12347 12347
             },
12348 12348
             "funding": [
12349 12349
                 {
@@ -12355,7 +12355,7 @@
12355 12355
                     "type": "other"
12356 12356
                 }
12357 12357
             ],
12358
-            "time": "2024-07-02T13:33:54+00:00"
12358
+            "time": "2024-07-03T08:48:44+00:00"
12359 12359
         },
12360 12360
         {
12361 12361
             "name": "spatie/macroable",

+ 7
- 7
package-lock.json Bestand weergeven

@@ -931,9 +931,9 @@
931 931
             }
932 932
         },
933 933
         "node_modules/caniuse-lite": {
934
-            "version": "1.0.30001639",
935
-            "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001639.tgz",
936
-            "integrity": "sha512-eFHflNTBIlFwP2AIKaYuBQN/apnUoKNhBdza8ZnW/h2di4LCZ4xFqYlxUxo+LQ76KFI1PGcC1QDxMbxTZpSCAg==",
934
+            "version": "1.0.30001640",
935
+            "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001640.tgz",
936
+            "integrity": "sha512-lA4VMpW0PSUrFnkmVuEKBUovSWKhj7puyCg8StBChgu298N1AtuF1sKWEvfDuimSEDbhlb/KqPKC3fs1HbuQUA==",
937 937
             "dev": true,
938 938
             "funding": [
939 939
                 {
@@ -2375,13 +2375,13 @@
2375 2375
             "dev": true
2376 2376
         },
2377 2377
         "node_modules/vite": {
2378
-            "version": "5.3.2",
2379
-            "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.2.tgz",
2380
-            "integrity": "sha512-6lA7OBHBlXUxiJxbO5aAY2fsHHzDr1q7DvXYnyZycRs2Dz+dXBWuhpWHvmljTRTpQC2uvGmUFFkSHF2vGo90MA==",
2378
+            "version": "5.3.3",
2379
+            "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.3.tgz",
2380
+            "integrity": "sha512-NPQdeCU0Dv2z5fu+ULotpuq5yfCS1BzKUIPhNbP3YBfAMGJXbt2nS+sbTFu+qchaqWTD+H3JK++nRwr6XIcp6A==",
2381 2381
             "dev": true,
2382 2382
             "dependencies": {
2383 2383
                 "esbuild": "^0.21.3",
2384
-                "postcss": "^8.4.38",
2384
+                "postcss": "^8.4.39",
2385 2385
                 "rollup": "^4.13.0"
2386 2386
             },
2387 2387
             "bin": {

+ 143
- 0
resources/views/components/company/reports/account-transactions-report-pdf.blade.php Bestand weergeven

@@ -0,0 +1,143 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+<head>
4
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+    <meta name="viewport" content="width=device-width, initial-scale=1">
6
+    <title>{{ $report->getTitle() }}</title>
7
+    <style>
8
+        @page {
9
+            size: auto;
10
+            margin: 10mm 7.5mm;
11
+        }
12
+
13
+        .header {
14
+            color: #374151;
15
+            margin-bottom: 1rem;
16
+        }
17
+
18
+        .header > * + * {
19
+            margin-top: 0.5rem;
20
+        }
21
+
22
+        .table-head {
23
+            display: table-row-group;
24
+        }
25
+
26
+        .text-left {
27
+            text-align: left;
28
+        }
29
+
30
+        .text-right {
31
+            text-align: right;
32
+        }
33
+
34
+        .text-center {
35
+            text-align: center;
36
+        }
37
+
38
+        .table-class th,
39
+        .table-class td {
40
+            color: #374151;
41
+        }
42
+
43
+        .title {
44
+            font-size: 1.5rem;
45
+        }
46
+
47
+        .company-name {
48
+            font-size: 1.125rem;
49
+            font-weight: 600;
50
+        }
51
+
52
+        .date-range {
53
+            font-size: 0.875rem;
54
+        }
55
+
56
+        .table-class {
57
+            width: 100%;
58
+            border-collapse: collapse;
59
+        }
60
+
61
+        .table-class th,
62
+        .table-class td {
63
+            padding: 0.75rem;
64
+            font-size: 0.75rem;
65
+            line-height: 1rem;
66
+            border-bottom: 1px solid #d1d5db; /* Gray border for all rows */
67
+        }
68
+
69
+        .category-header-row > td {
70
+            background-color: #f3f4f6; /* Gray background for category names */
71
+            font-weight: 600;
72
+        }
73
+
74
+        .table-body tr {
75
+            background-color: #ffffff; /* White background for other rows */
76
+        }
77
+
78
+        .spacer-row > td {
79
+            height: 0.75rem;
80
+        }
81
+
82
+        .category-summary-row > td,
83
+        .table-footer-row > td {
84
+            font-weight: 600;
85
+            background-color: #ffffff; /* White background for footer */
86
+        }
87
+    </style>
88
+</head>
89
+<body>
90
+<div class="header">
91
+    <div class="title">{{ $report->getTitle() }}</div>
92
+    <div class="company-name">{{ $company->name }}</div>
93
+    <div class="date-range">Date Range: {{ $startDate }} to {{ $endDate }}</div>
94
+</div>
95
+<table class="table-class">
96
+    <thead class="table-head">
97
+    <tr>
98
+        @foreach($report->getHeaders() as $index => $header)
99
+            <th class="{{ $report->getAlignmentClass($index) }}">
100
+                {{ $header }}
101
+            </th>
102
+        @endforeach
103
+    </tr>
104
+    </thead>
105
+    @foreach($report->getCategories() as $category)
106
+        <tbody>
107
+        <tr class="category-header-row">
108
+            <td colspan="{{ count($report->getHeaders()) }}">
109
+                <div>
110
+                    @foreach($category->header as $headerRow)
111
+                        <div>
112
+                            @foreach($headerRow as $headerValue)
113
+                                @if (!empty($headerValue))
114
+                                    {{ $headerValue }}
115
+                                @endif
116
+                            @endforeach
117
+                        </div>
118
+                    @endforeach
119
+                </div>
120
+            </td>
121
+        </tr>
122
+        @foreach($category->data as $dataIndex => $transaction)
123
+            <tr
124
+                @class([
125
+                    'category-header-row' => $loop->first || $loop->last || $loop->remaining === 1,
126
+                ])>
127
+                @foreach($transaction as $cellIndex => $cell)
128
+                    <td class="{{ $report->getAlignmentClass($cellIndex) }}">
129
+                        {{ $cell }}
130
+                    </td>
131
+                @endforeach
132
+            </tr>
133
+        @endforeach
134
+        @unless($loop->last)
135
+            <tr class="spacer-row">
136
+                <td colspan="{{ count($report->getHeaders()) }}"></td>
137
+            </tr>
138
+        @endunless
139
+        </tbody>
140
+    @endforeach
141
+</table>
142
+</body>
143
+</html>

+ 9
- 19
resources/views/components/company/tables/reports/account-transactions.blade.php Bestand weergeven

@@ -16,12 +16,15 @@
16 16
             <tr class="bg-gray-50 dark:bg-white/5">
17 17
                 <x-filament-tables::cell colspan="{{ count($report->getHeaders()) }}" class="text-left">
18 18
                     <div class="px-3 py-2">
19
-                        <div class="text-sm font-semibold text-gray-950 dark:text-white">
20
-                            {{ $category->header[0]['value'] }}
21
-                        </div>
22
-                        <div class="text-sm text-gray-700 dark:text-gray-300">
23
-                            {{ $category->header[1]['value'] }}
24
-                        </div>
19
+                        @foreach ($category->header as $headerRow)
20
+                            <div class="text-sm {{ $loop->first ? 'font-semibold text-gray-950 dark:text-white' : 'text-gray-500 dark:text-white/50' }}">
21
+                                @foreach ($headerRow as $headerValue)
22
+                                    @if (!empty($headerValue))
23
+                                        {{ $headerValue }}
24
+                                    @endif
25
+                                @endforeach
26
+                            </div>
27
+                        @endforeach
25 28
                     </div>
26 29
                 </x-filament-tables::cell>
27 30
             </tr>
@@ -54,17 +57,4 @@
54 57
             @endunless
55 58
         </tbody>
56 59
     @endforeach
57
-    @if (filled($report->getOverallTotals()))
58
-        <tfoot>
59
-            <tr class="bg-gray-50 dark:bg-white/5">
60
-                @foreach($report->getOverallTotals() as $index => $total)
61
-                    <x-filament-tables::cell wire:key="footer-total-{{ $index }}" class="{{ $report->getAlignmentClass($index) }}">
62
-                        <div class="px-3 py-2 text-sm leading-6 font-semibold text-gray-950 dark:text-white">
63
-                            {{ $total }}
64
-                        </div>
65
-                    </x-filament-tables::cell>
66
-                @endforeach
67
-            </tr>
68
-        </tfoot>
69
-    @endif
70 60
 </table>

+ 7
- 5
resources/views/filament/company/pages/reports/account-transactions.blade.php Bestand weergeven

@@ -5,11 +5,13 @@
5 5
                 <form wire:submit.prevent="loadReportData">
6 6
                     <div class="flex flex-col lg:flex-row items-start lg:items-center justify-center gap-4 lg:gap-12">
7 7
                         {{ $this->form }}
8
-                        <x-filament-tables::column-toggle.dropdown
9
-                            class="my-auto"
10
-                            :form="$this->toggleTableColumnForm"
11
-                            :trigger-action="$this->toggleColumnsAction"
12
-                        />
8
+                        @if($this->hasToggleableColumns())
9
+                            <x-filament-tables::column-toggle.dropdown
10
+                                class="my-auto"
11
+                                :form="$this->toggleTableColumnForm"
12
+                                :trigger-action="$this->toggleColumnsAction"
13
+                            />
14
+                        @endif
13 15
                         <x-filament::button type="submit" class="flex-shrink-0">
14 16
                             Update Report
15 17
                         </x-filament::button>

+ 7
- 5
resources/views/filament/company/pages/reports/detailed-report.blade.php Bestand weergeven

@@ -5,11 +5,13 @@
5 5
                 <form wire:submit.prevent="loadReportData">
6 6
                     <div class="flex flex-col lg:flex-row items-start lg:items-center justify-center gap-4 lg:gap-12">
7 7
                         {{ $this->form }}
8
-                        <x-filament-tables::column-toggle.dropdown
9
-                            class="my-auto"
10
-                            :form="$this->toggleTableColumnForm"
11
-                            :trigger-action="$this->toggleColumnsAction"
12
-                        />
8
+                        @if($this->hasToggleableColumns())
9
+                            <x-filament-tables::column-toggle.dropdown
10
+                                class="my-auto"
11
+                                :form="$this->toggleTableColumnForm"
12
+                                :trigger-action="$this->toggleColumnsAction"
13
+                            />
14
+                        @endif
13 15
                         <x-filament::button type="submit" class="flex-shrink-0">
14 16
                             Update Report
15 17
                         </x-filament::button>

Laden…
Annuleren
Opslaan