|
@@ -15,6 +15,7 @@ use App\Models\Accounting\JournalEntry;
|
15
|
15
|
use App\Models\Accounting\Transaction;
|
16
|
16
|
use App\Models\Common\Client;
|
17
|
17
|
use App\Models\Common\Vendor;
|
|
18
|
+use App\Utilities\Currency\CurrencyAccessor;
|
18
|
19
|
use Filament\Actions;
|
19
|
20
|
use Filament\Infolists\Components\IconEntry;
|
20
|
21
|
use Filament\Infolists\Components\Section;
|
|
@@ -29,11 +30,16 @@ class ViewTransaction extends ViewRecord
|
29
|
30
|
{
|
30
|
31
|
protected static string $resource = TransactionResource::class;
|
31
|
32
|
|
|
33
|
+ protected $listeners = [
|
|
34
|
+ 'refresh' => '$refresh',
|
|
35
|
+ ];
|
|
36
|
+
|
32
|
37
|
protected function getHeaderActions(): array
|
33
|
38
|
{
|
34
|
39
|
return [
|
35
|
40
|
EditTransactionAction::make()
|
36
|
|
- ->outlined(),
|
|
41
|
+ ->outlined()
|
|
42
|
+ ->after(fn () => $this->dispatch('refresh')),
|
37
|
43
|
Actions\ViewAction::make('viewAssociatedDocument')
|
38
|
44
|
->outlined()
|
39
|
45
|
->icon('heroicon-o-document-text')
|
|
@@ -94,7 +100,7 @@ class ViewTransaction extends ViewRecord
|
94
|
100
|
BannerEntry::make('transactionUncategorized')
|
95
|
101
|
->warning()
|
96
|
102
|
->title('Transaction uncategorized')
|
97
|
|
- ->description('This transaction is uncategorized. You must categorize it before you can approve it.')
|
|
103
|
+ ->description('You must categorize this transaction before you can mark it as reviewed.')
|
98
|
104
|
->visible(fn (Transaction $record) => $record->isUncategorized())
|
99
|
105
|
->columnSpanFull(),
|
100
|
106
|
Section::make('Transaction Details')
|
|
@@ -133,7 +139,7 @@ class ViewTransaction extends ViewRecord
|
133
|
139
|
->hidden(static fn (Transaction $record): bool => ! $record->account),
|
134
|
140
|
TextEntry::make('amount')
|
135
|
141
|
->label('Amount')
|
136
|
|
- ->currency(static fn (Transaction $record) => $record->bankAccount?->account->currency_code ?? 'USD'),
|
|
142
|
+ ->currency(static fn (Transaction $record) => $record->bankAccount?->account->currency_code ?? CurrencyAccessor::getDefaultCurrency()),
|
137
|
143
|
TextEntry::make('reviewed')
|
138
|
144
|
->label('Status')
|
139
|
145
|
->badge()
|