Andrew Wallo 3 kuukautta sitten
vanhempi
commit
a28cb88395

+ 2
- 0
app/Filament/Company/Resources/Sales/EstimateResource.php Näytä tiedosto

29
 use App\Models\Accounting\Estimate;
29
 use App\Models\Accounting\Estimate;
30
 use App\Models\Common\Client;
30
 use App\Models\Common\Client;
31
 use App\Models\Common\Offering;
31
 use App\Models\Common\Offering;
32
+use App\Services\CompanySettingsService;
32
 use App\Utilities\Currency\CurrencyAccessor;
33
 use App\Utilities\Currency\CurrencyAccessor;
33
 use App\Utilities\Currency\CurrencyConverter;
34
 use App\Utilities\Currency\CurrencyConverter;
34
 use App\Utilities\RateCalculator;
35
 use App\Utilities\RateCalculator;
92
                                         ->label('Estimate date')
93
                                         ->label('Estimate date')
93
                                         ->live()
94
                                         ->live()
94
                                         ->default(now())
95
                                         ->default(now())
96
+                                        ->timezone(CompanySettingsService::getDefaultTimezone())
95
                                         ->columnSpan(2)
97
                                         ->columnSpan(2)
96
                                         ->afterStateUpdated(function (Forms\Set $set, Forms\Get $get, $state) {
98
                                         ->afterStateUpdated(function (Forms\Set $set, Forms\Get $get, $state) {
97
                                             $date = $state;
99
                                             $date = $state;

+ 2
- 0
app/Services/CompanySettingsService.php Näytä tiedosto

14
 
14
 
15
     public static function getSettings(?int $companyId = null): array
15
     public static function getSettings(?int $companyId = null): array
16
     {
16
     {
17
+        $companyId ??= session('current_company_id');
18
+
17
         if (! $companyId) {
19
         if (! $companyId) {
18
             return self::getDefaultSettings();
20
             return self::getDefaultSettings();
19
         }
21
         }

Loading…
Peruuta
Tallenna