Andrew Wallo 4 miesięcy temu
rodzic
commit
b2ebc5111e

+ 9
- 3
app/Filament/Company/Resources/Accounting/TransactionResource/Pages/ViewTransaction.php Wyświetl plik

@@ -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()

+ 4
- 0
app/Filament/Company/Resources/Accounting/TransactionResource/RelationManagers/JournalEntriesRelationManager.php Wyświetl plik

@@ -13,6 +13,10 @@ class JournalEntriesRelationManager extends RelationManager
13 13
 {
14 14
     protected static string $relationship = 'journalEntries';
15 15
 
16
+    protected $listeners = [
17
+        'refresh' => '$refresh',
18
+    ];
19
+
16 20
     public function form(Form $form): Form
17 21
     {
18 22
         return $form

Ładowanie…
Anuluj
Zapisz