Andrew Wallo 4 月之前
父節點
當前提交
b4354ab1a4

+ 8
- 1
app/Filament/Company/Resources/Accounting/TransactionResource/Pages/ViewTransaction.php 查看文件

8
 use App\Filament\Company\Resources\Purchases\VendorResource;
8
 use App\Filament\Company\Resources\Purchases\VendorResource;
9
 use App\Filament\Company\Resources\Sales\ClientResource;
9
 use App\Filament\Company\Resources\Sales\ClientResource;
10
 use App\Filament\Company\Resources\Sales\InvoiceResource\Pages\ViewInvoice;
10
 use App\Filament\Company\Resources\Sales\InvoiceResource\Pages\ViewInvoice;
11
+use App\Filament\Infolists\Components\BannerEntry;
11
 use App\Models\Accounting\Bill;
12
 use App\Models\Accounting\Bill;
12
 use App\Models\Accounting\Invoice;
13
 use App\Models\Accounting\Invoice;
13
 use App\Models\Accounting\JournalEntry;
14
 use App\Models\Accounting\JournalEntry;
56
                     Actions\Action::make('markAsReviewed')
57
                     Actions\Action::make('markAsReviewed')
57
                         ->label(static fn (Transaction $record) => $record->reviewed ? 'Mark as unreviewed' : 'Mark as reviewed')
58
                         ->label(static fn (Transaction $record) => $record->reviewed ? 'Mark as unreviewed' : 'Mark as reviewed')
58
                         ->icon(static fn (Transaction $record) => $record->reviewed ? 'heroicon-s-check-circle' : 'heroicon-o-check-circle')
59
                         ->icon(static fn (Transaction $record) => $record->reviewed ? 'heroicon-s-check-circle' : 'heroicon-o-check-circle')
59
-                        ->disabled(fn (Transaction $record): bool => $record->isUncategorized())
60
+                        ->hidden(fn (Transaction $record): bool => $record->isUncategorized())
60
                         ->action(fn (Transaction $record) => $record->update(['reviewed' => ! $record->reviewed])),
61
                         ->action(fn (Transaction $record) => $record->update(['reviewed' => ! $record->reviewed])),
61
                     Actions\ReplicateAction::make()
62
                     Actions\ReplicateAction::make()
62
                         ->excludeAttributes(['created_by', 'updated_by', 'created_at', 'updated_at'])
63
                         ->excludeAttributes(['created_by', 'updated_by', 'created_at', 'updated_at'])
90
     {
91
     {
91
         return $infolist
92
         return $infolist
92
             ->schema([
93
             ->schema([
94
+                BannerEntry::make('transactionUncategorized')
95
+                    ->warning()
96
+                    ->title('Transaction uncategorized')
97
+                    ->description('This transaction is uncategorized. You must categorize it before you can approve it.')
98
+                    ->visible(fn (Transaction $record) => $record->isUncategorized())
99
+                    ->columnSpanFull(),
93
                 Section::make('Transaction Details')
100
                 Section::make('Transaction Details')
94
                     ->columns(3)
101
                     ->columns(3)
95
                     ->schema([
102
                     ->schema([

+ 1
- 1
app/Filament/Company/Resources/Sales/RecurringInvoiceResource/Pages/ViewRecurringInvoice.php 查看文件

89
                     ]),
89
                     ]),
90
                 BannerEntry::make('readyToApprove')
90
                 BannerEntry::make('readyToApprove')
91
                     ->info()
91
                     ->info()
92
-                    ->title('Ready to Approve')
92
+                    ->title('Ready to approve')
93
                     ->description('This recurring invoice is ready for approval. Review the details, and approve it when you’re ready to start generating invoices.')
93
                     ->description('This recurring invoice is ready for approval. Review the details, and approve it when you’re ready to start generating invoices.')
94
                     ->visible(fn (RecurringInvoice $record) => $record->canBeApproved() && ! $record->hasInactiveAdjustments())
94
                     ->visible(fn (RecurringInvoice $record) => $record->canBeApproved() && ! $record->hasInactiveAdjustments())
95
                     ->columnSpanFull()
95
                     ->columnSpanFull()

Loading…
取消
儲存