wallo пре 1 година
родитељ
комит
88d30a1e81

+ 2
- 1
app/Filament/Company/Pages/Setting/Localization.php Прегледај датотеку

@@ -6,6 +6,7 @@ use App\Enums\DateFormat;
6 6
 use App\Enums\NumberFormat;
7 7
 use App\Enums\TimeFormat;
8 8
 use App\Enums\WeekStart;
9
+use App\Models\Setting\CompanyProfile as CompanyProfileModel;
9 10
 use App\Models\Setting\Localization as LocalizationModel;
10 11
 use App\Utilities\Localization\Timezone;
11 12
 use Filament\Actions\Action;
@@ -133,7 +134,7 @@ class Localization extends Page
133 134
                     ->searchable(),
134 135
                 Select::make('timezone')
135 136
                     ->localizeLabel()
136
-                    ->options(Timezone::getTimezoneOptions(\App\Models\Setting\CompanyProfile::find(auth()->user()->currentCompany->id)->country))
137
+                    ->options(Timezone::getTimezoneOptions(CompanyProfileModel::first()->country))
137 138
                     ->searchable()
138 139
                     ->nullable(),
139 140
             ])->columns();

+ 1
- 1
app/Providers/AppServiceProvider.php Прегледај датотеку

@@ -29,7 +29,7 @@ class AppServiceProvider extends ServiceProvider
29 29
         $this->configurePanelSwitch();
30 30
 
31 31
         FilamentAsset::register([
32
-            Js::make('top-navigation-script', __DIR__ . '/../../resources/js/top-navigation.js'),
32
+            Js::make('top-navigation', __DIR__ . '/../../resources/js/top-navigation.js'),
33 33
         ]);
34 34
     }
35 35
 

+ 11
- 8
app/Utilities/Localization/Timezone.php Прегледај датотеку

@@ -4,31 +4,34 @@ namespace App\Utilities\Localization;
4 4
 
5 5
 use App\Enums\TimeFormat;
6 6
 use App\Models\Setting\Localization;
7
+use DateTimeZone;
7 8
 use Symfony\Component\Intl\Timezones;
8 9
 
9 10
 class Timezone
10 11
 {
11
-    public static function getTimezoneOptions(?string $countryCode = null): array
12
+    public static function getTimezoneOptions(#[\SensitiveParameter] ?string $countryCode = null): array
12 13
     {
13 14
         if (empty($countryCode)) {
14 15
             return [];
15 16
         }
16 17
 
17
-        $timezones = Timezones::forCountryCode($countryCode);
18
+        $countryTimezones = DateTimeZone::listIdentifiers(DateTimeZone::PER_COUNTRY, strtoupper($countryCode));
18 19
 
19
-        if (empty($timezones)) {
20
+        if (empty($countryTimezones)) {
20 21
             return [];
21 22
         }
22 23
 
24
+        $localizedTimezoneNames = Timezones::getNames();
25
+
23 26
         $results = [];
24 27
 
25
-        foreach ($timezones as $timezone) {
26
-            $translatedName = Timezones::getName($timezone);
28
+        foreach ($countryTimezones as $timezoneIdentifier) {
29
+            $translatedName = $localizedTimezoneNames[$timezoneIdentifier] ?? $timezoneIdentifier;
27 30
             $cityName = self::extractCityName($translatedName);
28
-            $localTime = self::getLocalTime($timezone);
29
-            $timezoneAbbreviation = now($timezone)->format('T');
31
+            $localTime = self::getLocalTime($timezoneIdentifier);
32
+            $timezoneAbbreviation = now($timezoneIdentifier)->format('T');
30 33
 
31
-            $results[$timezone] = "{$cityName} ({$timezoneAbbreviation}) {$localTime}";
34
+            $results[$timezoneIdentifier] = "{$cityName} ({$timezoneAbbreviation}) {$localTime}";
32 35
         }
33 36
 
34 37
         return $results;

+ 6
- 6
composer.lock Прегледај датотеку

@@ -347,16 +347,16 @@
347 347
         },
348 348
         {
349 349
             "name": "aws/aws-sdk-php",
350
-            "version": "3.293.5",
350
+            "version": "3.293.6",
351 351
             "source": {
352 352
                 "type": "git",
353 353
                 "url": "https://github.com/aws/aws-sdk-php.git",
354
-                "reference": "f2002e52b382b45231da3f9552033f769acfebd8"
354
+                "reference": "1e01734856f8ec2b6d525d1c99c5a34029217598"
355 355
             },
356 356
             "dist": {
357 357
                 "type": "zip",
358
-                "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/f2002e52b382b45231da3f9552033f769acfebd8",
359
-                "reference": "f2002e52b382b45231da3f9552033f769acfebd8",
358
+                "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/1e01734856f8ec2b6d525d1c99c5a34029217598",
359
+                "reference": "1e01734856f8ec2b6d525d1c99c5a34029217598",
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.293.5"
439
+                "source": "https://github.com/aws/aws-sdk-php/tree/3.293.6"
440 440
             },
441
-            "time": "2023-12-06T19:09:15+00:00"
441
+            "time": "2023-12-07T19:29:50+00:00"
442 442
         },
443 443
         {
444 444
             "name": "aws/aws-sdk-php-laravel",

+ 26
- 25
resources/views/filament/company/components/invoice-layouts/classic.blade.php Прегледај датотеку

@@ -2,7 +2,7 @@
2 2
     $data = $this->form->getRawState();
3 3
     $viewModel = new \App\View\Models\InvoiceViewModel($this->record, $data);
4 4
     $viewSpecial = $viewModel->buildViewData();
5
-    extract($viewSpecial);
5
+    extract($viewSpecial,\EXTR_SKIP);
6 6
 @endphp
7 7
 
8 8
 {!! $font_html !!}
@@ -29,7 +29,7 @@
29 29
 
30 30
         <div class="w-1/3 flex justify-end mr-6">
31 31
             @if($logo && $show_logo)
32
-                <x-company.invoice.logo :src="$logo" />
32
+                <x-company.invoice.logo :src="$logo"/>
33 33
             @endif
34 34
         </div>
35 35
     </x-company.invoice.header>
@@ -38,13 +38,14 @@
38 38
         <div class="items-center flex">
39 39
             <hr class="grow-[2] py-0.5 border-double border-y-2" style="border-color: {{ $accent_color }};">
40 40
             <div class="items-center flex mx-5">
41
-                <x-icons.decor-border-left color="{{ $accent_color }}" />
41
+                <x-icons.decor-border-left color="{{ $accent_color }}"/>
42 42
                 <div class="px-2.5 border-double border-y-2 py-1 -mx-3" style="border-color: {{ $accent_color }};">
43 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>
44
+                        <div class="inline text-2xl font-semibold"
45
+                             style="color: {{ $accent_color }};">{{ $header }}</div>
45 46
                     </div>
46 47
                 </div>
47
-                <x-icons.decor-border-right color="{{ $accent_color }}" />
48
+                <x-icons.decor-border-right color="{{ $accent_color }}"/>
48 49
             </div>
49 50
             <hr class="grow-[2] py-0.5 border-double border-y-2" style="border-color: {{ $accent_color }};">
50 51
         </div>
@@ -126,26 +127,26 @@
126 127
             <div class="w-1/2 mt-2">
127 128
                 <table class="w-full table-fixed">
128 129
                     <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>
130
+                    <tr>
131
+                        <td class="text-right font-semibold">Subtotal:</td>
132
+                        <td class="text-right">$1080.00</td>
133
+                    </tr>
134
+                    <tr class="text-success-800 dark:text-success-600">
135
+                        <td class="text-right">Discount (5%):</td>
136
+                        <td class="text-right">($54.00)</td>
137
+                    </tr>
138
+                    <tr>
139
+                        <td class="text-right">Sales Tax (10%):</td>
140
+                        <td class="text-right">$102.60</td>
141
+                    </tr>
142
+                    <tr>
143
+                        <td class="text-right font-semibold">Total:</td>
144
+                        <td class="text-right">$1128.60</td>
145
+                    </tr>
146
+                    <tr>
147
+                        <td class="text-right font-semibold">Amount Due (USD):</td>
148
+                        <td class="text-right">$1128.60</td>
149
+                    </tr>
149 150
                     </tbody>
150 151
                 </table>
151 152
             </div>

+ 33
- 33
resources/views/filament/company/components/invoice-layouts/default.blade.php Прегледај датотеку

@@ -2,7 +2,7 @@
2 2
     $data = $this->form->getRawState();
3 3
     $viewModel = new \App\View\Models\InvoiceViewModel($this->record, $data);
4 4
     $viewSpecial = $viewModel->buildViewData();
5
-    extract($viewSpecial);
5
+    extract($viewSpecial,\EXTR_SKIP);
6 6
 @endphp
7 7
 
8 8
 {!! $font_html !!}
@@ -18,7 +18,7 @@
18 18
     <x-company.invoice.header class="default-template-header border-b-2 p-6 pb-4">
19 19
         <div class="w-2/3">
20 20
             @if($logo && $show_logo)
21
-                <x-company.invoice.logo :src="$logo" />
21
+                <x-company.invoice.logo :src="$logo"/>
22 22
             @endif
23 23
         </div>
24 24
 
@@ -77,12 +77,12 @@
77 77
     <x-company.invoice.line-items class="default-template-line-items">
78 78
         <table class="w-full text-left table-fixed">
79 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>
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 86
             </thead>
87 87
             <tbody class="text-xs border-b-2 border-gray-300 leading-8">
88 88
             <tr>
@@ -105,31 +105,31 @@
105 105
             </tr>
106 106
             </tbody>
107 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>
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 133
             </tfoot>
134 134
         </table>
135 135
     </x-company.invoice.line-items>

+ 29
- 28
resources/views/filament/company/components/invoice-layouts/modern.blade.php Прегледај датотеку

@@ -2,7 +2,7 @@
2 2
     $data = $this->form->getRawState();
3 3
     $viewModel = new \App\View\Models\InvoiceViewModel($this->record, $data);
4 4
     $viewSpecial = $viewModel->buildViewData();
5
-    extract($viewSpecial);
5
+    extract($viewSpecial,\EXTR_SKIP);
6 6
 @endphp
7 7
 
8 8
 {!! $font_html !!}
@@ -20,12 +20,13 @@
20 20
         <!-- Logo -->
21 21
         <div class="w-2/3">
22 22
             @if($logo && $show_logo)
23
-                <x-company.invoice.logo class="ml-6" :src="$logo" />
23
+                <x-company.invoice.logo class="ml-6" :src="$logo"/>
24 24
             @endif
25 25
         </div>
26 26
 
27 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 }};">
28
+        <div class="w-1/3 absolute right-0 top-0 p-2 h-28 flex flex-col justify-end rounded-bl-sm"
29
+             style="background: {{ $accent_color }};">
29 30
             @if($header)
30 31
                 <h1 class="text-3xl font-bold text-white text-center uppercase">{{ $header }}</h1>
31 32
             @endif
@@ -106,31 +107,31 @@
106 107
             </tr>
107 108
             </tbody>
108 109
             <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>
113
-                </tr>
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>
118
-                </tr>
119
-                <tr>
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>
123
-                </tr>
124
-                <tr>
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>
128
-                </tr>
129
-                <tr>
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>
133
-                </tr>
110
+            <tr>
111
+                <td class="pl-6" colspan="2"></td>
112
+                <td class="text-right font-semibold">Subtotal:</td>
113
+                <td class="text-right pr-6">$1080.00</td>
114
+            </tr>
115
+            <tr class="text-success-800 dark:text-success-600">
116
+                <td class="pl-6" colspan="2"></td>
117
+                <td class="text-right">Discount (5%):</td>
118
+                <td class="text-right pr-6">($54.00)</td>
119
+            </tr>
120
+            <tr>
121
+                <td class="pl-6" colspan="2"></td>
122
+                <td class="text-right">Sales Tax (10%):</td>
123
+                <td class="text-right pr-6">$102.60</td>
124
+            </tr>
125
+            <tr>
126
+                <td class="pl-6" colspan="2"></td>
127
+                <td class="text-right font-semibold border-t">Total:</td>
128
+                <td class="text-right border-t pr-6">$1128.60</td>
129
+            </tr>
130
+            <tr>
131
+                <td class="pl-6" colspan="2"></td>
132
+                <td class="text-right font-semibold border-t-4 border-double">Amount Due (USD):</td>
133
+                <td class="text-right border-t-4 border-double pr-6">$1128.60</td>
134
+            </tr>
134 135
             </tfoot>
135 136
         </table>
136 137
     </x-company.invoice.line-items>

Loading…
Откажи
Сачувај