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

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

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

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

@@ -199,6 +199,27 @@ class CashFlowStatementReportTransformer extends SummaryReportTransformer
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 223
     public function getOverview(): array
203 224
     {
204 225
         $categories = [];

+ 5
- 5
composer.lock 查看文件

@@ -10783,16 +10783,16 @@
10783 10783
         },
10784 10784
         {
10785 10785
             "name": "phpstan/phpstan",
10786
-            "version": "1.12.8",
10786
+            "version": "1.12.9",
10787 10787
             "source": {
10788 10788
                 "type": "git",
10789 10789
                 "url": "https://github.com/phpstan/phpstan.git",
10790
-                "reference": "f6a60a4d66142b8156c9da923f1972657bc4748c"
10790
+                "reference": "ceb937fb39a92deabc02d20709cf14b2c452502c"
10791 10791
             },
10792 10792
             "dist": {
10793 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 10796
                 "shasum": ""
10797 10797
             },
10798 10798
             "require": {
@@ -10837,7 +10837,7 @@
10837 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 10843
             "name": "phpunit/php-code-coverage",

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

@@ -170,17 +170,17 @@
170 170
         </tr>
171 171
         @if($overviewCategory->header['account_name'] === 'Starting Balance')
172 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 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 184
                 </tr>
185 185
             @endforeach
186 186
         @endif

Loading…
取消
儲存