Переглянути джерело

Merge pull request #33 from andrewdwallo/development

Update invoice preview templates
3.x
Andrew Wallo 1 рік тому
джерело
коміт
ddf8347a0c
Аккаунт користувача з таким Email не знайдено

+ 15
- 10
app/Filament/Company/Pages/Setting/Invoice.php Переглянути файл

@@ -13,7 +13,7 @@ use Filament\Forms\Components\Checkbox;
13 13
 use Filament\Forms\Components\ColorPicker;
14 14
 use Filament\Forms\Components\Component;
15 15
 use Filament\Forms\Components\FileUpload;
16
-use Filament\Forms\Components\Group;
16
+use Filament\Forms\Components\Grid;
17 17
 use Filament\Forms\Components\Section;
18 18
 use Filament\Forms\Components\Select;
19 19
 use Filament\Forms\Components\Textarea;
@@ -173,19 +173,19 @@ class Invoice extends Page
173 173
         return Section::make('Template')
174 174
             ->description('Choose the template and edit the column names.')
175 175
             ->schema([
176
-                Group::make()
176
+                Grid::make(1)
177 177
                     ->schema([
178 178
                         FileUpload::make('logo')
179 179
                             ->openable()
180
-                            ->maxSize(2048)
180
+                            ->maxSize(1024)
181 181
                             ->localizeLabel()
182 182
                             ->visibility('public')
183 183
                             ->disk('public')
184 184
                             ->directory('logos/document')
185 185
                             ->imageResizeMode('contain')
186
-                            ->imageCropAspectRatio('1:1')
187
-                            ->panelAspectRatio('1:1')
188
-                            ->panelLayout('compact')
186
+                            ->imageCropAspectRatio('3:2')
187
+                            ->panelAspectRatio('3:2')
188
+                            ->panelLayout('integrated')
189 189
                             ->removeUploadedFileButtonPosition('center bottom')
190 190
                             ->uploadButtonPosition('center bottom')
191 191
                             ->uploadProgressIndicatorPosition('center bottom')
@@ -193,8 +193,10 @@ class Invoice extends Page
193 193
                                 static fn (TemporaryUploadedFile $file): string => (string) str($file->getClientOriginalName())
194 194
                                     ->prepend(Auth::user()->currentCompany->id . '_'),
195 195
                             )
196
-                            ->extraAttributes(['class' => 'w-32 h-32'])
197
-                            ->acceptedFileTypes(['image/png', 'image/jpeg']),
196
+                            ->extraAttributes([
197
+                                'class' => 'aspect-[3/2] w-[9.375rem] max-w-full',
198
+                            ])
199
+                            ->acceptedFileTypes(['image/png', 'image/jpeg', 'image/gif']),
198 200
                         Checkbox::make('show_logo')
199 201
                             ->localizeLabel(),
200 202
                         ColorPicker::make('accent_color')
@@ -285,18 +287,21 @@ class Invoice extends Page
285 287
                             ->hiddenLabel()
286 288
                             ->disabled(static fn (callable $get) => $get('amount_name.option') !== 'other')
287 289
                             ->nullable(),
288
-                    ])->columns(1),
289
-                Group::make()
290
+                    ])->columnSpan(1),
291
+                Grid::make()
290 292
                     ->schema([
291 293
                         ViewField::make('preview.default')
294
+                            ->columnSpan(2)
292 295
                             ->hiddenLabel()
293 296
                             ->visible(static fn (callable $get) => $get('template') === 'default')
294 297
                             ->view('filament.company.components.invoice-layouts.default'),
295 298
                         ViewField::make('preview.modern')
299
+                            ->columnSpan(2)
296 300
                             ->hiddenLabel()
297 301
                             ->visible(static fn (callable $get) => $get('template') === 'modern')
298 302
                             ->view('filament.company.components.invoice-layouts.modern'),
299 303
                         ViewField::make('preview.classic')
304
+                            ->columnSpan(2)
300 305
                             ->hiddenLabel()
301 306
                             ->visible(static fn (callable $get) => $get('template') === 'classic')
302 307
                             ->view('filament.company.components.invoice-layouts.classic'),

+ 13
- 0
app/Models/Setting/DocumentDefault.php Переглянути файл

@@ -12,10 +12,12 @@ use App\Traits\CompanyOwned;
12 12
 use Database\Factories\Setting\DocumentDefaultFactory;
13 13
 use Illuminate\Database\Eloquent\Builder;
14 14
 use Illuminate\Database\Eloquent\Casts\AsArrayObject;
15
+use Illuminate\Database\Eloquent\Casts\Attribute;
15 16
 use Illuminate\Database\Eloquent\Factories\Factory;
16 17
 use Illuminate\Database\Eloquent\Factories\HasFactory;
17 18
 use Illuminate\Database\Eloquent\Model;
18 19
 use Illuminate\Database\Eloquent\Relations\BelongsTo;
20
+use Illuminate\Support\Facades\Storage;
19 21
 use Wallo\FilamentCompanies\FilamentCompanies;
20 22
 
21 23
 class DocumentDefault extends Model
@@ -62,6 +64,17 @@ class DocumentDefault extends Model
62 64
         'amount_name' => AsArrayObject::class,
63 65
     ];
64 66
 
67
+    protected $appends = [
68
+        'logo_url',
69
+    ];
70
+
71
+    protected function logoUrl(): Attribute
72
+    {
73
+        return Attribute::get(static function (mixed $value, array $attributes): ?string {
74
+            return $attributes['logo'] ? Storage::disk('public')->url($attributes['logo']) : null;
75
+        });
76
+    }
77
+
65 78
     public function company(): BelongsTo
66 79
     {
67 80
         return $this->belongsTo(FilamentCompanies::companyModel(), 'company_id');

+ 0
- 1
app/Models/Setting/Localization.php Переглянути файл

@@ -15,7 +15,6 @@ use Illuminate\Database\Eloquent\Model;
15 15
 use Illuminate\Database\Eloquent\Relations\BelongsTo;
16 16
 use NumberFormatter;
17 17
 use ResourceBundle;
18
-use Symfony\Component\Intl\Languages;
19 18
 use Wallo\FilamentCompanies\FilamentCompanies;
20 19
 use Wallo\Transmatic\Facades\Transmatic;
21 20
 

+ 0
- 2
app/Observers/CurrencyObserver.php Переглянути файл

@@ -5,7 +5,6 @@ namespace App\Observers;
5 5
 use App\Events\CurrencyRateChanged;
6 6
 use App\Events\DefaultCurrencyChanged;
7 7
 use App\Models\Setting\Currency;
8
-use Illuminate\Support\Facades\Log;
9 8
 
10 9
 class CurrencyObserver
11 10
 {
@@ -27,7 +26,6 @@ class CurrencyObserver
27 26
         }
28 27
 
29 28
         if ($currency->wasChanged('rate')) {
30
-            Log::info('Currency rate changed');
31 29
             event(new CurrencyRateChanged($currency));
32 30
         }
33 31
     }

+ 3
- 3
app/Services/CurrencyService.php Переглянути файл

@@ -10,13 +10,13 @@ use Illuminate\Support\Facades\Log;
10 10
 
11 11
 class CurrencyService implements CurrencyHandler
12 12
 {
13
-    protected string|null $api_key;
13
+    protected ?string $api_key;
14 14
 
15
-    protected string|null $base_url;
15
+    protected ?string $base_url;
16 16
 
17 17
     protected Client $client;
18 18
 
19
-    public function __construct(string|null $api_key, string|null $base_url, Client $client)
19
+    public function __construct(?string $api_key, ?string $base_url, Client $client)
20 20
     {
21 21
         $this->api_key = $api_key;
22 22
         $this->base_url = $base_url;

+ 1
- 1
app/View/Models/InvoiceViewModel.php Переглянути файл

@@ -23,7 +23,7 @@ class InvoiceViewModel
23 23
 
24 24
     public function logo(): ?string
25 25
     {
26
-        return $this->invoice->logo ?? null;
26
+        return $this->invoice->logo_url;
27 27
     }
28 28
 
29 29
     public function show_logo(): bool

+ 90
- 90
composer.lock Переглянути файл

@@ -293,16 +293,16 @@
293 293
         },
294 294
         {
295 295
             "name": "aws/aws-crt-php",
296
-            "version": "v1.2.3",
296
+            "version": "v1.2.4",
297 297
             "source": {
298 298
                 "type": "git",
299 299
                 "url": "https://github.com/awslabs/aws-crt-php.git",
300
-                "reference": "5545a4fa310aec39f54279fdacebcce33b3ff382"
300
+                "reference": "eb0c6e4e142224a10b08f49ebf87f32611d162b2"
301 301
             },
302 302
             "dist": {
303 303
                 "type": "zip",
304
-                "url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/5545a4fa310aec39f54279fdacebcce33b3ff382",
305
-                "reference": "5545a4fa310aec39f54279fdacebcce33b3ff382",
304
+                "url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/eb0c6e4e142224a10b08f49ebf87f32611d162b2",
305
+                "reference": "eb0c6e4e142224a10b08f49ebf87f32611d162b2",
306 306
                 "shasum": ""
307 307
             },
308 308
             "require": {
@@ -341,22 +341,22 @@
341 341
             ],
342 342
             "support": {
343 343
                 "issues": "https://github.com/awslabs/aws-crt-php/issues",
344
-                "source": "https://github.com/awslabs/aws-crt-php/tree/v1.2.3"
344
+                "source": "https://github.com/awslabs/aws-crt-php/tree/v1.2.4"
345 345
             },
346
-            "time": "2023-10-16T20:10:06+00:00"
346
+            "time": "2023-11-08T00:42:13+00:00"
347 347
         },
348 348
         {
349 349
             "name": "aws/aws-sdk-php",
350
-            "version": "3.287.0",
350
+            "version": "3.288.1",
351 351
             "source": {
352 352
                 "type": "git",
353 353
                 "url": "https://github.com/aws/aws-sdk-php.git",
354
-                "reference": "06978bfc63111fccd78b364238bf214b4ade8d18"
354
+                "reference": "a1dfa12c7165de0b731ae8074c4ba1f3ae733f89"
355 355
             },
356 356
             "dist": {
357 357
                 "type": "zip",
358
-                "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/06978bfc63111fccd78b364238bf214b4ade8d18",
359
-                "reference": "06978bfc63111fccd78b364238bf214b4ade8d18",
358
+                "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/a1dfa12c7165de0b731ae8074c4ba1f3ae733f89",
359
+                "reference": "a1dfa12c7165de0b731ae8074c4ba1f3ae733f89",
360 360
                 "shasum": ""
361 361
             },
362 362
             "require": {
@@ -436,9 +436,9 @@
436 436
             "support": {
437 437
                 "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
438 438
                 "issues": "https://github.com/aws/aws-sdk-php/issues",
439
-                "source": "https://github.com/aws/aws-sdk-php/tree/3.287.0"
439
+                "source": "https://github.com/aws/aws-sdk-php/tree/3.288.1"
440 440
             },
441
-            "time": "2023-11-17T20:03:36+00:00"
441
+            "time": "2023-11-22T19:35:38+00:00"
442 442
         },
443 443
         {
444 444
             "name": "aws/aws-sdk-php-laravel",
@@ -1075,16 +1075,16 @@
1075 1075
         },
1076 1076
         {
1077 1077
             "name": "doctrine/dbal",
1078
-            "version": "3.7.1",
1078
+            "version": "3.7.2",
1079 1079
             "source": {
1080 1080
                 "type": "git",
1081 1081
                 "url": "https://github.com/doctrine/dbal.git",
1082
-                "reference": "5b7bd66c9ff58c04c5474ab85edce442f8081cb2"
1082
+                "reference": "0ac3c270590e54910715e9a1a044cc368df282b2"
1083 1083
             },
1084 1084
             "dist": {
1085 1085
                 "type": "zip",
1086
-                "url": "https://api.github.com/repos/doctrine/dbal/zipball/5b7bd66c9ff58c04c5474ab85edce442f8081cb2",
1087
-                "reference": "5b7bd66c9ff58c04c5474ab85edce442f8081cb2",
1086
+                "url": "https://api.github.com/repos/doctrine/dbal/zipball/0ac3c270590e54910715e9a1a044cc368df282b2",
1087
+                "reference": "0ac3c270590e54910715e9a1a044cc368df282b2",
1088 1088
                 "shasum": ""
1089 1089
             },
1090 1090
             "require": {
@@ -1100,7 +1100,7 @@
1100 1100
                 "doctrine/coding-standard": "12.0.0",
1101 1101
                 "fig/log-test": "^1",
1102 1102
                 "jetbrains/phpstorm-stubs": "2023.1",
1103
-                "phpstan/phpstan": "1.10.35",
1103
+                "phpstan/phpstan": "1.10.42",
1104 1104
                 "phpstan/phpstan-strict-rules": "^1.5",
1105 1105
                 "phpunit/phpunit": "9.6.13",
1106 1106
                 "psalm/plugin-phpunit": "0.18.4",
@@ -1168,7 +1168,7 @@
1168 1168
             ],
1169 1169
             "support": {
1170 1170
                 "issues": "https://github.com/doctrine/dbal/issues",
1171
-                "source": "https://github.com/doctrine/dbal/tree/3.7.1"
1171
+                "source": "https://github.com/doctrine/dbal/tree/3.7.2"
1172 1172
             },
1173 1173
             "funding": [
1174 1174
                 {
@@ -1184,7 +1184,7 @@
1184 1184
                     "type": "tidelift"
1185 1185
                 }
1186 1186
             ],
1187
-            "time": "2023-10-06T05:06:20+00:00"
1187
+            "time": "2023-11-19T08:06:58+00:00"
1188 1188
         },
1189 1189
         {
1190 1190
             "name": "doctrine/deprecations",
@@ -1622,16 +1622,16 @@
1622 1622
         },
1623 1623
         {
1624 1624
             "name": "filament/actions",
1625
-            "version": "v3.0.98",
1625
+            "version": "v3.0.101",
1626 1626
             "source": {
1627 1627
                 "type": "git",
1628 1628
                 "url": "https://github.com/filamentphp/actions.git",
1629
-                "reference": "7fc130d8eafcd231f4ff19ffda4aacca0423e22e"
1629
+                "reference": "9d233cd7ab0353bdd293178d3ecd72adfedf9b58"
1630 1630
             },
1631 1631
             "dist": {
1632 1632
                 "type": "zip",
1633
-                "url": "https://api.github.com/repos/filamentphp/actions/zipball/7fc130d8eafcd231f4ff19ffda4aacca0423e22e",
1634
-                "reference": "7fc130d8eafcd231f4ff19ffda4aacca0423e22e",
1633
+                "url": "https://api.github.com/repos/filamentphp/actions/zipball/9d233cd7ab0353bdd293178d3ecd72adfedf9b58",
1634
+                "reference": "9d233cd7ab0353bdd293178d3ecd72adfedf9b58",
1635 1635
                 "shasum": ""
1636 1636
             },
1637 1637
             "require": {
@@ -1668,20 +1668,20 @@
1668 1668
                 "issues": "https://github.com/filamentphp/filament/issues",
1669 1669
                 "source": "https://github.com/filamentphp/filament"
1670 1670
             },
1671
-            "time": "2023-11-14T12:07:19+00:00"
1671
+            "time": "2023-11-21T10:53:03+00:00"
1672 1672
         },
1673 1673
         {
1674 1674
             "name": "filament/filament",
1675
-            "version": "v3.0.98",
1675
+            "version": "v3.0.101",
1676 1676
             "source": {
1677 1677
                 "type": "git",
1678 1678
                 "url": "https://github.com/filamentphp/panels.git",
1679
-                "reference": "7a7c432db38ccb29fb3591609f896da265f54aeb"
1679
+                "reference": "5a2f300db927972cd14c613496f412672a83eef6"
1680 1680
             },
1681 1681
             "dist": {
1682 1682
                 "type": "zip",
1683
-                "url": "https://api.github.com/repos/filamentphp/panels/zipball/7a7c432db38ccb29fb3591609f896da265f54aeb",
1684
-                "reference": "7a7c432db38ccb29fb3591609f896da265f54aeb",
1683
+                "url": "https://api.github.com/repos/filamentphp/panels/zipball/5a2f300db927972cd14c613496f412672a83eef6",
1684
+                "reference": "5a2f300db927972cd14c613496f412672a83eef6",
1685 1685
                 "shasum": ""
1686 1686
             },
1687 1687
             "require": {
@@ -1733,20 +1733,20 @@
1733 1733
                 "issues": "https://github.com/filamentphp/filament/issues",
1734 1734
                 "source": "https://github.com/filamentphp/filament"
1735 1735
             },
1736
-            "time": "2023-11-18T17:32:25+00:00"
1736
+            "time": "2023-11-22T10:40:13+00:00"
1737 1737
         },
1738 1738
         {
1739 1739
             "name": "filament/forms",
1740
-            "version": "v3.0.98",
1740
+            "version": "v3.0.101",
1741 1741
             "source": {
1742 1742
                 "type": "git",
1743 1743
                 "url": "https://github.com/filamentphp/forms.git",
1744
-                "reference": "ed55409ba339e921d21d1c99816767d3c6e3f391"
1744
+                "reference": "927e53280d5d2cad493a0a9e486fd86b5252492a"
1745 1745
             },
1746 1746
             "dist": {
1747 1747
                 "type": "zip",
1748
-                "url": "https://api.github.com/repos/filamentphp/forms/zipball/ed55409ba339e921d21d1c99816767d3c6e3f391",
1749
-                "reference": "ed55409ba339e921d21d1c99816767d3c6e3f391",
1748
+                "url": "https://api.github.com/repos/filamentphp/forms/zipball/927e53280d5d2cad493a0a9e486fd86b5252492a",
1749
+                "reference": "927e53280d5d2cad493a0a9e486fd86b5252492a",
1750 1750
                 "shasum": ""
1751 1751
             },
1752 1752
             "require": {
@@ -1789,20 +1789,20 @@
1789 1789
                 "issues": "https://github.com/filamentphp/filament/issues",
1790 1790
                 "source": "https://github.com/filamentphp/filament"
1791 1791
             },
1792
-            "time": "2023-11-16T11:21:55+00:00"
1792
+            "time": "2023-11-22T10:39:50+00:00"
1793 1793
         },
1794 1794
         {
1795 1795
             "name": "filament/infolists",
1796
-            "version": "v3.0.98",
1796
+            "version": "v3.0.101",
1797 1797
             "source": {
1798 1798
                 "type": "git",
1799 1799
                 "url": "https://github.com/filamentphp/infolists.git",
1800
-                "reference": "c4585485e32e8eca21d11855cbc512e2703e3879"
1800
+                "reference": "3a2d085af84d97c5861cd23f6c553f1600c2de4b"
1801 1801
             },
1802 1802
             "dist": {
1803 1803
                 "type": "zip",
1804
-                "url": "https://api.github.com/repos/filamentphp/infolists/zipball/c4585485e32e8eca21d11855cbc512e2703e3879",
1805
-                "reference": "c4585485e32e8eca21d11855cbc512e2703e3879",
1804
+                "url": "https://api.github.com/repos/filamentphp/infolists/zipball/3a2d085af84d97c5861cd23f6c553f1600c2de4b",
1805
+                "reference": "3a2d085af84d97c5861cd23f6c553f1600c2de4b",
1806 1806
                 "shasum": ""
1807 1807
             },
1808 1808
             "require": {
@@ -1840,20 +1840,20 @@
1840 1840
                 "issues": "https://github.com/filamentphp/filament/issues",
1841 1841
                 "source": "https://github.com/filamentphp/filament"
1842 1842
             },
1843
-            "time": "2023-11-16T11:21:58+00:00"
1843
+            "time": "2023-11-22T10:39:48+00:00"
1844 1844
         },
1845 1845
         {
1846 1846
             "name": "filament/notifications",
1847
-            "version": "v3.0.98",
1847
+            "version": "v3.0.101",
1848 1848
             "source": {
1849 1849
                 "type": "git",
1850 1850
                 "url": "https://github.com/filamentphp/notifications.git",
1851
-                "reference": "65ac499a30fe00e9e2b21cd873e7a10e28f9efb8"
1851
+                "reference": "88324fa22de9d3b9cc94e3feebb786fe00a35b31"
1852 1852
             },
1853 1853
             "dist": {
1854 1854
                 "type": "zip",
1855
-                "url": "https://api.github.com/repos/filamentphp/notifications/zipball/65ac499a30fe00e9e2b21cd873e7a10e28f9efb8",
1856
-                "reference": "65ac499a30fe00e9e2b21cd873e7a10e28f9efb8",
1855
+                "url": "https://api.github.com/repos/filamentphp/notifications/zipball/88324fa22de9d3b9cc94e3feebb786fe00a35b31",
1856
+                "reference": "88324fa22de9d3b9cc94e3feebb786fe00a35b31",
1857 1857
                 "shasum": ""
1858 1858
             },
1859 1859
             "require": {
@@ -1892,11 +1892,11 @@
1892 1892
                 "issues": "https://github.com/filamentphp/filament/issues",
1893 1893
                 "source": "https://github.com/filamentphp/filament"
1894 1894
             },
1895
-            "time": "2023-11-14T12:07:17+00:00"
1895
+            "time": "2023-11-21T10:52:57+00:00"
1896 1896
         },
1897 1897
         {
1898 1898
             "name": "filament/spatie-laravel-tags-plugin",
1899
-            "version": "v3.0.98",
1899
+            "version": "v3.0.101",
1900 1900
             "source": {
1901 1901
                 "type": "git",
1902 1902
                 "url": "https://github.com/filamentphp/spatie-laravel-tags-plugin.git",
@@ -1933,16 +1933,16 @@
1933 1933
         },
1934 1934
         {
1935 1935
             "name": "filament/support",
1936
-            "version": "v3.0.98",
1936
+            "version": "v3.0.101",
1937 1937
             "source": {
1938 1938
                 "type": "git",
1939 1939
                 "url": "https://github.com/filamentphp/support.git",
1940
-                "reference": "25e220044d467a335250a45d1e9a081f6bd9aad2"
1940
+                "reference": "c84e267ab68bea6899a46330f69f88b4d449171a"
1941 1941
             },
1942 1942
             "dist": {
1943 1943
                 "type": "zip",
1944
-                "url": "https://api.github.com/repos/filamentphp/support/zipball/25e220044d467a335250a45d1e9a081f6bd9aad2",
1945
-                "reference": "25e220044d467a335250a45d1e9a081f6bd9aad2",
1944
+                "url": "https://api.github.com/repos/filamentphp/support/zipball/c84e267ab68bea6899a46330f69f88b4d449171a",
1945
+                "reference": "c84e267ab68bea6899a46330f69f88b4d449171a",
1946 1946
                 "shasum": ""
1947 1947
             },
1948 1948
             "require": {
@@ -1986,20 +1986,20 @@
1986 1986
                 "issues": "https://github.com/filamentphp/filament/issues",
1987 1987
                 "source": "https://github.com/filamentphp/filament"
1988 1988
             },
1989
-            "time": "2023-11-18T17:32:24+00:00"
1989
+            "time": "2023-11-22T10:40:22+00:00"
1990 1990
         },
1991 1991
         {
1992 1992
             "name": "filament/tables",
1993
-            "version": "v3.0.98",
1993
+            "version": "v3.0.101",
1994 1994
             "source": {
1995 1995
                 "type": "git",
1996 1996
                 "url": "https://github.com/filamentphp/tables.git",
1997
-                "reference": "94552ed5cf5089c69cc23eb7159704151760c837"
1997
+                "reference": "e57a670396f564f7aa840fe3f81705777d94a2b5"
1998 1998
             },
1999 1999
             "dist": {
2000 2000
                 "type": "zip",
2001
-                "url": "https://api.github.com/repos/filamentphp/tables/zipball/94552ed5cf5089c69cc23eb7159704151760c837",
2002
-                "reference": "94552ed5cf5089c69cc23eb7159704151760c837",
2001
+                "url": "https://api.github.com/repos/filamentphp/tables/zipball/e57a670396f564f7aa840fe3f81705777d94a2b5",
2002
+                "reference": "e57a670396f564f7aa840fe3f81705777d94a2b5",
2003 2003
                 "shasum": ""
2004 2004
             },
2005 2005
             "require": {
@@ -2039,20 +2039,20 @@
2039 2039
                 "issues": "https://github.com/filamentphp/filament/issues",
2040 2040
                 "source": "https://github.com/filamentphp/filament"
2041 2041
             },
2042
-            "time": "2023-11-15T11:34:47+00:00"
2042
+            "time": "2023-11-22T10:40:18+00:00"
2043 2043
         },
2044 2044
         {
2045 2045
             "name": "filament/widgets",
2046
-            "version": "v3.0.98",
2046
+            "version": "v3.0.101",
2047 2047
             "source": {
2048 2048
                 "type": "git",
2049 2049
                 "url": "https://github.com/filamentphp/widgets.git",
2050
-                "reference": "d441b9f583b3261ed5e09cd407913dd1f3a5a70d"
2050
+                "reference": "a1612c8992598fdc5c800eaa80697a9b82f79d7e"
2051 2051
             },
2052 2052
             "dist": {
2053 2053
                 "type": "zip",
2054
-                "url": "https://api.github.com/repos/filamentphp/widgets/zipball/d441b9f583b3261ed5e09cd407913dd1f3a5a70d",
2055
-                "reference": "d441b9f583b3261ed5e09cd407913dd1f3a5a70d",
2054
+                "url": "https://api.github.com/repos/filamentphp/widgets/zipball/a1612c8992598fdc5c800eaa80697a9b82f79d7e",
2055
+                "reference": "a1612c8992598fdc5c800eaa80697a9b82f79d7e",
2056 2056
                 "shasum": ""
2057 2057
             },
2058 2058
             "require": {
@@ -2083,7 +2083,7 @@
2083 2083
                 "issues": "https://github.com/filamentphp/filament/issues",
2084 2084
                 "source": "https://github.com/filamentphp/filament"
2085 2085
             },
2086
-            "time": "2023-11-14T12:07:39+00:00"
2086
+            "time": "2023-11-20T15:19:04+00:00"
2087 2087
         },
2088 2088
         {
2089 2089
             "name": "fruitcake/php-cors",
@@ -2687,16 +2687,16 @@
2687 2687
         },
2688 2688
         {
2689 2689
             "name": "laravel/framework",
2690
-            "version": "v10.32.1",
2690
+            "version": "v10.33.0",
2691 2691
             "source": {
2692 2692
                 "type": "git",
2693 2693
                 "url": "https://github.com/laravel/framework.git",
2694
-                "reference": "b30e44f20d244f7ba125283e14a8bbac167f4e5b"
2694
+                "reference": "4536872e3e5b6be51b1f655dafd12c9a4fa0cfe8"
2695 2695
             },
2696 2696
             "dist": {
2697 2697
                 "type": "zip",
2698
-                "url": "https://api.github.com/repos/laravel/framework/zipball/b30e44f20d244f7ba125283e14a8bbac167f4e5b",
2699
-                "reference": "b30e44f20d244f7ba125283e14a8bbac167f4e5b",
2698
+                "url": "https://api.github.com/repos/laravel/framework/zipball/4536872e3e5b6be51b1f655dafd12c9a4fa0cfe8",
2699
+                "reference": "4536872e3e5b6be51b1f655dafd12c9a4fa0cfe8",
2700 2700
                 "shasum": ""
2701 2701
             },
2702 2702
             "require": {
@@ -2885,7 +2885,7 @@
2885 2885
                 "issues": "https://github.com/laravel/framework/issues",
2886 2886
                 "source": "https://github.com/laravel/framework"
2887 2887
             },
2888
-            "time": "2023-11-14T22:57:08+00:00"
2888
+            "time": "2023-11-21T14:49:31+00:00"
2889 2889
         },
2890 2890
         {
2891 2891
             "name": "laravel/prompts",
@@ -3855,16 +3855,16 @@
3855 3855
         },
3856 3856
         {
3857 3857
             "name": "livewire/livewire",
3858
-            "version": "v3.1.0",
3858
+            "version": "v3.2.1",
3859 3859
             "source": {
3860 3860
                 "type": "git",
3861 3861
                 "url": "https://github.com/livewire/livewire.git",
3862
-                "reference": "db1e02c645ae12a7cdee9b1ea0d65bf3aafc0f08"
3862
+                "reference": "95083c0b61c1910ad28c4628e0dfa9c227eb1c41"
3863 3863
             },
3864 3864
             "dist": {
3865 3865
                 "type": "zip",
3866
-                "url": "https://api.github.com/repos/livewire/livewire/zipball/db1e02c645ae12a7cdee9b1ea0d65bf3aafc0f08",
3867
-                "reference": "db1e02c645ae12a7cdee9b1ea0d65bf3aafc0f08",
3866
+                "url": "https://api.github.com/repos/livewire/livewire/zipball/95083c0b61c1910ad28c4628e0dfa9c227eb1c41",
3867
+                "reference": "95083c0b61c1910ad28c4628e0dfa9c227eb1c41",
3868 3868
                 "shasum": ""
3869 3869
             },
3870 3870
             "require": {
@@ -3917,7 +3917,7 @@
3917 3917
             "description": "A front-end framework for Laravel.",
3918 3918
             "support": {
3919 3919
                 "issues": "https://github.com/livewire/livewire/issues",
3920
-                "source": "https://github.com/livewire/livewire/tree/v3.1.0"
3920
+                "source": "https://github.com/livewire/livewire/tree/v3.2.1"
3921 3921
             },
3922 3922
             "funding": [
3923 3923
                 {
@@ -3925,7 +3925,7 @@
3925 3925
                     "type": "github"
3926 3926
                 }
3927 3927
             ],
3928
-            "time": "2023-11-03T15:05:18+00:00"
3928
+            "time": "2023-11-20T17:05:06+00:00"
3929 3929
         },
3930 3930
         {
3931 3931
             "name": "masterminds/html5",
@@ -6001,7 +6001,7 @@
6001 6001
         },
6002 6002
         {
6003 6003
             "name": "squirephp/model",
6004
-            "version": "v3.4.2",
6004
+            "version": "v3.4.4",
6005 6005
             "source": {
6006 6006
                 "type": "git",
6007 6007
                 "url": "https://github.com/squirephp/model.git",
@@ -6055,7 +6055,7 @@
6055 6055
         },
6056 6056
         {
6057 6057
             "name": "squirephp/repository",
6058
-            "version": "v3.4.2",
6058
+            "version": "v3.4.4",
6059 6059
             "source": {
6060 6060
                 "type": "git",
6061 6061
                 "url": "https://github.com/squirephp/repository.git",
@@ -9039,16 +9039,16 @@
9039 9039
         },
9040 9040
         {
9041 9041
             "name": "laravel/sail",
9042
-            "version": "v1.26.0",
9042
+            "version": "v1.26.1",
9043 9043
             "source": {
9044 9044
                 "type": "git",
9045 9045
                 "url": "https://github.com/laravel/sail.git",
9046
-                "reference": "c60fe037004e272efd0d81f416ed2bfc623d70b4"
9046
+                "reference": "7a82f5aa364dbee3fd9c52fc464cf0bdd11150ed"
9047 9047
             },
9048 9048
             "dist": {
9049 9049
                 "type": "zip",
9050
-                "url": "https://api.github.com/repos/laravel/sail/zipball/c60fe037004e272efd0d81f416ed2bfc623d70b4",
9051
-                "reference": "c60fe037004e272efd0d81f416ed2bfc623d70b4",
9050
+                "url": "https://api.github.com/repos/laravel/sail/zipball/7a82f5aa364dbee3fd9c52fc464cf0bdd11150ed",
9051
+                "reference": "7a82f5aa364dbee3fd9c52fc464cf0bdd11150ed",
9052 9052
                 "shasum": ""
9053 9053
             },
9054 9054
             "require": {
@@ -9100,7 +9100,7 @@
9100 9100
                 "issues": "https://github.com/laravel/sail/issues",
9101 9101
                 "source": "https://github.com/laravel/sail"
9102 9102
             },
9103
-            "time": "2023-10-18T13:57:15+00:00"
9103
+            "time": "2023-11-20T15:56:47+00:00"
9104 9104
         },
9105 9105
         {
9106 9106
             "name": "mockery/mockery",
@@ -9455,16 +9455,16 @@
9455 9455
         },
9456 9456
         {
9457 9457
             "name": "phpunit/php-code-coverage",
9458
-            "version": "10.1.8",
9458
+            "version": "10.1.9",
9459 9459
             "source": {
9460 9460
                 "type": "git",
9461 9461
                 "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
9462
-                "reference": "84838eed9ded511f61dc3e8b5944a52d9017b297"
9462
+                "reference": "a56a9ab2f680246adcf3db43f38ddf1765774735"
9463 9463
             },
9464 9464
             "dist": {
9465 9465
                 "type": "zip",
9466
-                "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/84838eed9ded511f61dc3e8b5944a52d9017b297",
9467
-                "reference": "84838eed9ded511f61dc3e8b5944a52d9017b297",
9466
+                "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/a56a9ab2f680246adcf3db43f38ddf1765774735",
9467
+                "reference": "a56a9ab2f680246adcf3db43f38ddf1765774735",
9468 9468
                 "shasum": ""
9469 9469
             },
9470 9470
             "require": {
@@ -9521,7 +9521,7 @@
9521 9521
             "support": {
9522 9522
                 "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
9523 9523
                 "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
9524
-                "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.8"
9524
+                "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.9"
9525 9525
             },
9526 9526
             "funding": [
9527 9527
                 {
@@ -9529,7 +9529,7 @@
9529 9529
                     "type": "github"
9530 9530
                 }
9531 9531
             ],
9532
-            "time": "2023-11-15T13:31:15+00:00"
9532
+            "time": "2023-11-23T12:23:20+00:00"
9533 9533
         },
9534 9534
         {
9535 9535
             "name": "phpunit/php-file-iterator",
@@ -11171,16 +11171,16 @@
11171 11171
         },
11172 11172
         {
11173 11173
             "name": "theseer/tokenizer",
11174
-            "version": "1.2.1",
11174
+            "version": "1.2.2",
11175 11175
             "source": {
11176 11176
                 "type": "git",
11177 11177
                 "url": "https://github.com/theseer/tokenizer.git",
11178
-                "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e"
11178
+                "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96"
11179 11179
             },
11180 11180
             "dist": {
11181 11181
                 "type": "zip",
11182
-                "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e",
11183
-                "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e",
11182
+                "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96",
11183
+                "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96",
11184 11184
                 "shasum": ""
11185 11185
             },
11186 11186
             "require": {
@@ -11209,7 +11209,7 @@
11209 11209
             "description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
11210 11210
             "support": {
11211 11211
                 "issues": "https://github.com/theseer/tokenizer/issues",
11212
-                "source": "https://github.com/theseer/tokenizer/tree/1.2.1"
11212
+                "source": "https://github.com/theseer/tokenizer/tree/1.2.2"
11213 11213
             },
11214 11214
             "funding": [
11215 11215
                 {
@@ -11217,7 +11217,7 @@
11217 11217
                     "type": "github"
11218 11218
                 }
11219 11219
             ],
11220
-            "time": "2021-07-28T10:34:58+00:00"
11220
+            "time": "2023-11-20T00:12:19+00:00"
11221 11221
         }
11222 11222
     ],
11223 11223
     "aliases": [],

+ 30
- 15
package-lock.json Переглянути файл

@@ -647,9 +647,9 @@
647 647
             }
648 648
         },
649 649
         "node_modules/caniuse-lite": {
650
-            "version": "1.0.30001563",
651
-            "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001563.tgz",
652
-            "integrity": "sha512-na2WUmOxnwIZtwnFI2CZ/3er0wdNzU7hN+cPYz/z2ajHThnkWjNBOpEPP4n+4r2WPM847JaMotaJE3bnfzjyKw==",
650
+            "version": "1.0.30001564",
651
+            "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001564.tgz",
652
+            "integrity": "sha512-DqAOf+rhof+6GVx1y+xzbFPeOumfQnhYzVnZD6LAXijR77yPtm9mfOcqOnT3mpnJiZVT+kwLAFnRlZcIz+c6bg==",
653 653
             "dev": true,
654 654
             "funding": [
655 655
                 {
@@ -766,9 +766,9 @@
766 766
             "dev": true
767 767
         },
768 768
         "node_modules/electron-to-chromium": {
769
-            "version": "1.4.588",
770
-            "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.588.tgz",
771
-            "integrity": "sha512-soytjxwbgcCu7nh5Pf4S2/4wa6UIu+A3p03U2yVr53qGxi1/VTR3ENI+p50v+UxqqZAfl48j3z55ud7VHIOr9w==",
769
+            "version": "1.4.594",
770
+            "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.594.tgz",
771
+            "integrity": "sha512-xT1HVAu5xFn7bDfkjGQi9dNpMqGchUkebwf1GL7cZN32NSwwlHRPMSDJ1KN6HkS0bWUtndbSQZqvpQftKG2uFQ==",
772 772
             "dev": true
773 773
         },
774 774
         "node_modules/esbuild": {
@@ -1374,21 +1374,27 @@
1374 1374
             }
1375 1375
         },
1376 1376
         "node_modules/postcss-load-config": {
1377
-            "version": "4.0.1",
1378
-            "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.1.tgz",
1379
-            "integrity": "sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==",
1377
+            "version": "4.0.2",
1378
+            "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.2.tgz",
1379
+            "integrity": "sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==",
1380 1380
             "dev": true,
1381
+            "funding": [
1382
+                {
1383
+                    "type": "opencollective",
1384
+                    "url": "https://opencollective.com/postcss/"
1385
+                },
1386
+                {
1387
+                    "type": "github",
1388
+                    "url": "https://github.com/sponsors/ai"
1389
+                }
1390
+            ],
1381 1391
             "dependencies": {
1382
-                "lilconfig": "^2.0.5",
1383
-                "yaml": "^2.1.1"
1392
+                "lilconfig": "^3.0.0",
1393
+                "yaml": "^2.3.4"
1384 1394
             },
1385 1395
             "engines": {
1386 1396
                 "node": ">= 14"
1387 1397
             },
1388
-            "funding": {
1389
-                "type": "opencollective",
1390
-                "url": "https://opencollective.com/postcss/"
1391
-            },
1392 1398
             "peerDependencies": {
1393 1399
                 "postcss": ">=8.0.9",
1394 1400
                 "ts-node": ">=9.0.0"
@@ -1402,6 +1408,15 @@
1402 1408
                 }
1403 1409
             }
1404 1410
         },
1411
+        "node_modules/postcss-load-config/node_modules/lilconfig": {
1412
+            "version": "3.0.0",
1413
+            "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.0.0.tgz",
1414
+            "integrity": "sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==",
1415
+            "dev": true,
1416
+            "engines": {
1417
+                "node": ">=14"
1418
+            }
1419
+        },
1405 1420
         "node_modules/postcss-nested": {
1406 1421
             "version": "6.0.1",
1407 1422
             "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.0.1.tgz",

+ 2
- 1
resources/css/filament/company/tailwind.config.js Переглянути файл

@@ -5,6 +5,7 @@ export default {
5 5
     content: [
6 6
         './app/Filament/Company/**/*.php',
7 7
         './resources/views/filament/company/**/*.blade.php',
8
+        './resources/views/components/company/**/*.blade.php',
8 9
         './vendor/filament/**/*.blade.php',
9 10
         './vendor/andrewdwallo/filament-companies/resources/views/**/*.blade.php',
10 11
         './vendor/andrewdwallo/filament-selectify/resources/views/**/*.blade.php',
@@ -17,7 +18,7 @@ export default {
17 18
                 platinum: '#E8E9EB',
18 19
                 moonlight: '#F6F5F3',
19 20
                 translucent: 'rgba(54, 54, 52, 0.06)',
20
-            }
21
+            },
21 22
         }
22 23
     }
23 24
 }

+ 5
- 0
resources/views/components/company/invoice/container.blade.php Переглянути файл

@@ -0,0 +1,5 @@
1
+<div class="inv-container flex justify-center p-6">
2
+    <div class="inv-paper bg-[#ffffff] dark:bg-gray-800 rounded-sm shadow-xl w-[38.25rem] h-[49.5rem] overflow-hidden">
3
+        {{ $slot }}
4
+    </div>
5
+</div>

+ 3
- 0
resources/views/components/company/invoice/footer.blade.php Переглянути файл

@@ -0,0 +1,3 @@
1
+<footer {{ $attributes->class(['inv-footer text-xs text-gray-600 dark:text-gray-300']) }}>
2
+    {{ $slot }}
3
+</footer>

+ 3
- 0
resources/views/components/company/invoice/header.blade.php Переглянути файл

@@ -0,0 +1,3 @@
1
+<header {{ $attributes->class(['inv-header flex py-2 relative']) }}>
2
+    {{ $slot }}
3
+</header>

+ 3
- 0
resources/views/components/company/invoice/line-items.blade.php Переглянути файл

@@ -0,0 +1,3 @@
1
+<div {{ $attributes->class(['inv-line-items py-6']) }}>
2
+    {{ $slot }}
3
+</div>

+ 26
- 0
resources/views/components/company/invoice/logo.blade.php Переглянути файл

@@ -0,0 +1,26 @@
1
+@props([
2
+    'shape' => 'square',
3
+    'size' => 'md',
4
+])
5
+
6
+<img {{
7
+    $attributes
8
+        ->class([
9
+            'inv-logo object-contain',
10
+            match ($size) {
11
+                'sm' => 'max-h-8',
12
+                'md' => 'max-h-16',
13
+                'lg' => 'max-h-24',
14
+                'xl' => 'max-h-32',
15
+                default => $size,
16
+            },
17
+            match ($shape) {
18
+                'square' => 'rounded-none',
19
+                'rounded' => 'rounded-md',
20
+                'circle' => 'rounded-full',
21
+                default => $shape,
22
+            },
23
+        ])
24
+}}
25
+/>
26
+

+ 3
- 0
resources/views/components/company/invoice/metadata.blade.php Переглянути файл

@@ -0,0 +1,3 @@
1
+<section {{ $attributes->class(['inv-metadata px-6 pt-4']) }}>
2
+    {{ $slot }}
3
+</section>

+ 10
- 0
resources/views/components/icons/decor-border-left.blade.php Переглянути файл

@@ -0,0 +1,10 @@
1
+@props([
2
+    'color' => 'currentColor',
3
+])
4
+
5
+<svg xmlns="http://www.w3.org/2000/svg" height="72" width="28" viewBox="0 0 28 72" aria-hidden="true" {{ $attributes }}>
6
+    <g fill="none" stroke-width="2" stroke="{{ $color }}">
7
+        <path d="M183 57.038v-42.076c-.33.025-.664.038-1 .038-7.18 0-13-5.82-13-13 0-.336.013-.67.038-1h-154.076c.025.33.038.664.038 1 0 7.18-5.82 13-13 13-.336 0-.67-.013-1-.038v42.076c.33-.025.664-.038 1-.038 7.18 0 13 5.82 13 13 0 .336-.013.67-.038 1h154.076c-.025-.33-.038-.664-.038-1 0-7.18 5.82-13 13-13 .336 0 .67.013 1 .038z" />
8
+        <path d="M177 51.503v-31.007c-.33.024-.664.037-1 .037-7.18 0-13-5.626-13-12.567 0-.325.013-.648.038-.967h-142.076c.025.319.038.641.038.967 0 6.94-5.82 12.567-13 12.567-.336 0-.67-.012-1-.037v31.007c.33-.024.664-.037 1-.037 7.18 0 13 5.626 13 12.567 0 .325-.013.648-.038.967h142.076c-.025-.319-.038-.641-.038-.967 0-6.94 5.82-12.567 13-12.567.336 0 .67.012 1 .037z" />
9
+    </g>
10
+</svg>

+ 10
- 0
resources/views/components/icons/decor-border-right.blade.php Переглянути файл

@@ -0,0 +1,10 @@
1
+@props([
2
+    'color' => 'currentColor',
3
+])
4
+
5
+<svg xmlns="http://www.w3.org/2000/svg" height="72" width="28" viewBox="0 0 28 72" aria-hidden="true" {{ $attributes }}>
6
+    <g fill="none" stroke-width="2" stroke="{{ $color }}">
7
+        <path d="M27 57.038v-42.076c-.33.025-.664.038-1 .038-7.18 0-13-5.82-13-13 0-.336.013-.67.038-1h-154.076c.025.33.038.664.038 1 0 7.18-5.82 13-13 13-.336 0-.67-.013-1-.038v42.076c.33-.025.664-.038 1-.038 7.18 0 13 5.82 13 13 0 .336-.013.67-.038 1h154.076c-.025-.33-.038-.664-.038-1 0-7.18 5.82-13 13-13 .336 0 .67.013 1 .038z"></path>
8
+        <path d="M21 51.503v-31.007c-.33.024-.664.037-1 .037-7.18 0-13-5.626-13-12.567 0-.325.013-.648.038-.967h-142.076c.025.319.038.641.038.967 0 6.94-5.82 12.567-13 12.567-.336 0-.67-.012-1-.037v31.007c.33-.024.664-.037 1-.037 7.18 0 13 5.626 13 12.567 0 .325-.013.648-.038.967h142.076c-.025-.319-.038-.641-.038-.967 0-6.94 5.82-12.567 13-12.567.336 0 .67.012 1 .037z"></path>
9
+    </g>
10
+</svg>

+ 121
- 130
resources/views/filament/company/components/invoice-layouts/classic.blade.php Переглянути файл

@@ -8,27 +8,18 @@
8 8
 {!! $font_html !!}
9 9
 
10 10
 <style>
11
-    .paper {
11
+    .inv-paper {
12 12
         font-family: '{{ $font_family }}', sans-serif;
13 13
     }
14 14
 </style>
15 15
 
16
-<div class="print-template flex justify-center p-6">
17
-    <div class="paper bg-[#ffffff] dark:bg-gray-950 p-8 rounded-lg shadow-[0_0_10px_rgba(0,0,0,0.1)] w-[612px] h-[791px]">
18
-
19
-        <!-- Header Section -->
20
-        <div class="flex justify-between items-start pb-3">
21
-            <!-- Logo -->
22
-            <div style="width: 20%;" class="text-left">
23
-                @if($logo && $show_logo)
24
-                    <img src="{{ URL::asset($logo) }}" alt="logo" style="width: 100%; height: auto">
25
-                @endif
26
-            </div>
27
-
28
-            <!-- Company Details -->
29
-            <div style="width: 60%;" class="text-right text-xs text-gray-600 dark:text-gray-200 space-y-1">
30
-                <h2 class="text-xl font-bold text-gray-800 dark:text-white">{{ $company_name }}</h2>
31
-                @if($company_address && $company_city && $company_state)
16
+<x-company.invoice.container class="classic-template-container">
17
+    <!-- Header Section -->
18
+    <x-company.invoice.header class="default-template-header">
19
+        <div class="w-2/3 text-left ml-6">
20
+            <div class="text-xs">
21
+                <h2 class="text-base font-semibold">{{ $company_name }}</h2>
22
+                @if($company_address && $company_city && $company_state && $company_zip)
32 23
                     <p>{{ $company_address }}</p>
33 24
                     <p>{{ $company_city }}, {{ $company_state }} {{ $company_zip }}</p>
34 25
                     <p>{{ $company_country }}</p>
@@ -36,134 +27,134 @@
36 27
             </div>
37 28
         </div>
38 29
 
39
-        <!-- Empty line for spacing -->
40
-        <div class="my-4"></div>
41
-
42
-        <!-- Invoice Title/Header Centered -->
43
-        <div class="text-center" style="height: 60px;">
44
-            <h1 class="text-3xl font-semibold text-gray-800 dark:text-white">{{ $header }}</h1>
45
-            @if ($subheader)
46
-                <p class="text-sm text-gray-600">{{ $subheader }}</p>
30
+        <div class="w-1/3 flex justify-end mr-6">
31
+            @if($logo && $show_logo)
32
+                <x-company.invoice.logo :src="$logo" />
47 33
             @endif
48 34
         </div>
35
+    </x-company.invoice.header>
49 36
 
50
-        <!-- Billing and Invoice Summary -->
51
-        <div class="flex justify-between pt-4">
52
-            <!-- Label for Billing and Invoice Details -->
53
-            <div class="text-base text-gray-600 dark:text-gray-200 mb-2">
54
-                <h4 class="font-semibold">Bill To:</h4>
37
+    <x-company.invoice.metadata class="classic-template-metadata">
38
+        <div class="items-center flex">
39
+            <hr class="grow-[2] py-0.5 border-double border-y-2" style="border-color: {{ $accent_color }};">
40
+            <div class="items-center flex mx-5">
41
+                <x-icons.decor-border-left color="{{ $accent_color }}" />
42
+                <div class="px-2.5 border-double border-y-2 py-1 -mx-3" style="border-color: {{ $accent_color }};">
43
+                    <div class="px-2.5 border-double border-y-2 py-3" style="border-color: {{ $accent_color }};">
44
+                        <div class="inline text-2xl font-semibold" style="color: {{ $accent_color }};">{{ $header }}</div>
45
+                    </div>
46
+                </div>
47
+                <x-icons.decor-border-right color="{{ $accent_color }}" />
55 48
             </div>
49
+            <hr class="grow-[2] py-0.5 border-double border-y-2" style="border-color: {{ $accent_color }};">
56 50
         </div>
51
+        <div class="mt-2 text-sm text-center text-gray-600 dark:text-gray-400">{{ $subheader }}</div>
57 52
 
58
-        <div class="flex justify-between" style="height: 60px;">
53
+        <div class="flex justify-between items-end">
59 54
             <!-- Billing Details -->
60
-            <table style="width: 65%">
61
-                <tbody class="text-xs text-left p-1">
62
-                <tr>
63
-                    <td>John Doe</td>
64
-                </tr>
65
-                <tr>
66
-                    <td>123 Main Street</td>
67
-                </tr>
68
-                <tr>
69
-                    <td>New York, NY 10001</td>
70
-                </tr>
71
-                </tbody>
72
-            </table>
73
-
74
-            <!-- Invoice Details -->
75
-            <table style="width: 35%">
76
-                <tbody class="text-xs text-right p-1">
77
-                <tr>
78
-                    <td>Invoice No:</td>
79
-                    <td>{{ $invoice_number }}</td>
80
-                </tr>
81
-                <tr>
82
-                    <td>Invoice Date:</td>
83
-                    <td>{{ $invoice_date }}</td>
84
-                </tr>
85
-                <tr>
86
-                    <td>Invoice Due:</td>
87
-                    <td>{{ $invoice_due_date }}</td>
88
-                </tr>
89
-                </tbody>
90
-            </table>
91
-        </div>
92
-
55
+            <div class="text-xs">
56
+                <h3 class="text-gray-600 dark:text-gray-400 font-medium tracking-tight mb-1">BILL TO</h3>
57
+                <p class="text-base font-bold">John Doe</p>
58
+                <p>123 Main Street</p>
59
+                <p>New York, New York 10001</p>
60
+                <p>United States</p>
61
+            </div>
93 62
 
94
-        <!-- Line Items -->
95
-        <div class="my-8">
96
-            <table class="w-full text-sm border-collapse">
97
-                <thead class="border-b-2">
63
+            <div class="text-xs">
64
+                <table class="min-w-full">
65
+                    <tbody>
98 66
                     <tr>
99
-                        <th class="p-2 w-1/12 text-center">#</th>
100
-                        <th class="p-2 w-5/12 text-left">{{ $item_name }}</th>
101
-                        <th class="p-2 w-2/12 text-right">{{ $unit_name }}</th>
102
-                        <th class="p-2 w-2/12 text-right">{{ $price_name }}</th>
103
-                        <th class="p-2 w-2/12 text-right">{{ $amount_name }}</th>
67
+                        <td class="font-semibold text-right pr-2">Invoice Number:</td>
68
+                        <td class="text-left pl-2">{{ $invoice_number }}</td>
104 69
                     </tr>
105
-                </thead>
106
-                <tbody class="text-xs">
107
-                    <tr class="border-b">
108
-                        <td class="p-2 text-center">1</td>
109
-                        <td class="p-2 text-left">Web Development</td>
110
-                        <td class="p-2 text-right">10</td>
111
-                        <td class="p-2 text-right">$100.00</td>
112
-                        <td class="p-2 text-right">$1000.00</td>
113
-                    </tr>
114
-                    <tr class="border-b">
115
-                        <td class="p-2 text-center">2</td>
116
-                        <td class="p-2 text-left">Consulting</td>
117
-                        <td class="p-2 text-right">5</td>
118
-                        <td class="p-2 text-right">$200.00</td>
119
-                        <td class="p-2 text-right">$1000.00</td>
70
+                    <tr>
71
+                        <td class="font-semibold text-right pr-2">Invoice Date:</td>
72
+                        <td class="text-left pl-2">{{ $invoice_date }}</td>
120 73
                     </tr>
121
-                    <tr class="border-b">
122
-                        <td class="p-2 text-center">3</td>
123
-                        <td class="p-2 text-left">Design Services</td>
124
-                        <td class="p-2 text-right">8</td>
125
-                        <td class="p-2 text-right">$125.00</td>
126
-                        <td class="p-2 text-right">$1000.00</td>
74
+                    <tr>
75
+                        <td class="font-semibold text-right pr-2">Payment Due:</td>
76
+                        <td class="text-left pl-2">{{ $invoice_due_date }}</td>
127 77
                     </tr>
128
-                </tbody>
129
-            </table>
78
+                    </tbody>
79
+                </table>
80
+            </div>
81
+        </div>
82
+    </x-company.invoice.metadata>
130 83
 
131
-            <!-- Financial Details and Notes -->
132
-            <div class="flex justify-between text-xs">
133
-                <!-- Notes Section -->
134
-                <div class="w-8/12 border rounded p-2 mt-4">
135
-                    <h4 class="font-semibold mb-2">Notes:</h4>
136
-                    <p>{{ $footer }}</p>
137
-                </div>
84
+    <!-- Line Items -->
85
+    <x-company.invoice.line-items class="classic-template-line-items px-6">
86
+        <table class="w-full text-left table-fixed">
87
+            <thead class="text-sm leading-8">
88
+            <tr>
89
+                <th class="text-left">{{ $item_name }}</th>
90
+                <th class="text-center">{{ $unit_name }}</th>
91
+                <th class="text-right">{{ $price_name }}</th>
92
+                <th class="text-right">{{ $amount_name }}</th>
93
+            </tr>
94
+            </thead>
95
+            <tbody class="text-xs border-t-2 border-b-2 border-dotted border-gray-300 leading-8">
96
+            <tr>
97
+                <td class="text-left font-semibold">Item 1</td>
98
+                <td class="text-center">2</td>
99
+                <td class="text-right">$150.00</td>
100
+                <td class="text-right">$300.00</td>
101
+            </tr>
102
+            <tr>
103
+                <td class="text-left font-semibold">Item 2</td>
104
+                <td class="text-center">3</td>
105
+                <td class="text-right">$200.00</td>
106
+                <td class="text-right">$600.00</td>
107
+            </tr>
108
+            <tr>
109
+                <td class="text-left font-semibold">Item 3</td>
110
+                <td class="text-center">1</td>
111
+                <td class="text-right">$180.00</td>
112
+                <td class="text-right">$180.00</td>
113
+            </tr>
114
+            </tbody>
115
+        </table>
138 116
 
139
-                <!-- Financial Summary -->
140
-                <div class="w-4/12 mt-2">
141
-                    <table class="w-full border-collapse">
142
-                        <tbody class="text-right">
143
-                            <tr>
144
-                                <td class="p-2">Subtotal:</td>
145
-                                <td class="p-2">$3000.00</td>
146
-                            </tr>
147
-                            <tr>
148
-                                <td class="p-2">Tax:</td>
149
-                                <td class="p-2">$300.00</td>
150
-                            </tr>
151
-                            <tr>
152
-                                <td class="p-2">Total:</td>
153
-                                <td class="p-2">$3300.00</td>
154
-                            </tr>
155
-                        </tbody>
156
-                    </table>
157
-                </div>
117
+        <!-- Financial Details and Notes -->
118
+        <div class="flex justify-between text-xs space-x-1">
119
+            <!-- Notes Section -->
120
+            <div class="w-1/2 border border-dashed border-gray-300 p-2 mt-4">
121
+                <h4 class="font-semibold mb-2">Notes</h4>
122
+                <p>{{ $footer }}</p>
158 123
             </div>
159
-        </div>
160 124
 
161
-        <!-- Footer -->
162
-        <div class="flex justify-between mt-8 border-t-2 pt-4">
163
-            <div class="text-xs text-gray-600 dark:text-gray-300">
164
-                <h4 class="font-semibold mb-2">Terms & Conditions:</h4>
165
-                <p>{{ $terms }}</p>
125
+            <!-- Financial Summary -->
126
+            <div class="w-1/2 mt-2">
127
+                <table class="w-full table-fixed">
128
+                    <tbody class="text-xs leading-loose">
129
+                        <tr>
130
+                            <td class="text-right font-semibold">Subtotal:</td>
131
+                            <td class="text-right">$1080.00</td>
132
+                        </tr>
133
+                        <tr class="text-success-800 dark:text-success-600">
134
+                            <td class="text-right">Discount (5%):</td>
135
+                            <td class="text-right">($54.00)</td>
136
+                        </tr>
137
+                        <tr>
138
+                            <td class="text-right">Sales Tax (10%):</td>
139
+                            <td class="text-right">$102.60</td>
140
+                        </tr>
141
+                        <tr>
142
+                            <td class="text-right font-semibold">Total:</td>
143
+                            <td class="text-right">$1128.60</td>
144
+                        </tr>
145
+                        <tr>
146
+                            <td class="text-right font-semibold">Amount Due (USD):</td>
147
+                            <td class="text-right">$1128.60</td>
148
+                        </tr>
149
+                    </tbody>
150
+                </table>
166 151
             </div>
167 152
         </div>
168
-    </div>
169
-</div>
153
+    </x-company.invoice.line-items>
154
+
155
+    <!-- Footer -->
156
+    <x-company.invoice.footer class="classic-template-footer">
157
+        <h4 class="font-semibold px-6 mb-2">Terms & Conditions</h4>
158
+        <p class="px-6 break-words line-clamp-4">{{ $terms }}</p>
159
+    </x-company.invoice.footer>
160
+</x-company.invoice.container>

+ 115
- 103
resources/views/filament/company/components/invoice-layouts/default.blade.php Переглянути файл

@@ -8,125 +8,137 @@
8 8
 {!! $font_html !!}
9 9
 
10 10
 <style>
11
-    .paper {
11
+    .inv-paper {
12 12
         font-family: '{{ $font_family }}', sans-serif;
13 13
     }
14 14
 </style>
15 15
 
16
-<div class="print-template flex justify-center p-6">
17
-    <div class="paper bg-[#ffffff] dark:bg-gray-950 p-8 rounded-lg shadow-[0_0_10px_rgba(0,0,0,0.1)] w-[612px] h-[791px]">
16
+<x-company.invoice.container class="default-template-container">
18 17
 
19
-        <!-- Header: Logo on the left and Company details on the right -->
20
-        <div class="flex mb-4">
21
-            <div class="w-2/5">
22
-                @if($logo && $show_logo)
23
-                    <div class="text-left">
24
-                        <img src="{{ \Illuminate\Support\Facades\URL::asset($logo) }}" alt="logo" style="width: 120px; height: auto">
25
-                    </div>
26
-                @endif
27
-            </div>
28
-
29
-            <!-- Company Details -->
30
-            <div class="w-3/5">
31
-                <div class="text-xs text-gray-600 dark:text-gray-200 text-right space-y-1">
32
-                    <h2 class="text-xl font-bold text-gray-800 dark:text-white">{{ $company_name }}</h2>
33
-                    @if($company_address && $company_city && $company_state && $company_zip)
34
-                        <p>{{ $company_address }}</p>
35
-                        <p>{{ $company_city }}, {{ $company_state }} {{ $company_zip }}</p>
36
-                        <p>{{ $company_country }}</p>
37
-                    @endif
38
-                </div>
39
-            </div>
18
+    <x-company.invoice.header class="default-template-header border-b-2 p-6 pb-4">
19
+        <div class="w-2/3">
20
+            @if($logo && $show_logo)
21
+                <x-company.invoice.logo :src="$logo" />
22
+            @endif
40 23
         </div>
41 24
 
42
-        <!-- Border Line -->
43
-        <div class="border-b-2 my-4" style="border-color: {{ $accent_color }}"></div>
44
-
45
-        <!-- Invoice Details -->
46
-        <div class="flex mb-4">
47
-            <div class="w-2/5">
48
-                <div class="text-left">
49
-                    <h1 class="text-3xl font-semibold text-gray-800 dark:text-white">{{ $header }}</h1>
50
-                    @if ($subheader)
51
-                        <p class="text-sm text-gray-600 dark:text-gray-100">{{ $subheader }}</p>
52
-                    @endif
53
-                </div>
54
-            </div>
55
-
56
-            <div class="w-3/5">
57
-                <div class="text-right">
58
-                    <p>
59
-                        <span class="text-xs font-semibold text-gray-500 dark:text-gray-100">No: </span>
60
-                        <span class="text-xs text-gray-700 dark:text-white">{{ $invoice_number }}</span>
61
-                    </p>
62
-                    <p>
63
-                        <span class="text-xs font-semibold text-gray-500 dark:text-gray-100">Date: </span>
64
-                        <span class="text-xs text-gray-500 dark:text-white">{{ $invoice_date }}</span>
65
-                    </p>
66
-                    <p>
67
-                        <span class="text-xs font-semibold text-gray-500 dark:text-gray-100">Due Date: </span>
68
-                        <span class="text-xs text-gray-500 dark:text-white">{{ $invoice_due_date }}</span>
69
-                    </p>
70
-                </div>
25
+        <div class="w-1/3 text-right">
26
+            <div class="text-xs">
27
+                <h2 class="font-semibold">{{ $company_name }}</h2>
28
+                @if($company_address && $company_city && $company_state && $company_zip)
29
+                    <p>{{ $company_address }}</p>
30
+                    <p>{{ $company_city }}, {{ $company_state }} {{ $company_zip }}</p>
31
+                    <p>{{ $company_country }}</p>
32
+                @endif
71 33
             </div>
72 34
         </div>
35
+    </x-company.invoice.header>
73 36
 
74
-        <!-- Billing Details -->
75
-        <div class="text-xs text-gray-600 dark:text-gray-200 mb-4">
76
-            <h3 class="text-base font-semibold text-gray-600 dark:text-gray-200 mb-2">BILL TO</h3>
77
-            <p class="text-sm text-gray-800 dark:text-white font-semibold">John Doe</p>
78
-            <p>123 Main Street</p>
79
-            <p>New York, NY 10001</p>
37
+    <x-company.invoice.metadata class="default-template-metadata space-y-6">
38
+        <div>
39
+            <h1 class="text-3xl font-light uppercase">{{ $header }}</h1>
40
+            @if ($subheader)
41
+                <h2 class="text-sm text-gray-600 dark:text-gray-400">{{ $subheader }}</h2>
42
+            @endif
80 43
         </div>
81 44
 
82
-        <!-- Line Items Table -->
83
-        <div class="mb-4">
84
-            <table class="w-full border-collapse text-sm">
85
-                <thead>
86
-                    <tr style="color: {{ $accent_color }}">
87
-                        <th class="text-left p-2 w-1/2">{{ $item_name }}</th>
88
-                        <th class="text-center p-2 w-1/6">{{ $unit_name }}</th>
89
-                        <th class="text-center p-2 w-1/6">{{ $price_name }}</th>
90
-                        <th class="text-center p-2 w-1/6">{{ $amount_name }}</th>
91
-                    </tr>
92
-                </thead>
93
-                <tbody>
94
-                    <tr class="bg-gray-200/75 dark:bg-gray-800">
95
-                        <td class="p-2">Item 1</td>
96
-                        <td class="p-2 text-center">2</td>
97
-                        <td class="p-2 text-center">$150.00</td>
98
-                        <td class="p-2 text-center">$300.00</td>
45
+        <div class="flex justify-between items-end">
46
+            <!-- Billing Details -->
47
+            <div class="text-xs">
48
+                <h3 class="text-gray-600 dark:text-gray-400 font-medium tracking-tight mb-1">BILL TO</h3>
49
+                <p class="text-base font-bold">John Doe</p>
50
+                <p>123 Main Street</p>
51
+                <p>New York, New York 10001</p>
52
+                <p>United States</p>
53
+            </div>
54
+
55
+            <div class="text-xs">
56
+                <table class="min-w-full">
57
+                    <tbody>
58
+                    <tr>
59
+                        <td class="font-semibold text-right pr-2">Invoice Number:</td>
60
+                        <td class="text-left pl-2">{{ $invoice_number }}</td>
99 61
                     </tr>
100 62
                     <tr>
101
-                        <td class="p-2">Item 2</td>
102
-                        <td class="p-2 text-center">3</td>
103
-                        <td class="p-2 text-center">$200.00</td>
104
-                        <td class="p-2 text-center">$600.00</td>
63
+                        <td class="font-semibold text-right pr-2">Invoice Date:</td>
64
+                        <td class="text-left pl-2">{{ $invoice_date }}</td>
105 65
                     </tr>
106
-                    <tr class="bg-gray-200/75 dark:bg-gray-800">
107
-                        <td class="p-2">Item 3</td>
108
-                        <td class="p-2 text-center">1</td>
109
-                        <td class="p-2 text-center">$200.00</td>
110
-                        <td class="p-2 text-center">$200.00</td>
66
+                    <tr>
67
+                        <td class="font-semibold text-right pr-2">Payment Due:</td>
68
+                        <td class="text-left pl-2">{{ $invoice_due_date }}</td>
111 69
                     </tr>
112
-                </tbody>
113
-            </table>
70
+                    </tbody>
71
+                </table>
72
+            </div>
114 73
         </div>
74
+    </x-company.invoice.metadata>
115 75
 
116
-        <!-- Total Amount -->
117
-        <div class="text-right mb-8">
118
-            <p class="text-sm text-gray-600 dark:text-gray-200">Subtotal: $1100.00</p>
119
-            <p class="text-sm text-gray-600 dark:text-gray-200">Tax: $110.00</p>
120
-            <p class="text-lg font-semibold text-gray-800 dark:text-white">Total: $1210.00</p>
121
-        </div>
76
+    <!-- Line Items Table -->
77
+    <x-company.invoice.line-items class="default-template-line-items">
78
+        <table class="w-full text-left table-fixed">
79
+            <thead class="text-sm leading-8" style="background: {{ $accent_color }}">
80
+                <tr class="text-white">
81
+                    <th class="text-left pl-6">{{ $item_name }}</th>
82
+                    <th class="text-center">{{ $unit_name }}</th>
83
+                    <th class="text-right">{{ $price_name }}</th>
84
+                    <th class="text-right pr-6">{{ $amount_name }}</th>
85
+                </tr>
86
+            </thead>
87
+            <tbody class="text-xs border-b-2 border-gray-300 leading-8">
88
+            <tr>
89
+                <td class="text-left pl-6 font-semibold">Item 1</td>
90
+                <td class="text-center">2</td>
91
+                <td class="text-right">$150.00</td>
92
+                <td class="text-right pr-6">$300.00</td>
93
+            </tr>
94
+            <tr>
95
+                <td class="text-left pl-6 font-semibold">Item 2</td>
96
+                <td class="text-center">3</td>
97
+                <td class="text-right">$200.00</td>
98
+                <td class="text-right pr-6">$600.00</td>
99
+            </tr>
100
+            <tr>
101
+                <td class="text-left pl-6 font-semibold">Item 3</td>
102
+                <td class="text-center">1</td>
103
+                <td class="text-right">$180.00</td>
104
+                <td class="text-right pr-6">$180.00</td>
105
+            </tr>
106
+            </tbody>
107
+            <tfoot class="text-xs leading-loose">
108
+                <tr>
109
+                    <td class="pl-6" colspan="2"></td>
110
+                    <td class="text-right font-semibold">Subtotal:</td>
111
+                    <td class="text-right pr-6">$1080.00</td>
112
+                </tr>
113
+                <tr class="text-success-800 dark:text-success-600">
114
+                    <td class="pl-6" colspan="2"></td>
115
+                    <td class="text-right">Discount (5%):</td>
116
+                    <td class="text-right pr-6">($54.00)</td>
117
+                </tr>
118
+                <tr>
119
+                    <td class="pl-6" colspan="2"></td>
120
+                    <td class="text-right">Sales Tax (10%):</td>
121
+                    <td class="text-right pr-6">$102.60</td>
122
+                </tr>
123
+                <tr>
124
+                    <td class="pl-6" colspan="2"></td>
125
+                    <td class="text-right font-semibold border-t">Total:</td>
126
+                    <td class="text-right border-t pr-6">$1128.60</td>
127
+                </tr>
128
+                <tr>
129
+                    <td class="pl-6" colspan="2"></td>
130
+                    <td class="text-right font-semibold border-t-4 border-double">Amount Due (USD):</td>
131
+                    <td class="text-right border-t-4 border-double pr-6">$1128.60</td>
132
+                </tr>
133
+            </tfoot>
134
+        </table>
135
+    </x-company.invoice.line-items>
122 136
 
123
-        <!-- Footer Notes -->
124
-        <div class="pt-6 text-gray-600 dark:text-gray-300 text-xs">
125
-            <p>{{ $footer }}</p>
126
-            <div class="mt-2 border-t-2 border-gray-300 py-2">
127
-                <h4 class="font-semibold text-gray-700 dark:text-gray-100 mb-2">Terms & Conditions:</h4>
128
-                <p>{{ $terms }}</p>
129
-            </div>
130
-        </div>
131
-    </div>
132
-</div>
137
+    <!-- Footer Notes -->
138
+    <x-company.invoice.footer class="default-template-footer">
139
+        <p class="px-6">{{ $footer }}</p>
140
+        <span class="border-t-2 my-2 border-gray-300 block w-full"></span>
141
+        <h4 class="font-semibold px-6 mb-2">Terms & Conditions</h4>
142
+        <p class="px-6 break-words line-clamp-4">{{ $terms }}</p>
143
+    </x-company.invoice.footer>
144
+</x-company.invoice.container>

+ 115
- 129
resources/views/filament/company/components/invoice-layouts/modern.blade.php Переглянути файл

@@ -8,154 +8,140 @@
8 8
 {!! $font_html !!}
9 9
 
10 10
 <style>
11
-    .paper {
11
+    .inv-paper {
12 12
         font-family: '{{ $font_family }}', sans-serif;
13 13
     }
14 14
 </style>
15 15
 
16
-<div class="print-template flex justify-center p-6">
17
-    <div class="paper bg-[#ffffff] dark:bg-gray-950 p-8 rounded-lg shadow-[0_0_10px_rgba(0,0,0,0.1)] w-[612px] h-[791px]">
16
+<x-company.invoice.container class="modern-template-container">
18 17
 
19
-        <!-- Colored Header with Logo -->
20
-        <div class="flex">
21
-            <div class="text-white py-3 flex items-start justify-start bg-gray-800" style="height: 80px; width: 85%;">
22
-                @if($logo && $show_logo)
23
-                    <div class="text-left">
24
-                        <img src="{{ \Illuminate\Support\Facades\URL::asset($logo) }}" alt="logo" style="width: 120px; height: auto">
25
-                    </div>
26
-                @endif
27
-            </div>
28
-
29
-            <!-- Ribbon Container -->
30
-            <div class="text-white flex flex-col justify-end p-2" style="background: {{ $accent_color }}; width: 30%; height: 120px; margin-left: -15%;">
31
-                @if($header)
32
-                    <div class="text-center align-bottom">
33
-                        <h1 class="text-3xl font-bold">{{ $header }}</h1>
34
-                    </div>
35
-                @endif
36
-            </div>
18
+    <!-- Colored Header with Logo -->
19
+    <x-company.invoice.header class="bg-gray-800 h-20">
20
+        <!-- Logo -->
21
+        <div class="w-2/3">
22
+            @if($logo && $show_logo)
23
+                <x-company.invoice.logo class="ml-6" :src="$logo" />
24
+            @endif
37 25
         </div>
38 26
 
39
-        <!-- Company Details -->
40
-        <div class="flex justify-between">
41
-            <div class="text-xs text-gray-600 dark:text-gray-200 space-y-1">
42
-                <h2 class="text-xl font-bold text-gray-800 dark:text-white">{{ $company_name }}</h2>
43
-                @if($company_address && $company_city && $company_state && $company_zip)
44
-                    <p>{{ $company_address }}</p>
45
-                    <p>{{ $company_city }}, {{ $company_state }} {{ $company_zip }}</p>
46
-                    <p>{{ $company_country }}</p>
47
-                @endif
48
-            </div>
27
+        <!-- Ribbon Container -->
28
+        <div class="w-1/3 absolute right-0 top-0 p-2 h-28 flex flex-col justify-end rounded-bl-sm" style="background: {{ $accent_color }};">
29
+            @if($header)
30
+                <h1 class="text-3xl font-bold text-white text-center uppercase">{{ $header }}</h1>
31
+            @endif
32
+        </div>
33
+    </x-company.invoice.header>
49 34
 
50
-            <table class="mt-6" style="width: 35%; height: 100px">
51
-                <thead class="border-b-2" style="border-color: {{ $accent_color }}">
52
-                <tr class="p-1">
53
-                    <th class="text-xs text text-gray-500 text-right">Total Due</th>
54
-                    <th class="text-xs text-gray-500 text-left">:</th>
55
-                    <th class="text-sm font-semibold text-gray-800 dark:text-white text-right">USD $1100.00</th>
56
-                </tr>
57
-                </thead>
58
-                <tr>
59
-                    <td colspan="3" class="py-1"></td>
60
-                </tr>
61
-                <tbody class="text-xs text-gray-500 dark:text-white">
62
-                <tr class="p-1">
63
-                    <td class="text-right">Invoice No</td>
64
-                    <td class="text-left">:</td>
65
-                    <td class="text-right">{{ $invoice_number }}</td>
66
-                </tr>
67
-                <tr class="p-1">
68
-                    <td class="text-right">Invoice Date</td>
69
-                    <td class="text-left">:</td>
70
-                    <td class="text-right">{{ $invoice_date }}</td>
71
-                </tr>
72
-                <tr class="p-1">
73
-                    <td class="text-right">Invoice Due</td>
74
-                    <td class="text-left">:</td>
75
-                    <td class="text-right">{{ $invoice_due_date }}</td>
76
-                </tr>
77
-                </tbody>
78
-            </table>
35
+    <!-- Company Details -->
36
+    <x-company.invoice.metadata class="modern-template-metadata space-y-6">
37
+        <div class="text-xs">
38
+            <h2 class="text-base font-semibold">{{ $company_name }}</h2>
39
+            @if($company_address && $company_city && $company_state && $company_zip)
40
+                <p>{{ $company_address }}</p>
41
+                <p>{{ $company_city }}, {{ $company_state }} {{ $company_zip }}</p>
42
+                <p>{{ $company_country }}</p>
43
+            @endif
79 44
         </div>
80 45
 
81
-        <!-- Billing Details -->
82
-        <div class="text-xs text-gray-600 dark:text-gray-200 mb-4">
83
-            <h3 class="text-base font-semibold text-gray-600 dark:text-gray-200 tracking-tight mb-2">BILL TO</h3>
84
-            <p class="text-lg font-semibold" style="color: {{ $accent_color }}">John Doe</p>
85
-            <p>123 Main Street</p>
86
-            <p>New York, NY 10001</p>
46
+        <div class="flex justify-between items-end">
47
+            <!-- Billing Details -->
48
+            <div class="text-xs">
49
+                <h3 class="text-gray-600 dark:text-gray-400 font-medium tracking-tight mb-1">BILL TO</h3>
50
+                <p class="text-base font-bold" style="color: {{ $accent_color }}">John Doe</p>
51
+                <p>123 Main Street</p>
52
+                <p>New York, New York 10001</p>
53
+                <p>United States</p>
54
+            </div>
55
+
56
+            <div class="text-xs">
57
+                <table class="min-w-full">
58
+                    <tbody>
59
+                    <tr>
60
+                        <td class="font-semibold text-right pr-2">Invoice Number:</td>
61
+                        <td class="text-left pl-2">{{ $invoice_number }}</td>
62
+                    </tr>
63
+                    <tr>
64
+                        <td class="font-semibold text-right pr-2">Invoice Date:</td>
65
+                        <td class="text-left pl-2">{{ $invoice_date }}</td>
66
+                    </tr>
67
+                    <tr>
68
+                        <td class="font-semibold text-right pr-2">Payment Due:</td>
69
+                        <td class="text-left pl-2">{{ $invoice_due_date }}</td>
70
+                    </tr>
71
+                    </tbody>
72
+                </table>
73
+            </div>
87 74
         </div>
75
+    </x-company.invoice.metadata>
88 76
 
89
-        <!-- Line Items Table -->
90
-        <div class="mb-8">
91
-            <table class="w-full border-collapse text-sm">
92
-                <thead style="background: {{ $accent_color }};">
93
-                <tr class="text-[#ffffff]">
94
-                    <th class="text-left p-2 w-1/12">No</th>
95
-                    <th class="text-left p-2 w-7/12">{{ $item_name }}</th>
96
-                    <th class="text-left p-2 w-1/6">{{ $unit_name }}</th>
97
-                    <th class="text-left p-2 w-1/6">{{ $price_name }}</th>
98
-                    <th class="text-left p-2 w-1/6">{{ $amount_name }}</th>
99
-                </tr>
100
-                </thead>
101
-                <tbody class="text-xs">
102
-                <tr class="border-b border-gray-300">
103
-                    <td class="p-2 bg-gray-100 dark:bg-gray-800">01</td>
104
-                    <td class="p-2">Item 1</td>
105
-                    <td class="p-2 bg-gray-100 dark:bg-gray-800">2</td>
106
-                    <td class="p-2">$150.00</td>
107
-                    <td class="p-2 bg-gray-100 dark:bg-gray-800">$300.00</td>
108
-                </tr>
109
-                <tr class="border-b border-gray-300">
110
-                    <td class="p-2 bg-gray-100 dark:bg-gray-800">02</td>
111
-                    <td class="p-2">Item 2</td>
112
-                    <td class="p-2 bg-gray-100 dark:bg-gray-800">3</td>
113
-                    <td class="p-2">$200.00</td>
114
-                    <td class="p-2 bg-gray-100 dark:bg-gray-800">$600.00</td>
77
+    <!-- Line Items Table -->
78
+    <x-company.invoice.line-items class="modern-template-line-items">
79
+        <table class="w-full text-left table-fixed">
80
+            <thead class="text-sm leading-8">
81
+            <tr class="text-gray-600 dark:text-gray-400">
82
+                <th class="text-left pl-6">{{ $item_name }}</th>
83
+                <th class="text-center">{{ $unit_name }}</th>
84
+                <th class="text-right">{{ $price_name }}</th>
85
+                <th class="text-right pr-6">{{ $amount_name }}</th>
86
+            </tr>
87
+            </thead>
88
+            <tbody class="text-xs border-t-2 border-b-2 leading-8">
89
+            <tr class="bg-gray-100 dark:bg-gray-800">
90
+                <td class="text-left pl-6 font-semibold">Item 1</td>
91
+                <td class="text-center">2</td>
92
+                <td class="text-right">$150.00</td>
93
+                <td class="text-right pr-6">$300.00</td>
94
+            </tr>
95
+            <tr>
96
+                <td class="text-left pl-6 font-semibold">Item 2</td>
97
+                <td class="text-center">3</td>
98
+                <td class="text-right">$200.00</td>
99
+                <td class="text-right pr-6">$600.00</td>
100
+            </tr>
101
+            <tr class="bg-gray-100 dark:bg-gray-800">
102
+                <td class="text-left pl-6 font-semibold">Item 3</td>
103
+                <td class="text-center">1</td>
104
+                <td class="text-right">$180.00</td>
105
+                <td class="text-right pr-6">$180.00</td>
106
+            </tr>
107
+            </tbody>
108
+            <tfoot class="text-xs leading-loose">
109
+                <tr>
110
+                    <td class="pl-6" colspan="2"></td>
111
+                    <td class="text-right font-semibold">Subtotal:</td>
112
+                    <td class="text-right pr-6">$1080.00</td>
115 113
                 </tr>
116
-                <tr class="border-b border-gray-300">
117
-                    <td class="p-2 bg-gray-100 dark:bg-gray-800">03</td>
118
-                    <td class="p-2">Item 3</td>
119
-                    <td class="p-2 bg-gray-100 dark:bg-gray-800">1</td>
120
-                    <td class="p-2">$180.00</td>
121
-                    <td class="p-2 bg-gray-100 dark:bg-gray-800">$180.00</td>
114
+                <tr class="text-success-800 dark:text-success-600">
115
+                    <td class="pl-6" colspan="2"></td>
116
+                    <td class="text-right">Discount (5%):</td>
117
+                    <td class="text-right pr-6">($54.00)</td>
122 118
                 </tr>
123 119
                 <tr>
124
-                    <td class="p-2"></td>
125
-                    <td class="p-2"></td>
126
-                    <td class="p-2"></td>
127
-                    <td class="p-2">Subtotal:</td>
128
-                    <td class="p-2 bg-gray-100 dark:bg-gray-800">$1000.00</td>
120
+                    <td class="pl-6" colspan="2"></td>
121
+                    <td class="text-right">Sales Tax (10%):</td>
122
+                    <td class="text-right pr-6">$102.60</td>
129 123
                 </tr>
130 124
                 <tr>
131
-                    <td class="p-2"></td>
132
-                    <td class="p-2"></td>
133
-                    <td class="p-2"></td>
134
-                    <td class="p-2">Tax:</td>
135
-                    <td class="p-2 bg-gray-100 dark:bg-gray-800">$100.00</td>
125
+                    <td class="pl-6" colspan="2"></td>
126
+                    <td class="text-right font-semibold border-t">Total:</td>
127
+                    <td class="text-right border-t pr-6">$1128.60</td>
136 128
                 </tr>
137 129
                 <tr>
138
-                    <td class="p-2"></td>
139
-                    <td class="p-2"></td>
140
-                    <td class="p-2"></td>
141
-                    <td class="p-2">Total:</td>
142
-                    <td class="p-2 bg-gray-100 dark:bg-gray-800">$1100.00</td>
130
+                    <td class="pl-6" colspan="2"></td>
131
+                    <td class="text-right font-semibold border-t-4 border-double">Amount Due (USD):</td>
132
+                    <td class="text-right border-t-4 border-double pr-6">$1128.60</td>
143 133
                 </tr>
144
-                </tbody>
145
-            </table>
146
-        </div>
134
+            </tfoot>
135
+        </table>
136
+    </x-company.invoice.line-items>
147 137
 
148
-        <!-- Footer Notes -->
149
-        <div class="text-gray-600 dark:text-gray-300 text-xs">
150
-            <h4 class="font-semibold text-gray-700 dark:text-gray-100 mb-2" style="color: {{ $accent_color }}">Terms & Conditions:</h4>
151
-            <div class="flex mt-2 justify-between py-2 border-t-2 border-gray-300">
152
-                <div class="w-1/2">
153
-                    <p>{{ $terms }}</p>
154
-                </div>
155
-                <div class="w-1/2 text-right">
156
-                    <p>{{ $footer }}</p>
157
-                </div>
158
-            </div>
138
+    <!-- Footer Notes -->
139
+    <x-company.invoice.footer class="modern-template-footer">
140
+        <h4 class="font-semibold px-6" style="color: {{ $accent_color }}">Terms & Conditions</h4>
141
+        <span class="border-t-2 my-2 border-gray-300 block w-full"></span>
142
+        <div class="flex justify-between space-x-4 px-6">
143
+            <p class="w-1/2 break-words line-clamp-4">{{ $terms }}</p>
144
+            <p class="w-1/2 break-words line-clamp-4">{{ $footer }}</p>
159 145
         </div>
160
-    </div>
161
-</div>
146
+    </x-company.invoice.footer>
147
+</x-company.invoice.container>

Завантаження…
Відмінити
Зберегти