Andrew Wallo 11 月之前
父節點
當前提交
064bbb3c53

+ 4
- 0
app/Filament/Company/Pages/Reports/CashFlowStatement.php 查看文件

38
     public function getTable(): array
38
     public function getTable(): array
39
     {
39
     {
40
         return [
40
         return [
41
+            Column::make('account_code')
42
+                ->label('Account Code')
43
+                ->toggleable()
44
+                ->alignment(Alignment::Center),
41
             Column::make('account_name')
45
             Column::make('account_name')
42
                 ->label('Account')
46
                 ->label('Account')
43
                 ->alignment(Alignment::Left),
47
                 ->alignment(Alignment::Left),

+ 21
- 0
app/Transformers/CashFlowStatementReportTransformer.php 查看文件

199
         ];
199
         ];
200
     }
200
     }
201
 
201
 
202
+    public function getSummaryAlignedWithColumns(): array
203
+    {
204
+        $summary = [];
205
+
206
+        foreach ($this->getSummary() as $summaryItem) {
207
+            $row = [];
208
+
209
+            foreach ($this->getColumns() as $column) {
210
+                $row[$column->getName()] = match ($column->getName()) {
211
+                    'account_name' => $summaryItem['label'] ?? '',
212
+                    'net_movement' => $summaryItem['value'] ?? '',
213
+                    default => '',
214
+                };
215
+            }
216
+
217
+            $summary[] = $row;
218
+        }
219
+
220
+        return $summary;
221
+    }
222
+
202
     public function getOverview(): array
223
     public function getOverview(): array
203
     {
224
     {
204
         $categories = [];
225
         $categories = [];

+ 5
- 5
composer.lock 查看文件

10783
         },
10783
         },
10784
         {
10784
         {
10785
             "name": "phpstan/phpstan",
10785
             "name": "phpstan/phpstan",
10786
-            "version": "1.12.8",
10786
+            "version": "1.12.9",
10787
             "source": {
10787
             "source": {
10788
                 "type": "git",
10788
                 "type": "git",
10789
                 "url": "https://github.com/phpstan/phpstan.git",
10789
                 "url": "https://github.com/phpstan/phpstan.git",
10790
-                "reference": "f6a60a4d66142b8156c9da923f1972657bc4748c"
10790
+                "reference": "ceb937fb39a92deabc02d20709cf14b2c452502c"
10791
             },
10791
             },
10792
             "dist": {
10792
             "dist": {
10793
                 "type": "zip",
10793
                 "type": "zip",
10794
-                "url": "https://api.github.com/repos/phpstan/phpstan/zipball/f6a60a4d66142b8156c9da923f1972657bc4748c",
10795
-                "reference": "f6a60a4d66142b8156c9da923f1972657bc4748c",
10794
+                "url": "https://api.github.com/repos/phpstan/phpstan/zipball/ceb937fb39a92deabc02d20709cf14b2c452502c",
10795
+                "reference": "ceb937fb39a92deabc02d20709cf14b2c452502c",
10796
                 "shasum": ""
10796
                 "shasum": ""
10797
             },
10797
             },
10798
             "require": {
10798
             "require": {
10837
                     "type": "github"
10837
                     "type": "github"
10838
                 }
10838
                 }
10839
             ],
10839
             ],
10840
-            "time": "2024-11-06T19:06:49+00:00"
10840
+            "time": "2024-11-10T17:10:04+00:00"
10841
         },
10841
         },
10842
         {
10842
         {
10843
             "name": "phpunit/php-code-coverage",
10843
             "name": "phpunit/php-code-coverage",

+ 10
- 10
resources/views/components/company/tables/reports/cash-flow-statement.blade.php 查看文件

170
         </tr>
170
         </tr>
171
         @if($overviewCategory->header['account_name'] === 'Starting Balance')
171
         @if($overviewCategory->header['account_name'] === 'Starting Balance')
172
             <!-- Insert Gross Cash Inflow, Gross Cash Outflow, and Net Cash Change here -->
172
             <!-- Insert Gross Cash Inflow, Gross Cash Outflow, and Net Cash Change here -->
173
-            @foreach($report->getSummary() as $summaryItem)
173
+            @foreach($report->getSummaryAlignedWithColumns() as $summaryRow)
174
                 <tr>
174
                 <tr>
175
-                    <x-company.tables.cell :alignment-class="$report->getAlignmentClass('account_name')"
176
-                                           :bold="$loop->last">
177
-                        {{ $summaryItem['label'] }}
178
-                    </x-company.tables.cell>
179
-                    <x-company.tables.cell :alignment-class="$report->getAlignmentClass('net_movement')"
180
-                                           :bold="$loop->last" :underline-bold="$loop->last"
181
-                                           :underline-thin="$loop->remaining === 1">
182
-                        {{ $summaryItem['value'] }}
183
-                    </x-company.tables.cell>
175
+                    @foreach($summaryRow as $summaryIndex => $summaryCell)
176
+                        <x-company.tables.cell :alignment-class="$report->getAlignmentClass($summaryIndex)"
177
+                                               :bold="$loop->parent->last"
178
+                                               :underline-bold="$loop->parent->last && $summaryIndex === 'net_movement'"
179
+                                               :underline-thin="$loop->parent->remaining === 1 && $summaryIndex === 'net_movement'"
180
+                        >
181
+                            {{ $summaryCell }}
182
+                        </x-company.tables.cell>
183
+                    @endforeach
184
                 </tr>
184
                 </tr>
185
             @endforeach
185
             @endforeach
186
         @endif
186
         @endif

Loading…
取消
儲存