Andrew Wallo 10 months ago
parent
commit
c6e1a0026a

+ 2
- 1
app/Enums/Accounting/InvoiceStatus.php View File

@@ -8,6 +8,7 @@ use Filament\Support\Contracts\HasLabel;
8 8
 enum InvoiceStatus: string implements HasColor, HasLabel
9 9
 {
10 10
     case Draft = 'draft';
11
+    case Unsent = 'unsent';
11 12
     case Sent = 'sent';
12 13
 
13 14
     case Partial = 'partial';
@@ -26,7 +27,7 @@ enum InvoiceStatus: string implements HasColor, HasLabel
26 27
     public function getColor(): string | array | null
27 28
     {
28 29
         return match ($this) {
29
-            self::Draft, self::Void => 'gray',
30
+            self::Draft, self::Unsent, self::Void => 'gray',
30 31
             self::Sent => 'primary',
31 32
             self::Partial => 'warning',
32 33
             self::Paid => 'success',

+ 1
- 29
app/Filament/Company/Clusters/Settings/Pages/Appearance.php View File

@@ -4,8 +4,6 @@ namespace App\Filament\Company\Clusters\Settings\Pages;
4 4
 
5 5
 use App\Enums\Setting\Font;
6 6
 use App\Enums\Setting\PrimaryColor;
7
-use App\Enums\Setting\RecordsPerPage;
8
-use App\Enums\Setting\TableSortDirection;
9 7
 use App\Filament\Company\Clusters\Settings;
10 8
 use App\Models\Setting\Appearance as AppearanceModel;
11 9
 use App\Services\CompanySettingsService;
@@ -104,7 +102,6 @@ class Appearance extends Page
104 102
         return $form
105 103
             ->schema([
106 104
                 $this->getGeneralSection(),
107
-                $this->getDataPresentationSection(),
108 105
             ])
109 106
             ->model($this->record)
110 107
             ->statePath('data')
@@ -142,21 +139,6 @@ class Appearance extends Page
142 139
             ])->columns();
143 140
     }
144 141
 
145
-    protected function getDataPresentationSection(): Component
146
-    {
147
-        return Section::make('Data Presentation')
148
-            ->schema([
149
-                Select::make('table_sort_direction')
150
-                    ->softRequired()
151
-                    ->localizeLabel()
152
-                    ->options(TableSortDirection::class),
153
-                Select::make('records_per_page')
154
-                    ->softRequired()
155
-                    ->localizeLabel()
156
-                    ->options(RecordsPerPage::class),
157
-            ])->columns();
158
-    }
159
-
160 142
     protected function handleRecordUpdate(AppearanceModel $record, array $data): AppearanceModel
161 143
     {
162 144
         $record->fill($data);
@@ -166,19 +148,9 @@ class Appearance extends Page
166 148
             'font',
167 149
         ];
168 150
 
169
-        $cachedKeysToWatch = [
170
-            'primary_color',
171
-            'font',
172
-            'table_sort_direction',
173
-            'records_per_page',
174
-        ];
175
-
176 151
         if ($record->isDirty($keysToWatch)) {
177
-            $this->dispatch('appearanceUpdated');
178
-        }
179
-
180
-        if ($record->isDirty($cachedKeysToWatch)) {
181 152
             CompanySettingsService::invalidateSettings($record->company_id);
153
+            $this->dispatch('appearanceUpdated');
182 154
         }
183 155
 
184 156
         $record->save();

app/Filament/Company/Resources/Common/VendorResource.php → app/Filament/Company/Resources/Purchases/VendorResource.php View File

@@ -1,10 +1,10 @@
1 1
 <?php
2 2
 
3
-namespace App\Filament\Company\Resources\Common;
3
+namespace App\Filament\Company\Resources\Purchases;
4 4
 
5 5
 use App\Enums\Common\ContractorType;
6 6
 use App\Enums\Common\VendorType;
7
-use App\Filament\Company\Resources\Common\VendorResource\Pages;
7
+use App\Filament\Company\Resources\Purchases\VendorResource\Pages;
8 8
 use App\Filament\Forms\Components\CreateCurrencySelect;
9 9
 use App\Filament\Forms\Components\CustomSection;
10 10
 use App\Filament\Forms\Components\PhoneBuilder;

app/Filament/Company/Resources/Common/VendorResource/Pages/CreateVendor.php → app/Filament/Company/Resources/Purchases/VendorResource/Pages/CreateVendor.php View File

@@ -1,9 +1,9 @@
1 1
 <?php
2 2
 
3
-namespace App\Filament\Company\Resources\Common\VendorResource\Pages;
3
+namespace App\Filament\Company\Resources\Purchases\VendorResource\Pages;
4 4
 
5 5
 use App\Concerns\RedirectToListPage;
6
-use App\Filament\Company\Resources\Common\VendorResource;
6
+use App\Filament\Company\Resources\Purchases\VendorResource;
7 7
 use Filament\Resources\Pages\CreateRecord;
8 8
 use Filament\Support\Enums\MaxWidth;
9 9
 

app/Filament/Company/Resources/Common/VendorResource/Pages/EditVendor.php → app/Filament/Company/Resources/Purchases/VendorResource/Pages/EditVendor.php View File

@@ -1,9 +1,9 @@
1 1
 <?php
2 2
 
3
-namespace App\Filament\Company\Resources\Common\VendorResource\Pages;
3
+namespace App\Filament\Company\Resources\Purchases\VendorResource\Pages;
4 4
 
5 5
 use App\Concerns\RedirectToListPage;
6
-use App\Filament\Company\Resources\Common\VendorResource;
6
+use App\Filament\Company\Resources\Purchases\VendorResource;
7 7
 use Filament\Actions;
8 8
 use Filament\Resources\Pages\EditRecord;
9 9
 use Filament\Support\Enums\MaxWidth;

app/Filament/Company/Resources/Common/VendorResource/Pages/ListVendors.php → app/Filament/Company/Resources/Purchases/VendorResource/Pages/ListVendors.php View File

@@ -1,8 +1,8 @@
1 1
 <?php
2 2
 
3
-namespace App\Filament\Company\Resources\Common\VendorResource\Pages;
3
+namespace App\Filament\Company\Resources\Purchases\VendorResource\Pages;
4 4
 
5
-use App\Filament\Company\Resources\Common\VendorResource;
5
+use App\Filament\Company\Resources\Purchases\VendorResource;
6 6
 use Filament\Actions;
7 7
 use Filament\Resources\Pages\ListRecords;
8 8
 

app/Filament/Company/Resources/Common/ClientResource.php → app/Filament/Company/Resources/Sales/ClientResource.php View File

@@ -1,8 +1,8 @@
1 1
 <?php
2 2
 
3
-namespace App\Filament\Company\Resources\Common;
3
+namespace App\Filament\Company\Resources\Sales;
4 4
 
5
-use App\Filament\Company\Resources\Common\ClientResource\Pages;
5
+use App\Filament\Company\Resources\Sales\ClientResource\Pages;
6 6
 use App\Filament\Forms\Components\CreateCurrencySelect;
7 7
 use App\Filament\Forms\Components\CustomSection;
8 8
 use App\Filament\Forms\Components\PhoneBuilder;

app/Filament/Company/Resources/Common/ClientResource/Pages/CreateClient.php → app/Filament/Company/Resources/Sales/ClientResource/Pages/CreateClient.php View File

@@ -1,9 +1,9 @@
1 1
 <?php
2 2
 
3
-namespace App\Filament\Company\Resources\Common\ClientResource\Pages;
3
+namespace App\Filament\Company\Resources\Sales\ClientResource\Pages;
4 4
 
5 5
 use App\Concerns\RedirectToListPage;
6
-use App\Filament\Company\Resources\Common\ClientResource;
6
+use App\Filament\Company\Resources\Sales\ClientResource;
7 7
 use Filament\Resources\Pages\CreateRecord;
8 8
 use Filament\Support\Enums\MaxWidth;
9 9
 

app/Filament/Company/Resources/Common/ClientResource/Pages/EditClient.php → app/Filament/Company/Resources/Sales/ClientResource/Pages/EditClient.php View File

@@ -1,9 +1,9 @@
1 1
 <?php
2 2
 
3
-namespace App\Filament\Company\Resources\Common\ClientResource\Pages;
3
+namespace App\Filament\Company\Resources\Sales\ClientResource\Pages;
4 4
 
5 5
 use App\Concerns\RedirectToListPage;
6
-use App\Filament\Company\Resources\Common\ClientResource;
6
+use App\Filament\Company\Resources\Sales\ClientResource;
7 7
 use Filament\Actions;
8 8
 use Filament\Resources\Pages\EditRecord;
9 9
 use Filament\Support\Enums\MaxWidth;

app/Filament/Company/Resources/Common/ClientResource/Pages/ListClients.php → app/Filament/Company/Resources/Sales/ClientResource/Pages/ListClients.php View File

@@ -1,8 +1,8 @@
1 1
 <?php
2 2
 
3
-namespace App\Filament\Company\Resources\Common\ClientResource\Pages;
3
+namespace App\Filament\Company\Resources\Sales\ClientResource\Pages;
4 4
 
5
-use App\Filament\Company\Resources\Common\ClientResource;
5
+use App\Filament\Company\Resources\Sales\ClientResource;
6 6
 use Filament\Actions;
7 7
 use Filament\Resources\Pages\ListRecords;
8 8
 

+ 2
- 0
app/Filament/Company/Resources/Sales/InvoiceResource.php View File

@@ -440,6 +440,7 @@ class InvoiceResource extends Resource
440 440
             ])
441 441
             ->actions([
442 442
                 Tables\Actions\EditAction::make(),
443
+                Tables\Actions\ViewAction::make(),
443 444
             ])
444 445
             ->bulkActions([
445 446
                 Tables\Actions\BulkActionGroup::make([
@@ -460,6 +461,7 @@ class InvoiceResource extends Resource
460 461
         return [
461 462
             'index' => Pages\ListInvoices::route('/'),
462 463
             'create' => Pages\CreateInvoice::route('/create'),
464
+            'view' => Pages\ViewInvoice::route('/{record}'),
463 465
             'edit' => Pages\EditInvoice::route('/{record}/edit'),
464 466
         ];
465 467
     }

+ 108
- 0
app/Filament/Company/Resources/Sales/InvoiceResource/Pages/ViewInvoice.php View File

@@ -0,0 +1,108 @@
1
+<?php
2
+
3
+namespace App\Filament\Company\Resources\Sales\InvoiceResource\Pages;
4
+
5
+use App\Enums\Accounting\InvoiceStatus;
6
+use App\Filament\Company\Resources\Sales\ClientResource;
7
+use App\Filament\Company\Resources\Sales\InvoiceResource;
8
+use Carbon\CarbonInterface;
9
+use Filament\Infolists\Components\Actions\Action;
10
+use Filament\Infolists\Components\Grid;
11
+use Filament\Infolists\Components\TextEntry;
12
+use Filament\Infolists\Components\ViewEntry;
13
+use Filament\Infolists\Infolist;
14
+use Filament\Resources\Pages\ViewRecord;
15
+use Filament\Support\Enums\FontWeight;
16
+use Filament\Support\Enums\MaxWidth;
17
+use Illuminate\Support\Carbon;
18
+
19
+class ViewInvoice extends ViewRecord
20
+{
21
+    protected static string $resource = InvoiceResource::class;
22
+
23
+    public function infolist(Infolist $infolist): Infolist
24
+    {
25
+        return $infolist
26
+            ->columns(1)
27
+            ->schema([
28
+                Grid::make(5)
29
+                    ->schema([
30
+                        TextEntry::make('invoice_number')
31
+                            ->label('Invoice #')
32
+                            ->size(TextEntry\TextEntrySize::Large),
33
+                        TextEntry::make('status')
34
+                            ->badge()
35
+                            ->size(TextEntry\TextEntrySize::Large),
36
+                        TextEntry::make('client.name')
37
+                            ->color('primary')
38
+                            ->weight(FontWeight::SemiBold)
39
+                            ->size(TextEntry\TextEntrySize::Large)
40
+                            ->url(fn ($record) => ClientResource::getUrl('edit', ['record' => $record->client_id]), true),
41
+                        TextEntry::make('amount_due')
42
+                            ->label('Amount Due')
43
+                            ->money()
44
+                            ->size(TextEntry\TextEntrySize::Large),
45
+                        TextEntry::make('due_date')
46
+                            ->label('Due')
47
+                            ->formatStateUsing(function (TextEntry $entry, mixed $state) {
48
+                                if (blank($state)) {
49
+                                    return null;
50
+                                }
51
+
52
+                                $date = Carbon::parse($state)
53
+                                    ->setTimezone($timezone ?? $entry->getTimezone());
54
+
55
+                                if ($date->isToday()) {
56
+                                    return 'Today';
57
+                                }
58
+
59
+                                return $date->diffForHumans([
60
+                                    'options' => CarbonInterface::ONE_DAY_WORDS,
61
+                                ]);
62
+                            })
63
+                            ->size(TextEntry\TextEntrySize::Large),
64
+                    ]),
65
+                ViewEntry::make('create')
66
+                    ->view('filament.infolists.invoice-create-step')
67
+                    ->registerActions([
68
+                        Action::make('approveDraft')
69
+                            ->label('Approve Draft')
70
+                            ->action('approveDraft')
71
+                            ->visible(fn ($record) => $record->status === InvoiceStatus::Draft),
72
+                        Action::make('edit')
73
+                            ->label('Edit')
74
+                            ->outlined()
75
+                            ->url(fn ($record) => InvoiceResource::getUrl('edit', ['record' => $record->id]), true),
76
+                        Action::make('markAsSent')
77
+                            ->label('Mark as Sent')
78
+                            ->outlined()
79
+                            ->action('markAsSent'),
80
+                        Action::make('sendInvoice')
81
+                            ->label('Send Invoice')
82
+                            ->action('sendInvoice'),
83
+                        Action::make('recordPayment')
84
+                            ->label('Record Payment')
85
+                            ->action('recordPayment'),
86
+                    ]),
87
+            ]);
88
+    }
89
+
90
+    public function approveDraft(): void
91
+    {
92
+        $this->record->update([
93
+            'status' => InvoiceStatus::Unsent,
94
+        ]);
95
+    }
96
+
97
+    public function markAsSent(): void
98
+    {
99
+        $this->record->update([
100
+            'status' => InvoiceStatus::Sent,
101
+        ]);
102
+    }
103
+
104
+    public function getMaxContentWidth(): MaxWidth | string | null
105
+    {
106
+        return MaxWidth::FiveExtraLarge;
107
+    }
108
+}

+ 0
- 12
app/Listeners/ConfigureCompanyDefault.php View File

@@ -3,7 +3,6 @@
3 3
 namespace App\Listeners;
4 4
 
5 5
 use App\Enums\Setting\PrimaryColor;
6
-use App\Enums\Setting\RecordsPerPage;
7 6
 use App\Events\CompanyConfigured;
8 7
 use App\Services\CompanySettingsService;
9 8
 use App\Utilities\Currency\ConfigureCurrencies;
@@ -13,7 +12,6 @@ use Filament\Forms\Components\Section;
13 12
 use Filament\Forms\Components\Tabs\Tab;
14 13
 use Filament\Resources\Components\Tab as ResourcesTab;
15 14
 use Filament\Support\Facades\FilamentColor;
16
-use Filament\Tables\Table;
17 15
 
18 16
 class ConfigureCompanyDefault
19 17
 {
@@ -34,16 +32,6 @@ class ConfigureCompanyDefault
34 32
         config(['app.timezone' => $settings['default_timezone']]);
35 33
         date_default_timezone_set($settings['default_timezone']);
36 34
 
37
-        $paginationPageOptions = RecordsPerPage::caseValues();
38
-
39
-        Table::configureUsing(static function (Table $table) use ($settings, $paginationPageOptions): void {
40
-
41
-            $table
42
-                ->paginationPageOptions($paginationPageOptions)
43
-                ->defaultSort(column: 'id', direction: $settings['default_sort'])
44
-                ->defaultPaginationPageOption($settings['default_pagination_page_option']);
45
-        }, isImportant: true);
46
-
47 35
         FilamentColor::register([
48 36
             'primary' => PrimaryColor::from($settings['default_primary_color'])->getColor(),
49 37
         ]);

+ 0
- 6
app/Models/Setting/Appearance.php View File

@@ -6,8 +6,6 @@ use App\Concerns\Blamable;
6 6
 use App\Concerns\CompanyOwned;
7 7
 use App\Enums\Setting\Font;
8 8
 use App\Enums\Setting\PrimaryColor;
9
-use App\Enums\Setting\RecordsPerPage;
10
-use App\Enums\Setting\TableSortDirection;
11 9
 use Database\Factories\Setting\AppearanceFactory;
12 10
 use Illuminate\Database\Eloquent\Factories\Factory;
13 11
 use Illuminate\Database\Eloquent\Factories\HasFactory;
@@ -25,8 +23,6 @@ class Appearance extends Model
25 23
         'company_id',
26 24
         'primary_color',
27 25
         'font',
28
-        'table_sort_direction',
29
-        'records_per_page',
30 26
         'created_by',
31 27
         'updated_by',
32 28
     ];
@@ -34,8 +30,6 @@ class Appearance extends Model
34 30
     protected $casts = [
35 31
         'primary_color' => PrimaryColor::class,
36 32
         'font' => Font::class,
37
-        'table_sort_direction' => TableSortDirection::class,
38
-        'records_per_page' => RecordsPerPage::class,
39 33
     ];
40 34
 
41 35
     protected static function newFactory(): Factory

+ 6
- 2
app/Providers/FilamentCompaniesServiceProvider.php View File

@@ -26,10 +26,10 @@ use App\Filament\Company\Pages\Reports;
26 26
 use App\Filament\Company\Pages\Service\ConnectedAccount;
27 27
 use App\Filament\Company\Pages\Service\LiveCurrency;
28 28
 use App\Filament\Company\Resources\Banking\AccountResource;
29
-use App\Filament\Company\Resources\Common\ClientResource;
30 29
 use App\Filament\Company\Resources\Common\OfferingResource;
31
-use App\Filament\Company\Resources\Common\VendorResource;
32 30
 use App\Filament\Company\Resources\Purchases\BillResource;
31
+use App\Filament\Company\Resources\Purchases\VendorResource;
32
+use App\Filament\Company\Resources\Sales\ClientResource;
33 33
 use App\Filament\Company\Resources\Sales\InvoiceResource;
34 34
 use App\Filament\Components\PanelShiftDropdown;
35 35
 use App\Filament\User\Clusters\Account;
@@ -261,6 +261,10 @@ class FilamentCompaniesServiceProvider extends PanelProvider
261 261
         Forms\Components\DateTimePicker::configureUsing(static function (Forms\Components\DateTimePicker $component) {
262 262
             $component->native(false);
263 263
         });
264
+
265
+        Tables\Table::configureUsing(static function (Tables\Table $table): void {
266
+            $table->paginationPageOptions([5, 10, 25, 50, 100]);
267
+        }, isImportant: true);
264 268
     }
265 269
 
266 270
     /**

+ 14
- 10
app/Services/CompanySettingsService.php View File

@@ -5,8 +5,6 @@ namespace App\Services;
5 5
 use App\Enums\Setting\DateFormat;
6 6
 use App\Enums\Setting\Font;
7 7
 use App\Enums\Setting\PrimaryColor;
8
-use App\Enums\Setting\RecordsPerPage;
9
-use App\Enums\Setting\TableSortDirection;
10 8
 use App\Enums\Setting\WeekStart;
11 9
 use App\Models\Company;
12 10
 use Illuminate\Support\Facades\Cache;
@@ -28,8 +26,6 @@ class CompanySettingsService
28 26
                 'default_language' => $company->locale->language ?? config('transmatic.source_locale'),
29 27
                 'default_timezone' => $company->locale->timezone ?? config('app.timezone'),
30 28
                 'default_currency' => $company->currency_code ?? 'USD',
31
-                'default_pagination_page_option' => $company->appearance->records_per_page->value ?? RecordsPerPage::DEFAULT,
32
-                'default_sort' => $company->appearance->table_sort_direction->value ?? TableSortDirection::DEFAULT,
33 29
                 'default_primary_color' => $company->appearance->primary_color->value ?? PrimaryColor::DEFAULT,
34 30
                 'default_font' => $company->appearance->font->value ?? Font::DEFAULT,
35 31
                 'default_date_format' => $company->locale->date_format->value ?? DateFormat::DEFAULT,
@@ -50,8 +46,6 @@ class CompanySettingsService
50 46
             'default_language' => config('transmatic.source_locale'),
51 47
             'default_timezone' => config('app.timezone'),
52 48
             'default_currency' => 'USD',
53
-            'default_pagination_page_option' => RecordsPerPage::DEFAULT,
54
-            'default_sort' => TableSortDirection::DEFAULT,
55 49
             'default_primary_color' => PrimaryColor::DEFAULT,
56 50
             'default_font' => Font::DEFAULT,
57 51
             'default_date_format' => DateFormat::DEFAULT,
@@ -81,13 +75,23 @@ class CompanySettingsService
81 75
         return self::getSpecificSetting($companyId, 'default_currency', 'USD');
82 76
     }
83 77
 
84
-    public static function getDefaultPaginationOption(int $companyId): int
78
+    public static function getDefaultPrimaryColor(int $companyId): string
85 79
     {
86
-        return self::getSpecificSetting($companyId, 'default_pagination_page_option', RecordsPerPage::DEFAULT);
80
+        return self::getSpecificSetting($companyId, 'default_primary_color', PrimaryColor::DEFAULT);
87 81
     }
88 82
 
89
-    public static function getDefaultPrimaryColor(int $companyId): string
83
+    public static function getDefaultFont(int $companyId): string
90 84
     {
91
-        return self::getSpecificSetting($companyId, 'default_primary_color', PrimaryColor::DEFAULT);
85
+        return self::getSpecificSetting($companyId, 'default_font', Font::DEFAULT);
86
+    }
87
+
88
+    public static function getDefaultDateFormat(int $companyId): string
89
+    {
90
+        return self::getSpecificSetting($companyId, 'default_date_format', DateFormat::DEFAULT);
91
+    }
92
+
93
+    public static function getDefaultWeekStart(int $companyId): string
94
+    {
95
+        return self::getSpecificSetting($companyId, 'default_week_start', WeekStart::DEFAULT);
92 96
     }
93 97
 }

+ 0
- 2
database/migrations/2023_09_12_014413_create_appearances_table.php View File

@@ -16,8 +16,6 @@ return new class extends Migration
16 16
             $table->foreignId('company_id')->constrained()->onDelete('cascade');
17 17
             $table->string('primary_color')->default('indigo');
18 18
             $table->string('font')->default('inter');
19
-            $table->string('table_sort_direction')->default('asc');
20
-            $table->unsignedTinyInteger('records_per_page')->default(10);
21 19
             $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
22 20
             $table->foreignId('updated_by')->nullable()->constrained('users')->nullOnDelete();
23 21
             $table->timestamps();

+ 1
- 0
resources/css/filament/company/tailwind.config.js View File

@@ -6,6 +6,7 @@ export default {
6 6
         './app/Filament/Company/**/*.php',
7 7
         './resources/views/filament/company/**/*.blade.php',
8 8
         './resources/views/filament/forms/**/*.blade.php',
9
+        './resources/views/filament/infolists/**/*.blade.php',
9 10
         './resources/views/livewire/company/**/*.blade.php',
10 11
         './resources/views/components/**/*.blade.php',
11 12
         './vendor/filament/**/*.blade.php',

+ 2
- 1
resources/data/lang/en.json View File

@@ -212,5 +212,6 @@
212 212
     "Invoice Details": "Invoice Details",
213 213
     "Footer": "Footer",
214 214
     "Invoice Footer": "Invoice Footer",
215
-    "Bill Details": "Bill Details"
215
+    "Bill Details": "Bill Details",
216
+    "Create": "Create"
216 217
 }

+ 89
- 0
resources/views/filament/infolists/invoice-create-step.blade.php View File

@@ -0,0 +1,89 @@
1
+@use('App\Utilities\Currency\CurrencyConverter')
2
+
3
+<div class="space-y-1">
4
+    <!-- Create Section -->
5
+    <x-filament::section>
6
+        <div class="flex justify-between items-start">
7
+            <!-- Left section -->
8
+            <div class="flex items-center space-x-3">
9
+                <!-- Icon -->
10
+                <x-filament::icon
11
+                    icon="heroicon-o-document-text"
12
+                    class="h-8 w-8 text-primary-600 dark:text-primary-500 flex-shrink-0 mr-4"
13
+                />
14
+                <!-- Text content -->
15
+                <div>
16
+                    <h1 class="text-lg font-semibold text-gray-900 dark:text-gray-100">Create</h1>
17
+                    <p class="text-sm text-gray-600 dark:text-gray-400">Created: {{ $getRecord()->created_at->diffForHumans() }}</p>
18
+                </div>
19
+            </div>
20
+
21
+            <!-- Right section -->
22
+            <div class="flex flex-row items-center space-x-2">
23
+                @if($getRecord()->status->value === 'draft')
24
+                    {{ $getAction('approveDraft') }}
25
+                @endif
26
+                {{ $getAction('edit') }}
27
+            </div>
28
+        </div>
29
+    </x-filament::section>
30
+
31
+    <div class="border-l-4 h-8 border-solid border-gray-300 dark:border-gray-700 ms-8"></div>
32
+
33
+    <!-- Send Section -->
34
+    <x-filament::section :class="$getRecord()->status->value === 'draft' ? 'opacity-50 pointer-events-none' : ''">
35
+        <div class="flex justify-between items-start">
36
+            <!-- Left section -->
37
+            <div class="flex items-center space-x-3">
38
+                <!-- Icon -->
39
+                <x-filament::icon
40
+                    icon="heroicon-o-paper-airplane"
41
+                    class="h-8 w-8 text-primary-600 dark:text-primary-500 flex-shrink-0 mr-4"
42
+                />
43
+                <!-- Text content -->
44
+                <div>
45
+                    <h1 class="text-lg font-semibold text-gray-900 dark:text-gray-100">Send</h1>
46
+                    <p class="text-sm text-gray-600 dark:text-gray-400">Last Sent: just a moment ago</p>
47
+                </div>
48
+            </div>
49
+
50
+            <!-- Right section -->
51
+            @if($getRecord()->status->value !== 'draft')
52
+                <div class="flex flex-row items-center space-x-2">
53
+                    @if($getRecord()->status->value !== 'sent')
54
+                        {{ $getAction('markAsSent') }}
55
+                    @endif
56
+                    {{ $getAction('sendInvoice') }}
57
+                </div>
58
+            @endif
59
+        </div>
60
+    </x-filament::section>
61
+
62
+    <div class="border-l-4 h-8 border-solid border-gray-300 dark:border-gray-700 ms-8"></div>
63
+
64
+    <!-- Manage Payments Section -->
65
+    <x-filament::section :class="$getRecord()->status->value === 'draft' ? 'opacity-50 pointer-events-none' : ''">
66
+        <div class="flex justify-between items-start">
67
+            <!-- Left section -->
68
+            <div class="flex items-center space-x-3">
69
+                <!-- Icon -->
70
+                <x-filament::icon
71
+                    icon="heroicon-o-credit-card"
72
+                    class="h-8 w-8 text-primary-600 dark:text-primary-500 flex-shrink-0 mr-4"
73
+                />
74
+                <!-- Text content -->
75
+                <div>
76
+                    <h1 class="text-lg font-semibold text-gray-900 dark:text-gray-100">Manage Payments</h1>
77
+                    <p class="text-sm text-gray-600 dark:text-gray-400">Amount Due: {{ CurrencyConverter::formatToMoney($getRecord()->amount_due) }}</p>
78
+                </div>
79
+            </div>
80
+
81
+            <!-- Right section -->
82
+            @if($getRecord()->status->value !== 'draft')
83
+                <div class="flex flex-row items-center space-x-2">
84
+                    {{ $getAction('recordPayment') }}
85
+                </div>
86
+            @endif
87
+        </div>
88
+    </x-filament::section>
89
+</div>

Loading…
Cancel
Save