Andrew Wallo 1 year ago
parent
commit
c5d7d4093f

+ 3
- 0
app/DTO/AccountDTO.php View File

@@ -9,6 +9,7 @@ class AccountDTO implements Wireable
9 9
     public function __construct(
10 10
         public string $accountName,
11 11
         public string $accountCode,
12
+        public ?int $accountId,
12 13
         public AccountBalanceDTO $balance,
13 14
     ) {}
14 15
 
@@ -17,6 +18,7 @@ class AccountDTO implements Wireable
17 18
         return [
18 19
             'accountName' => $this->accountName,
19 20
             'accountCode' => $this->accountCode,
21
+            'accountId' => $this->accountId,
20 22
             'balance' => $this->balance->toLivewire(),
21 23
         ];
22 24
     }
@@ -26,6 +28,7 @@ class AccountDTO implements Wireable
26 28
         return new static(
27 29
             $value['accountName'],
28 30
             $value['accountCode'],
31
+            $value['accountId'],
29 32
             AccountBalanceDTO::fromLivewire($value['balance']),
30 33
         );
31 34
     }

+ 1
- 0
app/DTO/AccountTransactionDTO.php View File

@@ -5,6 +5,7 @@ namespace App\DTO;
5 5
 class AccountTransactionDTO
6 6
 {
7 7
     public function __construct(
8
+        public ?int $id,
8 9
         public string $date,
9 10
         public string $description,
10 11
         public string $debit,

+ 11
- 0
app/Filament/Company/Pages/Accounting/Transactions.php View File

@@ -90,6 +90,17 @@ class Transactions extends Page implements HasTable
90 90
         return static::getModel()::query();
91 91
     }
92 92
 
93
+    public function openModalForTransaction($recordId): void
94
+    {
95
+        $record = Transaction::findOrFail($recordId);
96
+
97
+        if ($record->type->isJournal()) {
98
+            $this->mountTableAction('updateJournalTransaction', $record->id);
99
+        } else {
100
+            $this->mountTableAction('updateTransaction', $record->id);
101
+        }
102
+    }
103
+
93 104
     protected function getHeaderActions(): array
94 105
     {
95 106
         return [

+ 2
- 0
app/Filament/Company/Pages/Reports/AccountTransactions.php View File

@@ -18,6 +18,7 @@ use Filament\Tables\Actions\Action;
18 18
 use Guava\FilamentClusters\Forms\Cluster;
19 19
 use Illuminate\Contracts\Support\Htmlable;
20 20
 use Illuminate\Support\Collection;
21
+use Livewire\Attributes\Url;
21 22
 use Symfony\Component\HttpFoundation\StreamedResponse;
22 23
 
23 24
 class AccountTransactions extends BaseReportPage
@@ -32,6 +33,7 @@ class AccountTransactions extends BaseReportPage
32 33
 
33 34
     protected ExportService $exportService;
34 35
 
36
+    #[Url]
35 37
     public ?string $account_id = 'all';
36 38
 
37 39
     public function boot(ReportService $reportService, ExportService $exportService): void

+ 9
- 2
app/Services/ReportService.php View File

@@ -12,8 +12,8 @@ use App\Models\Accounting\Account;
12 12
 use App\Support\Column;
13 13
 use App\Utilities\Currency\CurrencyAccessor;
14 14
 use Illuminate\Database\Eloquent\Builder;
15
-use Illuminate\Database\Eloquent\Collection;
16 15
 use Illuminate\Database\Eloquent\Relations\Relation;
16
+use Illuminate\Support\Collection;
17 17
 
18 18
 class ReportService
19 19
 {
@@ -46,7 +46,7 @@ class ReportService
46 46
     private function getCategoryGroupedAccounts(array $allCategories): Collection
47 47
     {
48 48
         return Account::whereHas('journalEntries')
49
-            ->select('id', 'name', 'currency_code', 'category', 'code')
49
+            ->select(['id', 'name', 'currency_code', 'category', 'code'])
50 50
             ->get()
51 51
             ->groupBy(fn (Account $account) => $account->category->getPluralLabel())
52 52
             ->sortBy(static fn (Collection $groupedAccounts, string $key) => array_search($key, $allCategories, true));
@@ -115,6 +115,7 @@ class ReportService
115 115
             $totalCredit = 0;
116 116
 
117 117
             $accountTransactions[] = new AccountTransactionDTO(
118
+                id: null,
118 119
                 date: 'Starting Balance',
119 120
                 description: '',
120 121
                 debit: '',
@@ -131,6 +132,7 @@ class ReportService
131 132
                 $currentBalance -= $journalEntry->total_credit;
132 133
 
133 134
                 $accountTransactions[] = new AccountTransactionDTO(
135
+                    id: $transaction->id,
134 136
                     date: $transaction->posted_at->format('Y-m-d'),
135 137
                     description: $transaction->description ?? '',
136 138
                     debit: $journalEntry->total_debit ? money($journalEntry->total_debit, $defaultCurrency)->format() : '',
@@ -142,6 +144,7 @@ class ReportService
142 144
             $balanceChange = $currentBalance - ($startingBalance?->getAmount() ?? 0);
143 145
 
144 146
             $accountTransactions[] = new AccountTransactionDTO(
147
+                id: null,
145 148
                 date: 'Totals and Ending Balance',
146 149
                 description: '',
147 150
                 debit: money($totalDebit, $defaultCurrency)->format(),
@@ -150,6 +153,7 @@ class ReportService
150 153
             );
151 154
 
152 155
             $accountTransactions[] = new AccountTransactionDTO(
156
+                id: null,
153 157
                 date: 'Balance Change',
154 158
                 description: '',
155 159
                 debit: '',
@@ -202,6 +206,7 @@ class ReportService
202 206
                 $categoryAccounts[] = new AccountDTO(
203 207
                     $account->name,
204 208
                     $account->code,
209
+                    $account->id,
205 210
                     $formattedAccountBalances,
206 211
                 );
207 212
             }
@@ -215,6 +220,7 @@ class ReportService
215 220
                     $categoryAccounts[] = new AccountDTO(
216 221
                         'Retained Earnings',
217 222
                         'RE',
223
+                        null,
218 224
                         $this->formatBalances(['debit_balance' => 0, 'credit_balance' => $retainedEarningsAmount])
219 225
                     );
220 226
                 } else {
@@ -222,6 +228,7 @@ class ReportService
222 228
                     $categoryAccounts[] = new AccountDTO(
223 229
                         'Retained Earnings',
224 230
                         'RE',
231
+                        null,
225 232
                         $this->formatBalances(['debit_balance' => abs($retainedEarningsAmount), 'credit_balance' => 0])
226 233
                     );
227 234
                 }

+ 4
- 1
app/Transformers/AccountBalanceReportTransformer.php View File

@@ -43,7 +43,10 @@ class AccountBalanceReportTransformer extends BaseReportTransformer
43 43
                 foreach ($this->getColumns() as $column) {
44 44
                     $row[] = match ($column->getName()) {
45 45
                         'account_code' => $account->accountCode,
46
-                        'account_name' => $account->accountName,
46
+                        'account_name' => [
47
+                            'name' => $account->accountName,
48
+                            'id' => $account->accountId ?? null,
49
+                        ],
47 50
                         'starting_balance' => $account->balance->startingBalance ?? '',
48 51
                         'debit_balance' => $account->balance->debitBalance,
49 52
                         'credit_balance' => $account->balance->creditBalance,

+ 4
- 1
app/Transformers/AccountTransactionReportTransformer.php View File

@@ -52,7 +52,10 @@ class AccountTransactionReportTransformer extends BaseReportTransformer
52 52
                 foreach ($this->getColumns() as $column) {
53 53
                     $row[] = match ($column->getName()) {
54 54
                         'date' => $transaction->date,
55
-                        'description' => $transaction->description,
55
+                        'description' => [
56
+                            'id' => $transaction->id ?? null,
57
+                            'description' => $transaction->description,
58
+                        ],
56 59
                         'debit' => $transaction->debit,
57 60
                         'credit' => $transaction->credit,
58 61
                         'balance' => $transaction->balance,

+ 4
- 1
app/Transformers/TrialBalanceReportTransformer.php View File

@@ -43,7 +43,10 @@ class TrialBalanceReportTransformer extends BaseReportTransformer
43 43
                 foreach ($this->getColumns() as $column) {
44 44
                     $row[] = match ($column->getName()) {
45 45
                         'account_code' => $account->accountCode,
46
-                        'account_name' => $account->accountName,
46
+                        'account_name' => [
47
+                            'name' => $account->accountName,
48
+                            'id' => $account->accountId ?? null,
49
+                        ],
47 50
                         'debit_balance' => $account->balance->debitBalance,
48 51
                         'credit_balance' => $account->balance->creditBalance,
49 52
                         default => '',

+ 84
- 84
composer.lock View File

@@ -8,16 +8,16 @@
8 8
     "packages": [
9 9
         {
10 10
             "name": "akaunting/laravel-money",
11
-            "version": "5.2.0",
11
+            "version": "5.2.1",
12 12
             "source": {
13 13
                 "type": "git",
14 14
                 "url": "https://github.com/akaunting/laravel-money.git",
15
-                "reference": "c6710ee50ad9a394e3f607a0ebbc64905c308e69"
15
+                "reference": "6cc8abb912286c671de5993ffbcd3225588aeace"
16 16
             },
17 17
             "dist": {
18 18
                 "type": "zip",
19
-                "url": "https://api.github.com/repos/akaunting/laravel-money/zipball/c6710ee50ad9a394e3f607a0ebbc64905c308e69",
20
-                "reference": "c6710ee50ad9a394e3f607a0ebbc64905c308e69",
19
+                "url": "https://api.github.com/repos/akaunting/laravel-money/zipball/6cc8abb912286c671de5993ffbcd3225588aeace",
20
+                "reference": "6cc8abb912286c671de5993ffbcd3225588aeace",
21 21
                 "shasum": ""
22 22
             },
23 23
             "require": {
@@ -71,9 +71,9 @@
71 71
             ],
72 72
             "support": {
73 73
                 "issues": "https://github.com/akaunting/laravel-money/issues",
74
-                "source": "https://github.com/akaunting/laravel-money/tree/5.2.0"
74
+                "source": "https://github.com/akaunting/laravel-money/tree/5.2.1"
75 75
             },
76
-            "time": "2024-03-19T21:43:10+00:00"
76
+            "time": "2024-07-23T15:01:26+00:00"
77 77
         },
78 78
         {
79 79
             "name": "andrewdwallo/filament-companies",
@@ -2490,24 +2490,24 @@
2490 2490
         },
2491 2491
         {
2492 2492
             "name": "graham-campbell/result-type",
2493
-            "version": "v1.1.2",
2493
+            "version": "v1.1.3",
2494 2494
             "source": {
2495 2495
                 "type": "git",
2496 2496
                 "url": "https://github.com/GrahamCampbell/Result-Type.git",
2497
-                "reference": "fbd48bce38f73f8a4ec8583362e732e4095e5862"
2497
+                "reference": "3ba905c11371512af9d9bdd27d99b782216b6945"
2498 2498
             },
2499 2499
             "dist": {
2500 2500
                 "type": "zip",
2501
-                "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/fbd48bce38f73f8a4ec8583362e732e4095e5862",
2502
-                "reference": "fbd48bce38f73f8a4ec8583362e732e4095e5862",
2501
+                "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/3ba905c11371512af9d9bdd27d99b782216b6945",
2502
+                "reference": "3ba905c11371512af9d9bdd27d99b782216b6945",
2503 2503
                 "shasum": ""
2504 2504
             },
2505 2505
             "require": {
2506 2506
                 "php": "^7.2.5 || ^8.0",
2507
-                "phpoption/phpoption": "^1.9.2"
2507
+                "phpoption/phpoption": "^1.9.3"
2508 2508
             },
2509 2509
             "require-dev": {
2510
-                "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2"
2510
+                "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28"
2511 2511
             },
2512 2512
             "type": "library",
2513 2513
             "autoload": {
@@ -2536,7 +2536,7 @@
2536 2536
             ],
2537 2537
             "support": {
2538 2538
                 "issues": "https://github.com/GrahamCampbell/Result-Type/issues",
2539
-                "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.2"
2539
+                "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.3"
2540 2540
             },
2541 2541
             "funding": [
2542 2542
                 {
@@ -2548,7 +2548,7 @@
2548 2548
                     "type": "tidelift"
2549 2549
                 }
2550 2550
             ],
2551
-            "time": "2023-11-12T22:16:48+00:00"
2551
+            "time": "2024-07-20T21:45:45+00:00"
2552 2552
         },
2553 2553
         {
2554 2554
             "name": "guava/filament-clusters",
@@ -2627,16 +2627,16 @@
2627 2627
         },
2628 2628
         {
2629 2629
             "name": "guzzlehttp/guzzle",
2630
-            "version": "7.9.0",
2630
+            "version": "7.9.1",
2631 2631
             "source": {
2632 2632
                 "type": "git",
2633 2633
                 "url": "https://github.com/guzzle/guzzle.git",
2634
-                "reference": "84ac2b2afc44e40d3e8e658a45d68d6d20437612"
2634
+                "reference": "a629e5b69db96eb4939c1b34114130077dd4c6fc"
2635 2635
             },
2636 2636
             "dist": {
2637 2637
                 "type": "zip",
2638
-                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/84ac2b2afc44e40d3e8e658a45d68d6d20437612",
2639
-                "reference": "84ac2b2afc44e40d3e8e658a45d68d6d20437612",
2638
+                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a629e5b69db96eb4939c1b34114130077dd4c6fc",
2639
+                "reference": "a629e5b69db96eb4939c1b34114130077dd4c6fc",
2640 2640
                 "shasum": ""
2641 2641
             },
2642 2642
             "require": {
@@ -2733,7 +2733,7 @@
2733 2733
             ],
2734 2734
             "support": {
2735 2735
                 "issues": "https://github.com/guzzle/guzzle/issues",
2736
-                "source": "https://github.com/guzzle/guzzle/tree/7.9.0"
2736
+                "source": "https://github.com/guzzle/guzzle/tree/7.9.1"
2737 2737
             },
2738 2738
             "funding": [
2739 2739
                 {
@@ -2749,7 +2749,7 @@
2749 2749
                     "type": "tidelift"
2750 2750
                 }
2751 2751
             ],
2752
-            "time": "2024-07-18T11:52:56+00:00"
2752
+            "time": "2024-07-19T16:19:57+00:00"
2753 2753
         },
2754 2754
         {
2755 2755
             "name": "guzzlehttp/promises",
@@ -3167,16 +3167,16 @@
3167 3167
         },
3168 3168
         {
3169 3169
             "name": "laravel/framework",
3170
-            "version": "v11.16.0",
3170
+            "version": "v11.17.0",
3171 3171
             "source": {
3172 3172
                 "type": "git",
3173 3173
                 "url": "https://github.com/laravel/framework.git",
3174
-                "reference": "bd4808aaf103ccb5cb4b00bcee46140c070c0ec4"
3174
+                "reference": "42f505a0c8afc0743f73e70bec08e641e2870bd6"
3175 3175
             },
3176 3176
             "dist": {
3177 3177
                 "type": "zip",
3178
-                "url": "https://api.github.com/repos/laravel/framework/zipball/bd4808aaf103ccb5cb4b00bcee46140c070c0ec4",
3179
-                "reference": "bd4808aaf103ccb5cb4b00bcee46140c070c0ec4",
3178
+                "url": "https://api.github.com/repos/laravel/framework/zipball/42f505a0c8afc0743f73e70bec08e641e2870bd6",
3179
+                "reference": "42f505a0c8afc0743f73e70bec08e641e2870bd6",
3180 3180
                 "shasum": ""
3181 3181
             },
3182 3182
             "require": {
@@ -3369,7 +3369,7 @@
3369 3369
                 "issues": "https://github.com/laravel/framework/issues",
3370 3370
                 "source": "https://github.com/laravel/framework"
3371 3371
             },
3372
-            "time": "2024-07-16T14:33:07+00:00"
3372
+            "time": "2024-07-23T16:33:27+00:00"
3373 3373
         },
3374 3374
         {
3375 3375
             "name": "laravel/prompts",
@@ -3693,16 +3693,16 @@
3693 3693
         },
3694 3694
         {
3695 3695
             "name": "league/commonmark",
3696
-            "version": "2.4.2",
3696
+            "version": "2.5.0",
3697 3697
             "source": {
3698 3698
                 "type": "git",
3699 3699
                 "url": "https://github.com/thephpleague/commonmark.git",
3700
-                "reference": "91c24291965bd6d7c46c46a12ba7492f83b1cadf"
3700
+                "reference": "0026475f5c9a104410ae824cb5a4d63fa3bdb1df"
3701 3701
             },
3702 3702
             "dist": {
3703 3703
                 "type": "zip",
3704
-                "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/91c24291965bd6d7c46c46a12ba7492f83b1cadf",
3705
-                "reference": "91c24291965bd6d7c46c46a12ba7492f83b1cadf",
3704
+                "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/0026475f5c9a104410ae824cb5a4d63fa3bdb1df",
3705
+                "reference": "0026475f5c9a104410ae824cb5a4d63fa3bdb1df",
3706 3706
                 "shasum": ""
3707 3707
             },
3708 3708
             "require": {
@@ -3715,8 +3715,8 @@
3715 3715
             },
3716 3716
             "require-dev": {
3717 3717
                 "cebe/markdown": "^1.0",
3718
-                "commonmark/cmark": "0.30.3",
3719
-                "commonmark/commonmark.js": "0.30.0",
3718
+                "commonmark/cmark": "0.31.0",
3719
+                "commonmark/commonmark.js": "0.31.0",
3720 3720
                 "composer/package-versions-deprecated": "^1.8",
3721 3721
                 "embed/embed": "^4.4",
3722 3722
                 "erusev/parsedown": "^1.0",
@@ -3738,7 +3738,7 @@
3738 3738
             "type": "library",
3739 3739
             "extra": {
3740 3740
                 "branch-alias": {
3741
-                    "dev-main": "2.5-dev"
3741
+                    "dev-main": "2.6-dev"
3742 3742
                 }
3743 3743
             },
3744 3744
             "autoload": {
@@ -3795,7 +3795,7 @@
3795 3795
                     "type": "tidelift"
3796 3796
                 }
3797 3797
             ],
3798
-            "time": "2024-02-02T11:59:32+00:00"
3798
+            "time": "2024-07-22T18:18:14+00:00"
3799 3799
         },
3800 3800
         {
3801 3801
             "name": "league/config",
@@ -5240,16 +5240,16 @@
5240 5240
         },
5241 5241
         {
5242 5242
             "name": "openspout/openspout",
5243
-            "version": "v4.24.3",
5243
+            "version": "v4.24.4",
5244 5244
             "source": {
5245 5245
                 "type": "git",
5246 5246
                 "url": "https://github.com/openspout/openspout.git",
5247
-                "reference": "27de0c4d4a5b97927ece3e4dcbb7b48cb12e8a34"
5247
+                "reference": "e5f92c5c9e6cc44119918da66bb097a0ffc202b2"
5248 5248
             },
5249 5249
             "dist": {
5250 5250
                 "type": "zip",
5251
-                "url": "https://api.github.com/repos/openspout/openspout/zipball/27de0c4d4a5b97927ece3e4dcbb7b48cb12e8a34",
5252
-                "reference": "27de0c4d4a5b97927ece3e4dcbb7b48cb12e8a34",
5251
+                "url": "https://api.github.com/repos/openspout/openspout/zipball/e5f92c5c9e6cc44119918da66bb097a0ffc202b2",
5252
+                "reference": "e5f92c5c9e6cc44119918da66bb097a0ffc202b2",
5253 5253
                 "shasum": ""
5254 5254
             },
5255 5255
             "require": {
@@ -5317,7 +5317,7 @@
5317 5317
             ],
5318 5318
             "support": {
5319 5319
                 "issues": "https://github.com/openspout/openspout/issues",
5320
-                "source": "https://github.com/openspout/openspout/tree/v4.24.3"
5320
+                "source": "https://github.com/openspout/openspout/tree/v4.24.4"
5321 5321
             },
5322 5322
             "funding": [
5323 5323
                 {
@@ -5329,7 +5329,7 @@
5329 5329
                     "type": "github"
5330 5330
                 }
5331 5331
             ],
5332
-            "time": "2024-07-12T12:32:17+00:00"
5332
+            "time": "2024-07-22T09:30:54+00:00"
5333 5333
         },
5334 5334
         {
5335 5335
             "name": "paragonie/constant_time_encoding",
@@ -5450,16 +5450,16 @@
5450 5450
         },
5451 5451
         {
5452 5452
             "name": "phpoption/phpoption",
5453
-            "version": "1.9.2",
5453
+            "version": "1.9.3",
5454 5454
             "source": {
5455 5455
                 "type": "git",
5456 5456
                 "url": "https://github.com/schmittjoh/php-option.git",
5457
-                "reference": "80735db690fe4fc5c76dfa7f9b770634285fa820"
5457
+                "reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54"
5458 5458
             },
5459 5459
             "dist": {
5460 5460
                 "type": "zip",
5461
-                "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/80735db690fe4fc5c76dfa7f9b770634285fa820",
5462
-                "reference": "80735db690fe4fc5c76dfa7f9b770634285fa820",
5461
+                "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/e3fac8b24f56113f7cb96af14958c0dd16330f54",
5462
+                "reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54",
5463 5463
                 "shasum": ""
5464 5464
             },
5465 5465
             "require": {
@@ -5467,13 +5467,13 @@
5467 5467
             },
5468 5468
             "require-dev": {
5469 5469
                 "bamarni/composer-bin-plugin": "^1.8.2",
5470
-                "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2"
5470
+                "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28"
5471 5471
             },
5472 5472
             "type": "library",
5473 5473
             "extra": {
5474 5474
                 "bamarni-bin": {
5475 5475
                     "bin-links": true,
5476
-                    "forward-command": true
5476
+                    "forward-command": false
5477 5477
                 },
5478 5478
                 "branch-alias": {
5479 5479
                     "dev-master": "1.9-dev"
@@ -5509,7 +5509,7 @@
5509 5509
             ],
5510 5510
             "support": {
5511 5511
                 "issues": "https://github.com/schmittjoh/php-option/issues",
5512
-                "source": "https://github.com/schmittjoh/php-option/tree/1.9.2"
5512
+                "source": "https://github.com/schmittjoh/php-option/tree/1.9.3"
5513 5513
             },
5514 5514
             "funding": [
5515 5515
                 {
@@ -5521,7 +5521,7 @@
5521 5521
                     "type": "tidelift"
5522 5522
                 }
5523 5523
             ],
5524
-            "time": "2023-11-12T21:59:55+00:00"
5524
+            "time": "2024-07-20T21:41:07+00:00"
5525 5525
         },
5526 5526
         {
5527 5527
             "name": "phpseclib/phpseclib",
@@ -9270,23 +9270,23 @@
9270 9270
         },
9271 9271
         {
9272 9272
             "name": "vlucas/phpdotenv",
9273
-            "version": "v5.6.0",
9273
+            "version": "v5.6.1",
9274 9274
             "source": {
9275 9275
                 "type": "git",
9276 9276
                 "url": "https://github.com/vlucas/phpdotenv.git",
9277
-                "reference": "2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4"
9277
+                "reference": "a59a13791077fe3d44f90e7133eb68e7d22eaff2"
9278 9278
             },
9279 9279
             "dist": {
9280 9280
                 "type": "zip",
9281
-                "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4",
9282
-                "reference": "2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4",
9281
+                "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/a59a13791077fe3d44f90e7133eb68e7d22eaff2",
9282
+                "reference": "a59a13791077fe3d44f90e7133eb68e7d22eaff2",
9283 9283
                 "shasum": ""
9284 9284
             },
9285 9285
             "require": {
9286 9286
                 "ext-pcre": "*",
9287
-                "graham-campbell/result-type": "^1.1.2",
9287
+                "graham-campbell/result-type": "^1.1.3",
9288 9288
                 "php": "^7.2.5 || ^8.0",
9289
-                "phpoption/phpoption": "^1.9.2",
9289
+                "phpoption/phpoption": "^1.9.3",
9290 9290
                 "symfony/polyfill-ctype": "^1.24",
9291 9291
                 "symfony/polyfill-mbstring": "^1.24",
9292 9292
                 "symfony/polyfill-php80": "^1.24"
@@ -9303,7 +9303,7 @@
9303 9303
             "extra": {
9304 9304
                 "bamarni-bin": {
9305 9305
                     "bin-links": true,
9306
-                    "forward-command": true
9306
+                    "forward-command": false
9307 9307
                 },
9308 9308
                 "branch-alias": {
9309 9309
                     "dev-master": "5.6-dev"
@@ -9338,7 +9338,7 @@
9338 9338
             ],
9339 9339
             "support": {
9340 9340
                 "issues": "https://github.com/vlucas/phpdotenv/issues",
9341
-                "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.0"
9341
+                "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.1"
9342 9342
             },
9343 9343
             "funding": [
9344 9344
                 {
@@ -9350,7 +9350,7 @@
9350 9350
                     "type": "tidelift"
9351 9351
                 }
9352 9352
             ],
9353
-            "time": "2023-11-12T22:43:29+00:00"
9353
+            "time": "2024-07-20T21:52:34+00:00"
9354 9354
         },
9355 9355
         {
9356 9356
             "name": "voku/portable-ascii",
@@ -9673,16 +9673,16 @@
9673 9673
         },
9674 9674
         {
9675 9675
             "name": "laravel/pint",
9676
-            "version": "v1.16.2",
9676
+            "version": "v1.17.0",
9677 9677
             "source": {
9678 9678
                 "type": "git",
9679 9679
                 "url": "https://github.com/laravel/pint.git",
9680
-                "reference": "51f1ba679a6afe0315621ad143d788bd7ded0eca"
9680
+                "reference": "4dba80c1de4b81dc4c4fb10ea6f4781495eb29f5"
9681 9681
             },
9682 9682
             "dist": {
9683 9683
                 "type": "zip",
9684
-                "url": "https://api.github.com/repos/laravel/pint/zipball/51f1ba679a6afe0315621ad143d788bd7ded0eca",
9685
-                "reference": "51f1ba679a6afe0315621ad143d788bd7ded0eca",
9684
+                "url": "https://api.github.com/repos/laravel/pint/zipball/4dba80c1de4b81dc4c4fb10ea6f4781495eb29f5",
9685
+                "reference": "4dba80c1de4b81dc4c4fb10ea6f4781495eb29f5",
9686 9686
                 "shasum": ""
9687 9687
             },
9688 9688
             "require": {
@@ -9735,20 +9735,20 @@
9735 9735
                 "issues": "https://github.com/laravel/pint/issues",
9736 9736
                 "source": "https://github.com/laravel/pint"
9737 9737
             },
9738
-            "time": "2024-07-09T15:58:08+00:00"
9738
+            "time": "2024-07-23T16:40:20+00:00"
9739 9739
         },
9740 9740
         {
9741 9741
             "name": "laravel/sail",
9742
-            "version": "v1.30.2",
9742
+            "version": "v1.31.0",
9743 9743
             "source": {
9744 9744
                 "type": "git",
9745 9745
                 "url": "https://github.com/laravel/sail.git",
9746
-                "reference": "f5a9699a1001e15de1aa5e7cb5c9f50a3f63f887"
9746
+                "reference": "48d89608a3bb5be763c9bb87121d31e7da27c1cb"
9747 9747
             },
9748 9748
             "dist": {
9749 9749
                 "type": "zip",
9750
-                "url": "https://api.github.com/repos/laravel/sail/zipball/f5a9699a1001e15de1aa5e7cb5c9f50a3f63f887",
9751
-                "reference": "f5a9699a1001e15de1aa5e7cb5c9f50a3f63f887",
9750
+                "url": "https://api.github.com/repos/laravel/sail/zipball/48d89608a3bb5be763c9bb87121d31e7da27c1cb",
9751
+                "reference": "48d89608a3bb5be763c9bb87121d31e7da27c1cb",
9752 9752
                 "shasum": ""
9753 9753
             },
9754 9754
             "require": {
@@ -9798,7 +9798,7 @@
9798 9798
                 "issues": "https://github.com/laravel/sail/issues",
9799 9799
                 "source": "https://github.com/laravel/sail"
9800 9800
             },
9801
-            "time": "2024-07-05T16:01:51+00:00"
9801
+            "time": "2024-07-22T14:36:50+00:00"
9802 9802
         },
9803 9803
         {
9804 9804
             "name": "mockery/mockery",
@@ -10215,16 +10215,16 @@
10215 10215
         },
10216 10216
         {
10217 10217
             "name": "php-di/php-di",
10218
-            "version": "7.0.6",
10218
+            "version": "7.0.7",
10219 10219
             "source": {
10220 10220
                 "type": "git",
10221 10221
                 "url": "https://github.com/PHP-DI/PHP-DI.git",
10222
-                "reference": "8097948a89f6ec782839b3e958432f427cac37fd"
10222
+                "reference": "e87435e3c0e8f22977adc5af0d5cdcc467e15cf1"
10223 10223
             },
10224 10224
             "dist": {
10225 10225
                 "type": "zip",
10226
-                "url": "https://api.github.com/repos/PHP-DI/PHP-DI/zipball/8097948a89f6ec782839b3e958432f427cac37fd",
10227
-                "reference": "8097948a89f6ec782839b3e958432f427cac37fd",
10226
+                "url": "https://api.github.com/repos/PHP-DI/PHP-DI/zipball/e87435e3c0e8f22977adc5af0d5cdcc467e15cf1",
10227
+                "reference": "e87435e3c0e8f22977adc5af0d5cdcc467e15cf1",
10228 10228
                 "shasum": ""
10229 10229
             },
10230 10230
             "require": {
@@ -10272,7 +10272,7 @@
10272 10272
             ],
10273 10273
             "support": {
10274 10274
                 "issues": "https://github.com/PHP-DI/PHP-DI/issues",
10275
-                "source": "https://github.com/PHP-DI/PHP-DI/tree/7.0.6"
10275
+                "source": "https://github.com/PHP-DI/PHP-DI/tree/7.0.7"
10276 10276
             },
10277 10277
             "funding": [
10278 10278
                 {
@@ -10284,7 +10284,7 @@
10284 10284
                     "type": "tidelift"
10285 10285
                 }
10286 10286
             ],
10287
-            "time": "2023-11-02T10:04:50+00:00"
10287
+            "time": "2024-07-21T15:55:45+00:00"
10288 10288
         },
10289 10289
         {
10290 10290
             "name": "phpstan/phpstan",
@@ -11743,16 +11743,16 @@
11743 11743
         },
11744 11744
         {
11745 11745
             "name": "spatie/backtrace",
11746
-            "version": "1.6.1",
11746
+            "version": "1.6.2",
11747 11747
             "source": {
11748 11748
                 "type": "git",
11749 11749
                 "url": "https://github.com/spatie/backtrace.git",
11750
-                "reference": "8373b9d51638292e3bfd736a9c19a654111b4a23"
11750
+                "reference": "1a9a145b044677ae3424693f7b06479fc8c137a9"
11751 11751
             },
11752 11752
             "dist": {
11753 11753
                 "type": "zip",
11754
-                "url": "https://api.github.com/repos/spatie/backtrace/zipball/8373b9d51638292e3bfd736a9c19a654111b4a23",
11755
-                "reference": "8373b9d51638292e3bfd736a9c19a654111b4a23",
11754
+                "url": "https://api.github.com/repos/spatie/backtrace/zipball/1a9a145b044677ae3424693f7b06479fc8c137a9",
11755
+                "reference": "1a9a145b044677ae3424693f7b06479fc8c137a9",
11756 11756
                 "shasum": ""
11757 11757
             },
11758 11758
             "require": {
@@ -11790,7 +11790,7 @@
11790 11790
                 "spatie"
11791 11791
             ],
11792 11792
             "support": {
11793
-                "source": "https://github.com/spatie/backtrace/tree/1.6.1"
11793
+                "source": "https://github.com/spatie/backtrace/tree/1.6.2"
11794 11794
             },
11795 11795
             "funding": [
11796 11796
                 {
@@ -11802,20 +11802,20 @@
11802 11802
                     "type": "other"
11803 11803
                 }
11804 11804
             ],
11805
-            "time": "2024-04-24T13:22:11+00:00"
11805
+            "time": "2024-07-22T08:21:24+00:00"
11806 11806
         },
11807 11807
         {
11808 11808
             "name": "spatie/error-solutions",
11809
-            "version": "1.0.5",
11809
+            "version": "1.1.0",
11810 11810
             "source": {
11811 11811
                 "type": "git",
11812 11812
                 "url": "https://github.com/spatie/error-solutions.git",
11813
-                "reference": "4bb6c734dc992b2db3e26df1ef021c75d2218b13"
11813
+                "reference": "a014da18f2675ea15af0ba97f7e9aee59e13964f"
11814 11814
             },
11815 11815
             "dist": {
11816 11816
                 "type": "zip",
11817
-                "url": "https://api.github.com/repos/spatie/error-solutions/zipball/4bb6c734dc992b2db3e26df1ef021c75d2218b13",
11818
-                "reference": "4bb6c734dc992b2db3e26df1ef021c75d2218b13",
11817
+                "url": "https://api.github.com/repos/spatie/error-solutions/zipball/a014da18f2675ea15af0ba97f7e9aee59e13964f",
11818
+                "reference": "a014da18f2675ea15af0ba97f7e9aee59e13964f",
11819 11819
                 "shasum": ""
11820 11820
             },
11821 11821
             "require": {
@@ -11868,7 +11868,7 @@
11868 11868
             ],
11869 11869
             "support": {
11870 11870
                 "issues": "https://github.com/spatie/error-solutions/issues",
11871
-                "source": "https://github.com/spatie/error-solutions/tree/1.0.5"
11871
+                "source": "https://github.com/spatie/error-solutions/tree/1.1.0"
11872 11872
             },
11873 11873
             "funding": [
11874 11874
                 {
@@ -11876,7 +11876,7 @@
11876 11876
                     "type": "github"
11877 11877
                 }
11878 11878
             ],
11879
-            "time": "2024-07-09T12:13:32+00:00"
11879
+            "time": "2024-07-22T08:18:22+00:00"
11880 11880
         },
11881 11881
         {
11882 11882
             "name": "spatie/flare-client-php",

+ 309
- 114
package-lock.json
File diff suppressed because it is too large
View File


+ 8
- 8
resources/views/components/company/reports/account-transactions-report-pdf.blade.php View File

@@ -35,6 +35,14 @@
35 35
             color: #374151;
36 36
         }
37 37
 
38
+        .whitespace-normal {
39
+            white-space: normal;
40
+        }
41
+
42
+        .whitespace-nowrap {
43
+            white-space: nowrap;
44
+        }
45
+
38 46
         .title {
39 47
             font-size: 1.5rem;
40 48
         }
@@ -61,14 +69,6 @@
61 69
             border-bottom: 1px solid #d1d5db; /* Gray border for all rows */
62 70
         }
63 71
 
64
-        .whitespace-normal {
65
-            white-space: normal;
66
-        }
67
-
68
-        .whitespace-nowrap {
69
-            white-space: nowrap;
70
-        }
71
-
72 72
         .category-header-row > td {
73 73
             background-color: #f3f4f6; /* Gray background for category names */
74 74
             font-weight: 600;

+ 14
- 2
resources/views/components/company/reports/report-pdf.blade.php View File

@@ -35,6 +35,14 @@
35 35
             color: #374151;
36 36
         }
37 37
 
38
+        .whitespace-normal {
39
+            white-space: normal;
40
+        }
41
+
42
+        .whitespace-nowrap {
43
+            white-space: nowrap;
44
+        }
45
+
38 46
         .title {
39 47
             font-size: 1.5rem;
40 48
         }
@@ -109,8 +117,12 @@
109 117
         @foreach($category->data as $account)
110 118
             <tr>
111 119
                 @foreach($account as $index => $cell)
112
-                    <td class="{{ $report->getAlignmentClass($index) }}">
113
-                        {{ $cell }}
120
+                    <td class="{{ $report->getAlignmentClass($index) }} {{ $index === 1 ? 'whitespace-normal' : 'whitespace-nowrap' }}">
121
+                        @if(isset($cell['id']) && isset($cell['name']))
122
+                            {{ $cell['name'] }}
123
+                        @else
124
+                            {{ $cell }}
125
+                        @endif
114 126
                     </td>
115 127
                 @endforeach
116 128
             </tr>

+ 75
- 54
resources/views/components/company/tables/reports/account-transactions.blade.php View File

@@ -1,68 +1,89 @@
1 1
 <table class="w-full table-auto divide-y divide-gray-200 dark:divide-white/5">
2 2
     <thead class="divide-y divide-gray-200 dark:divide-white/5">
3
-        <tr class="bg-gray-50 dark:bg-white/5">
4
-            @foreach($report->getHeaders() as $index => $header)
5
-                <th wire:key="header-{{ $index }}" class="px-3 py-3.5 sm:first-of-type:ps-6 sm:last-of-type:pe-6 {{ $report->getAlignmentClass($index) }}">
3
+    <tr class="bg-gray-50 dark:bg-white/5">
4
+        @foreach($report->getHeaders() as $index => $header)
5
+            <th wire:key="header-{{ $index }}"
6
+                class="px-3 py-3.5 sm:first-of-type:ps-6 sm:last-of-type:pe-6 {{ $report->getAlignmentClass($index) }}">
6 7
                     <span class="text-sm font-semibold text-gray-950 dark:text-white">
7 8
                         {{ $header }}
8 9
                     </span>
9
-                </th>
10
-            @endforeach
11
-        </tr>
10
+            </th>
11
+        @endforeach
12
+    </tr>
12 13
     </thead>
13 14
     @foreach($report->getCategories() as $categoryIndex => $category)
14
-        <tbody wire:key="category-{{ $categoryIndex }}" class="divide-y divide-gray-200 whitespace-nowrap dark:divide-white/5">
15
-            <!-- Category Header -->
16
-            <tr class="bg-gray-50 dark:bg-white/5">
17
-                <x-filament-tables::cell colspan="{{ count($report->getHeaders()) }}" class="text-left">
18
-                    <div class="px-3 py-2">
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
28
-                    </div>
29
-                </x-filament-tables::cell>
30
-            </tr>
31
-            <!-- Transactions Data -->
32
-            @foreach($category->data as $dataIndex => $transaction)
33
-                <tr wire:key="category-{{ $categoryIndex }}-data-{{ $dataIndex }}"
34
-                    @class([
35
-                        'bg-gray-50 dark:bg-white/5' => $loop->first || $loop->last || $loop->remaining === 1,
36
-                    ])
37
-                >
38
-                    @foreach($transaction as $cellIndex => $cell)
39
-                        <x-filament-tables::cell
40
-                            wire:key="category-{{ $categoryIndex }}-data-{{ $dataIndex }}-cell-{{ $cellIndex }}"
41
-                             @class([
42
-                                $report->getAlignmentClass($cellIndex),
43
-                                'whitespace-normal' => $cellIndex === 1,
15
+        <tbody wire:key="category-{{ $categoryIndex }}"
16
+               class="divide-y divide-gray-200 whitespace-nowrap dark:divide-white/5">
17
+        <!-- Category Header -->
18
+        <tr class="bg-gray-50 dark:bg-white/5">
19
+            <x-filament-tables::cell colspan="{{ count($report->getHeaders()) }}" class="text-left">
20
+                <div class="px-3 py-2">
21
+                    @foreach ($category->header as $headerRow)
22
+                        <div
23
+                            class="text-sm {{ $loop->first ? 'font-semibold text-gray-950 dark:text-white' : 'text-gray-500 dark:text-white/50' }}">
24
+                            @foreach ($headerRow as $headerValue)
25
+                                @if (!empty($headerValue))
26
+                                    {{ $headerValue }}
27
+                                @endif
28
+                            @endforeach
29
+                        </div>
30
+                    @endforeach
31
+                </div>
32
+            </x-filament-tables::cell>
33
+        </tr>
34
+        <!-- Transactions Data -->
35
+        @foreach($category->data as $dataIndex => $transaction)
36
+            <tr wire:key="category-{{ $categoryIndex }}-data-{{ $dataIndex }}"
37
+                @class([
38
+                    'bg-gray-50 dark:bg-white/5' => $loop->first || $loop->last || $loop->remaining === 1,
39
+                ])
40
+            >
41
+                @foreach($transaction as $cellIndex => $cell)
42
+                    <x-filament-tables::cell
43
+                        wire:key="category-{{ $categoryIndex }}-data-{{ $dataIndex }}-cell-{{ $cellIndex }}"
44
+                        @class([
45
+                           $report->getAlignmentClass($cellIndex),
46
+                           'whitespace-normal' => $cellIndex === 1,
47
+                       ])
48
+                    >
49
+                        <div
50
+                            @class([
51
+                                'px-3 py-4 text-sm leading-6 text-gray-950 dark:text-white',
52
+                                'font-semibold' => $loop->parent->first || $loop->parent->last || $loop->parent->remaining === 1,
44 53
                             ])
45 54
                         >
46
-                            <div
47
-                                @class([
48
-                                    'px-3 py-4 text-sm leading-6 text-gray-950 dark:text-white',
49
-                                    'font-semibold' => $loop->parent->first || $loop->parent->last || $loop->parent->remaining === 1,
50
-                                ])
51
-                            >
55
+                            @if(is_array($cell) && isset($cell['description']))
56
+                                @if(isset($cell['id']))
57
+                                    <x-filament::link
58
+                                        :href="\App\Filament\Company\Pages\Accounting\Transactions::getUrl()"
59
+                                        target="_blank"
60
+                                        x-on:click="localStorage.setItem('openTransactionId', '{{ $cell['id'] }}')"
61
+                                        color="primary"
62
+                                        icon="heroicon-o-arrow-top-right-on-square"
63
+                                        :icon-position="\Filament\Support\Enums\IconPosition::After"
64
+                                        icon-size="w-4 h-4 min-w-4 min-h-4"
65
+                                    >
66
+                                        {{ $cell['description'] }}
67
+                                    </x-filament::link>
68
+                                @else
69
+                                    {{ $cell['description'] }}
70
+                                @endif
71
+                            @else
52 72
                                 {{ $cell }}
53
-                            </div>
54
-                        </x-filament-tables::cell>
55
-                    @endforeach
56
-                </tr>
57
-            @endforeach
58
-            <!-- Spacer Row -->
59
-            @unless($loop->last)
60
-                <tr wire:key="category-{{ $categoryIndex }}-spacer">
61
-                    <x-filament-tables::cell colspan="{{ count($report->getHeaders()) }}">
62
-                        <div class="px-3 py-2 leading-6 invisible">Hidden Text</div>
73
+                            @endif
74
+                        </div>
63 75
                     </x-filament-tables::cell>
64
-                </tr>
65
-            @endunless
76
+                @endforeach
77
+            </tr>
78
+        @endforeach
79
+        <!-- Spacer Row -->
80
+        @unless($loop->last)
81
+            <tr wire:key="category-{{ $categoryIndex }}-spacer">
82
+                <x-filament-tables::cell colspan="{{ count($report->getHeaders()) }}">
83
+                    <div class="px-3 py-2 leading-6 invisible">Hidden Text</div>
84
+                </x-filament-tables::cell>
85
+            </tr>
86
+        @endunless
66 87
         </tbody>
67 88
     @endforeach
68 89
 </table>

+ 62
- 45
resources/views/components/company/tables/reports/detailed-report.blade.php View File

@@ -1,62 +1,79 @@
1
-<table class="w-full table-auto divide-y divide-gray-200 dark:divide-white/5">
1
+<table class="w-full table-auto divide-y divide-gray-200 dark:divide-white/5" x-data>
2 2
     <thead class="divide-y divide-gray-200 dark:divide-white/5">
3
+    <tr class="bg-gray-50 dark:bg-white/5">
4
+        @foreach($report->getHeaders() as $index => $header)
5
+            <th class="px-3 py-3.5 sm:first-of-type:ps-6 sm:last-of-type:pe-6 {{ $report->getAlignmentClass($index) }}">
6
+                <span class="text-sm font-semibold text-gray-950 dark:text-white">
7
+                    {{ $header }}
8
+                </span>
9
+            </th>
10
+        @endforeach
11
+    </tr>
12
+    </thead>
13
+    @foreach($report->getCategories() as $categoryIndex => $category)
14
+        <tbody class="divide-y divide-gray-200 whitespace-nowrap dark:divide-white/5">
3 15
         <tr class="bg-gray-50 dark:bg-white/5">
4
-            @foreach($report->getHeaders() as $index => $header)
5
-                <th wire:key="header-{{ $index }}" class="px-3 py-3.5 sm:first-of-type:ps-6 sm:last-of-type:pe-6 {{ $report->getAlignmentClass($index) }}">
6
-                    <span class="text-sm font-semibold text-gray-950 dark:text-white">
16
+            @foreach($category->header as $headerIndex => $header)
17
+                <x-filament-tables::cell class="{{ $report->getAlignmentClass($headerIndex) }}">
18
+                    <div class="px-3 py-2 text-sm font-semibold text-gray-950 dark:text-white">
7 19
                         {{ $header }}
8
-                    </span>
9
-                </th>
20
+                    </div>
21
+                </x-filament-tables::cell>
10 22
             @endforeach
11 23
         </tr>
12
-    </thead>
13
-    @foreach($report->getCategories() as $categoryIndex => $category)
14
-        <tbody wire:key="category-{{ $categoryIndex }}" class="divide-y divide-gray-200 whitespace-nowrap dark:divide-white/5">
15
-            <tr class="bg-gray-50 dark:bg-white/5">
16
-                @foreach($category->header as $headerIndex => $header)
17
-                    <x-filament-tables::cell wire:key="category-{{ $categoryIndex }}-header-{{ $headerIndex }}" class="{{ $report->getAlignmentClass($headerIndex) }}">
18
-                        <div class="px-3 py-2 text-sm font-semibold text-gray-950 dark:text-white">
19
-                            {{ $header }}
20
-                        </div>
21
-                    </x-filament-tables::cell>
22
-                @endforeach
23
-            </tr>
24
-            @foreach($category->data as $dataIndex => $account)
25
-                <tr wire:key="category-{{ $categoryIndex }}-data-{{ $dataIndex }}">
26
-                    @foreach($account as $cellIndex => $cell)
27
-                        <x-filament-tables::cell wire:key="category-{{ $categoryIndex }}-data-{{ $dataIndex }}-cell-{{ $cellIndex }}" class="{{ $report->getAlignmentClass($cellIndex) }}">
28
-                            <div class="px-3 py-4 text-sm leading-6 text-gray-950 dark:text-white">
24
+        @foreach($category->data as $dataIndex => $account)
25
+            <tr>
26
+                @foreach($account as $cellIndex => $cell)
27
+                    <x-filament-tables::cell class="{{ $report->getAlignmentClass($cellIndex) }}">
28
+                        <div class="px-3 py-4 text-sm leading-6 text-gray-950 dark:text-white">
29
+                            @if(is_array($cell) && isset($cell['name']))
30
+                                @if(isset($cell['id']))
31
+                                    <x-filament::link
32
+                                        color="primary"
33
+                                        target="_blank"
34
+                                        icon="heroicon-o-arrow-top-right-on-square"
35
+                                        :icon-position="\Filament\Support\Enums\IconPosition::After"
36
+                                        :icon-size="\Filament\Support\Enums\IconSize::Small"
37
+                                        href="{{ \App\Filament\Company\Pages\Reports\AccountTransactions::getUrl(['account_id' => $cell['id']]) }}"
38
+                                    >
39
+                                        {{ $cell['name'] }}
40
+                                    </x-filament::link>
41
+                                @else
42
+                                    {{ $cell['name'] }}
43
+                                @endif
44
+                            @else
29 45
                                 {{ $cell }}
30
-                            </div>
31
-                        </x-filament-tables::cell>
32
-                    @endforeach
33
-                </tr>
34
-            @endforeach
35
-            <tr wire:key="category-{{ $categoryIndex }}-summary">
36
-                @foreach($category->summary as $summaryIndex => $cell)
37
-                    <x-filament-tables::cell wire:key="category-{{ $categoryIndex }}-summary-{{ $summaryIndex }}" class="{{ $report->getAlignmentClass($summaryIndex) }}">
38
-                        <div class="px-3 py-2 text-sm leading-6 font-semibold text-gray-950 dark:text-white">
39
-                            {{ $cell }}
46
+                            @endif
40 47
                         </div>
41 48
                     </x-filament-tables::cell>
42 49
                 @endforeach
43 50
             </tr>
44
-            <tr wire:key="category-{{ $categoryIndex }}-spacer">
45
-                <x-filament-tables::cell colspan="{{ count($report->getHeaders()) }}">
46
-                    <div class="px-3 py-2 leading-6 invisible">Hidden Text</div>
47
-                </x-filament-tables::cell>
48
-            </tr>
49
-        </tbody>
50
-    @endforeach
51
-    <tfoot>
52
-        <tr class="bg-gray-50 dark:bg-white/5">
53
-            @foreach($report->getOverallTotals() as $index => $total)
54
-                <x-filament-tables::cell wire:key="footer-total-{{ $index }}" class="{{ $report->getAlignmentClass($index) }}">
51
+        @endforeach
52
+        <tr>
53
+            @foreach($category->summary as $summaryIndex => $cell)
54
+                <x-filament-tables::cell class="{{ $report->getAlignmentClass($summaryIndex) }}">
55 55
                     <div class="px-3 py-2 text-sm leading-6 font-semibold text-gray-950 dark:text-white">
56
-                        {{ $total }}
56
+                        {{ $cell }}
57 57
                     </div>
58 58
                 </x-filament-tables::cell>
59 59
             @endforeach
60 60
         </tr>
61
+        <tr>
62
+            <x-filament-tables::cell colspan="{{ count($report->getHeaders()) }}">
63
+                <div class="px-3 py-2 leading-6 invisible">Hidden Text</div>
64
+            </x-filament-tables::cell>
65
+        </tr>
66
+        </tbody>
67
+    @endforeach
68
+    <tfoot>
69
+    <tr class="bg-gray-50 dark:bg-white/5">
70
+        @foreach($report->getOverallTotals() as $index => $total)
71
+            <x-filament-tables::cell class="{{ $report->getAlignmentClass($index) }}">
72
+                <div class="px-3 py-2 text-sm leading-6 font-semibold text-gray-950 dark:text-white">
73
+                    {{ $total }}
74
+                </div>
75
+            </x-filament-tables::cell>
76
+        @endforeach
77
+    </tr>
61 78
     </tfoot>
62 79
 </table>

+ 10
- 0
resources/views/filament/company/pages/accounting/transactions.blade.php View File

@@ -1,4 +1,14 @@
1 1
 <x-filament-panels::page>
2 2
     {{ $this->form }}
3 3
     {{ $this->table }}
4
+
5
+    @script
6
+    <script>
7
+        const transactionId = localStorage.getItem('openTransactionId');
8
+        if (transactionId) {
9
+            localStorage.removeItem('openTransactionId');
10
+            $wire.openModalForTransaction(transactionId);
11
+        }
12
+    </script>
13
+    @endscript
4 14
 </x-filament-panels::page>

+ 9
- 8
resources/views/filament/company/pages/reports/detailed-report.blade.php View File

@@ -14,19 +14,20 @@
14 14
                 </x-filament::button>
15 15
             </div>
16 16
         </form>
17
-        <div class="relative divide-y divide-gray-200 overflow-x-auto dark:divide-white/10 dark:border-t-white/10 min-h-64">
18
-            <div wire:init="loadReportData" class="flex items-center justify-center w-full h-full absolute">
19
-                <div wire:loading wire:target="loadReportData">
20
-                    <x-filament::loading-indicator class="p-6 text-primary-700 dark:text-primary-300" />
21
-                </div>
22
-            </div>
23
-
17
+        <div wire:init="loadReportData"
18
+             class="relative divide-y divide-gray-200 overflow-x-auto dark:divide-white/10 dark:border-t-white/10 min-h-64">
24 19
             @if($this->reportLoaded)
25 20
                 <div wire:loading.remove wire:target="loadReportData">
26 21
                     @if($this->report)
27
-                        <x-company.tables.reports.detailed-report :report="$this->report" />
22
+                        <x-company.tables.reports.detailed-report :report="$this->report"/>
28 23
                     @endif
29 24
                 </div>
25
+            @else
26
+                <div class="absolute inset-0 flex items-center justify-center">
27
+                    <div wire:loading wire:target="loadReportData">
28
+                        <x-filament::loading-indicator class="p-6 text-primary-700 dark:text-primary-300"/>
29
+                    </div>
30
+                </div>
30 31
             @endif
31 32
         </div>
32 33
         <div class="es-table__footer-ctn border-t border-gray-200"></div>

Loading…
Cancel
Save