Andrew Wallo 8 months ago
parent
commit
d6891765de
1 changed files with 6 additions and 1 deletions
  1. 6
    1
      app/Services/ReportService.php

+ 6
- 1
app/Services/ReportService.php View File

11
 use App\DTO\ReportDTO;
11
 use App\DTO\ReportDTO;
12
 use App\Enums\Accounting\AccountCategory;
12
 use App\Enums\Accounting\AccountCategory;
13
 use App\Enums\Accounting\AccountType;
13
 use App\Enums\Accounting\AccountType;
14
+use App\Enums\Accounting\TransactionType;
14
 use App\Models\Accounting\Account;
15
 use App\Models\Accounting\Account;
15
 use App\Models\Accounting\Transaction;
16
 use App\Models\Accounting\Transaction;
16
 use App\Support\Column;
17
 use App\Support\Column;
261
         if ($transaction->transactionable_type === null || $transaction->is_payment) {
262
         if ($transaction->transactionable_type === null || $transaction->is_payment) {
262
             return [
263
             return [
263
                 'type' => 'transaction',
264
                 'type' => 'transaction',
264
-                'action' => $transaction->type->isJournal() ? 'updateJournalTransaction' : 'updateTransaction',
265
+                'action' => match ($transaction->type) {
266
+                    TransactionType::Journal => 'updateJournalTransaction',
267
+                    TransactionType::Transfer => 'updateTransfer',
268
+                    default => 'updateTransaction',
269
+                },
265
                 'id' => $transaction->id,
270
                 'id' => $transaction->id,
266
             ];
271
             ];
267
         }
272
         }

Loading…
Cancel
Save