Kaynağa Gözat

refactor: pre-release refactor

3.x
wallo 1 yıl önce
ebeveyn
işleme
e60fdd59de

+ 2
- 2
app/Filament/Company/Clusters/Settings/Resources/DiscountResource.php Dosyayı Görüntüle

@@ -101,11 +101,11 @@ class DiscountResource extends Resource
101 101
                         Forms\Components\DateTimePicker::make('start_date')
102 102
                             ->localizeLabel()
103 103
                             ->minDate(static function ($context, ?Discount $record = null) {
104
-                                if ($context === 'create') {
104
+                                if ($context === 'create' || $record?->start_date?->isFuture()) {
105 105
                                     return today()->addDay();
106 106
                                 }
107 107
 
108
-                                return $record?->start_date?->isFuture() ? today()->addDay() : $record?->start_date;
108
+                                return $record?->start_date;
109 109
                             })
110 110
                             ->maxDate(static function (callable $get, ?Discount $record = null) {
111 111
                                 $end_date = $get('end_date') ?? $record?->end_date;

+ 89
- 72
app/Filament/Company/Pages/Accounting/AccountChart.php Dosyayı Görüntüle

@@ -3,13 +3,14 @@
3 3
 namespace App\Filament\Company\Pages\Accounting;
4 4
 
5 5
 use App\Enums\Accounting\AccountCategory;
6
-use App\Models\Accounting\Account as ChartModel;
6
+use App\Models\Accounting\Account;
7 7
 use App\Models\Accounting\AccountSubtype;
8 8
 use App\Utilities\Accounting\AccountCode;
9 9
 use App\Utilities\Currency\CurrencyAccessor;
10 10
 use Filament\Actions\Action;
11 11
 use Filament\Actions\CreateAction;
12 12
 use Filament\Actions\EditAction;
13
+use Filament\Forms\Components\Component;
13 14
 use Filament\Forms\Components\Select;
14 15
 use Filament\Forms\Components\Textarea;
15 16
 use Filament\Forms\Components\TextInput;
@@ -30,8 +31,6 @@ class AccountChart extends Page
30 31
 
31 32
     protected static string $view = 'filament.company.pages.accounting.chart';
32 33
 
33
-    public ?ChartModel $chart = null;
34
-
35 34
     #[Url]
36 35
     public ?string $activeTab = null;
37 36
 
@@ -43,9 +42,8 @@ class AccountChart extends Page
43 42
     protected function configureAction(Action $action): void
44 43
     {
45 44
         $action
46
-            ->modalWidth(MaxWidth::TwoExtraLarge)
47
-            ->stickyModalHeader()
48
-            ->stickyModalFooter();
45
+            ->modal()
46
+            ->modalWidth(MaxWidth::TwoExtraLarge);
49 47
     }
50 48
 
51 49
     #[Computed]
@@ -60,21 +58,12 @@ class AccountChart extends Page
60 58
     {
61 59
         return EditAction::make()
62 60
             ->iconButton()
63
-            ->record($this->chart)
64 61
             ->name('editChart')
65 62
             ->label('Edit account')
66 63
             ->modalHeading('Edit Account')
67 64
             ->icon('heroicon-m-pencil-square')
68
-            ->mountUsing(function (array $arguments, Form $form) {
69
-                $chartId = $arguments['chart'];
70
-                $this->chart = ChartModel::find($chartId);
71
-
72
-                $form
73
-                    ->fill($this->chart->toArray())
74
-                    ->operation('edit')
75
-                    ->model($this->chart); // This is needed for form relationships to work (maybe a bug in Filament regarding passed arguments related to timing)
76
-            })
77
-            ->form($this->getChartForm());
65
+            ->record(fn (array $arguments) => Account::find($arguments['chart']))
66
+            ->form(fn (Form $form) => $this->getChartForm($form)->operation('edit'));
78 67
     }
79 68
 
80 69
     public function createChartAction(): Action
@@ -82,68 +71,96 @@ class AccountChart extends Page
82 71
         return CreateAction::make()
83 72
             ->link()
84 73
             ->name('createChart')
85
-            ->form($this->getChartForm())
86
-            ->model(ChartModel::class)
74
+            ->model(Account::class)
87 75
             ->label('Add a new account')
88 76
             ->icon('heroicon-o-plus-circle')
89
-            ->mountUsing(function (array $arguments, Form $form) {
90
-                $subtypeId = $arguments['subtype'];
91
-                $this->chart = new ChartModel([
92
-                    'subtype_id' => $subtypeId,
93
-                ]);
94
-
95
-                if ($subtypeId) {
96
-                    $companyId = auth()->user()->currentCompany->id;
97
-                    $generatedCode = AccountCode::generate($companyId, $subtypeId);
98
-                    $this->chart->code = $generatedCode;
99
-                }
100
-
101
-                $form->fill($this->chart->toArray())
102
-                    ->operation('create');
103
-            });
77
+            ->form(fn (Form $form) => $this->getChartForm($form)->operation('create'))
78
+            ->fillForm(fn (array $arguments): array => $this->getChartFormDefaults($arguments['subtype']));
104 79
     }
105 80
 
106
-    private function getChartForm(bool $useActiveTab = true): array
81
+    private function getChartFormDefaults(int $subtypeId): array
107 82
     {
83
+        $accountSubtype = AccountSubtype::find($subtypeId);
84
+        $generatedCode = AccountCode::generate($accountSubtype);
85
+
108 86
         return [
109
-            Select::make('subtype_id')
110
-                ->label('Type')
111
-                ->required()
112
-                ->live()
113
-                ->disabled(static fn (string $operation, ?ChartModel $record) => $operation === 'edit' && $record?->default === true)
114
-                ->options($this->getChartSubtypeOptions($useActiveTab))
115
-                ->afterStateUpdated(static function (?string $state, Set $set): void {
116
-                    if ($state) {
117
-                        $companyId = auth()->user()->currentCompany->id;
118
-                        $generatedCode = AccountCode::generate($companyId, $state);
119
-                        $set('code', $generatedCode);
120
-                    }
121
-                }),
122
-            TextInput::make('code')
123
-                ->label('Code')
124
-                ->required()
125
-                ->validationAttribute('account code')
126
-                ->unique(table: ChartModel::class, column: 'code', ignoreRecord: true)
127
-                ->validateAccountCode(static fn (Get $get) => $get('subtype_id')),
128
-            TextInput::make('name')
129
-                ->label('Name')
130
-                ->required(),
131
-            Select::make('currency_code')
132
-                ->localizeLabel('Currency')
133
-                ->relationship('currency', 'name')
134
-                ->default(CurrencyAccessor::getDefaultCurrency())
135
-                ->preload()
136
-                ->searchable()
137
-                ->visible(function (Get $get): bool {
138
-                    return filled($get('subtype_id')) && AccountSubtype::find($get('subtype_id'))->multi_currency;
139
-                })
140
-                ->live(),
141
-            Textarea::make('description')
142
-                ->label('Description')
143
-                ->autosize(),
87
+            'subtype_id' => $subtypeId,
88
+            'code' => $generatedCode,
144 89
         ];
145 90
     }
146 91
 
92
+    private function getChartForm(Form $form, bool $useActiveTab = true): Form
93
+    {
94
+        return $form
95
+            ->schema([
96
+                $this->getTypeFormComponent($useActiveTab),
97
+                $this->getCodeFormComponent(),
98
+                $this->getNameFormComponent(),
99
+                $this->getCurrencyFormComponent(),
100
+                $this->getDescriptionFormComponent(),
101
+            ]);
102
+    }
103
+
104
+    protected function getTypeFormComponent(bool $useActiveTab = true): Component
105
+    {
106
+        return Select::make('subtype_id')
107
+            ->label('Type')
108
+            ->required()
109
+            ->live()
110
+            ->disabled(static function (string $operation): bool {
111
+                return $operation === 'edit';
112
+            })
113
+            ->options($this->getChartSubtypeOptions($useActiveTab))
114
+            ->afterStateUpdated(static function (?string $state, Set $set): void {
115
+                if ($state) {
116
+                    $accountSubtype = AccountSubtype::find($state);
117
+                    $generatedCode = AccountCode::generate($accountSubtype);
118
+                    $set('code', $generatedCode);
119
+                }
120
+            });
121
+    }
122
+
123
+    protected function getCodeFormComponent(): Component
124
+    {
125
+        return TextInput::make('code')
126
+            ->label('Code')
127
+            ->required()
128
+            ->validationAttribute('account code')
129
+            ->unique(table: Account::class, column: 'code', ignoreRecord: true)
130
+            ->validateAccountCode(static fn (Get $get) => $get('subtype_id'));
131
+    }
132
+
133
+    protected function getNameFormComponent(): Component
134
+    {
135
+        return TextInput::make('name')
136
+            ->label('Name')
137
+            ->required();
138
+    }
139
+
140
+    protected function getCurrencyFormComponent()
141
+    {
142
+        return Select::make('currency_code')
143
+            ->localizeLabel('Currency')
144
+            ->relationship('currency', 'name')
145
+            ->default(CurrencyAccessor::getDefaultCurrency())
146
+            ->preload()
147
+            ->searchable()
148
+            ->disabled(static function (string $operation): bool {
149
+                return $operation === 'edit';
150
+            })
151
+            ->visible(function (Get $get): bool {
152
+                return filled($get('subtype_id')) && AccountSubtype::find($get('subtype_id'))->multi_currency;
153
+            })
154
+            ->live();
155
+    }
156
+
157
+    protected function getDescriptionFormComponent(): Component
158
+    {
159
+        return Textarea::make('description')
160
+            ->label('Description')
161
+            ->autosize();
162
+    }
163
+
147 164
     private function getChartSubtypeOptions($useActiveTab = true): array
148 165
     {
149 166
         $subtypes = $useActiveTab ?
@@ -161,8 +178,8 @@ class AccountChart extends Page
161 178
             CreateAction::make()
162 179
                 ->button()
163 180
                 ->label('Add New Account')
164
-                ->model(ChartModel::class)
165
-                ->form($this->getChartForm(false)),
181
+                ->model(Account::class)
182
+                ->form(fn (Form $form) => $this->getChartForm($form, false)->operation('create')),
166 183
         ];
167 184
     }
168 185
 

+ 0
- 3
app/Models/Accounting/JournalEntry.php Dosyayı Görüntüle

@@ -8,15 +8,12 @@ use App\Concerns\Blamable;
8 8
 use App\Concerns\CompanyOwned;
9 9
 use App\Enums\Accounting\JournalEntryType;
10 10
 use App\Models\Banking\BankAccount;
11
-use App\Observers\JournalEntryObserver;
12 11
 use Database\Factories\Accounting\JournalEntryFactory;
13
-use Illuminate\Database\Eloquent\Attributes\ObservedBy;
14 12
 use Illuminate\Database\Eloquent\Factories\Factory;
15 13
 use Illuminate\Database\Eloquent\Factories\HasFactory;
16 14
 use Illuminate\Database\Eloquent\Model;
17 15
 use Illuminate\Database\Eloquent\Relations\BelongsTo;
18 16
 
19
-#[ObservedBy(JournalEntryObserver::class)]
20 17
 class JournalEntry extends Model
21 18
 {
22 19
     use Blamable;

+ 0
- 14
app/Models/Banking/ConnectedBankAccount.php Dosyayı Görüntüle

@@ -6,11 +6,9 @@ use App\Casts\MoneyCast;
6 6
 use App\Concerns\Blamable;
7 7
 use App\Concerns\CompanyOwned;
8 8
 use App\Enums\Banking\BankAccountType;
9
-use App\Models\Accounting\Account;
10 9
 use Illuminate\Database\Eloquent\Casts\Attribute;
11 10
 use Illuminate\Database\Eloquent\Model;
12 11
 use Illuminate\Database\Eloquent\Relations\BelongsTo;
13
-use Illuminate\Database\Eloquent\Relations\HasOneThrough;
14 12
 
15 13
 class ConnectedBankAccount extends Model
16 14
 {
@@ -61,18 +59,6 @@ class ConnectedBankAccount extends Model
61 59
         return $this->belongsTo(BankAccount::class, 'bank_account_id');
62 60
     }
63 61
 
64
-    public function account(): HasOneThrough
65
-    {
66
-        return $this->hasOneThrough(
67
-            Account::class,
68
-            BankAccount::class,
69
-            'id',
70
-            'accountable_id',
71
-            'bank_account_id',
72
-            'id'
73
-        );
74
-    }
75
-
76 62
     protected function maskedNumber(): Attribute
77 63
     {
78 64
         return Attribute::get(static function (mixed $value, array $attributes): ?string {

+ 0
- 6
app/Models/Company.php Dosyayı Görüntüle

@@ -8,7 +8,6 @@ use App\Models\Banking\BankAccount;
8 8
 use App\Models\Banking\ConnectedBankAccount;
9 9
 use App\Models\Common\Contact;
10 10
 use App\Models\Core\Department;
11
-use App\Models\History\AccountHistory;
12 11
 use App\Models\Setting\Appearance;
13 12
 use App\Models\Setting\CompanyDefault;
14 13
 use App\Models\Setting\CompanyProfile;
@@ -75,11 +74,6 @@ class Company extends FilamentCompaniesCompany implements HasAvatar
75 74
         return $this->hasMany(Accounting\Account::class, 'company_id');
76 75
     }
77 76
 
78
-    public function accountHistories(): HasMany
79
-    {
80
-        return $this->hasMany(AccountHistory::class, 'company_id');
81
-    }
82
-
83 77
     public function bankAccounts(): HasMany
84 78
     {
85 79
         return $this->hasMany(BankAccount::class, 'company_id');

+ 0
- 64
app/Models/History/AccountHistory.php Dosyayı Görüntüle

@@ -1,64 +0,0 @@
1
-<?php
2
-
3
-namespace App\Models\History;
4
-
5
-use App\Casts\CurrencyRateCast;
6
-use App\Casts\MoneyCast;
7
-use App\Models\Banking\Account;
8
-use App\Models\Setting\Currency;
9
-use Illuminate\Database\Eloquent\Factories\HasFactory;
10
-use Illuminate\Database\Eloquent\Model;
11
-use Illuminate\Database\Eloquent\Relations\BelongsTo;
12
-use Wallo\FilamentCompanies\FilamentCompanies;
13
-
14
-class AccountHistory extends Model
15
-{
16
-    use HasFactory;
17
-
18
-    protected $table = 'account_histories';
19
-
20
-    protected $fillable = [
21
-        'company_id',
22
-        'account_id',
23
-        'type',
24
-        'name',
25
-        'number',
26
-        'currency_code',
27
-        'opening_balance',
28
-        'balance',
29
-        'exchange_rate',
30
-        'status',
31
-        'actions',
32
-        'description',
33
-        'enabled',
34
-        'changed_by',
35
-    ];
36
-
37
-    protected $casts = [
38
-        'enabled' => 'boolean',
39
-        'opening_balance' => MoneyCast::class,
40
-        'balance' => MoneyCast::class,
41
-        'exchange_rate' => CurrencyRateCast::class,
42
-        'actions' => 'array',
43
-    ];
44
-
45
-    public function company(): BelongsTo
46
-    {
47
-        return $this->belongsTo(FilamentCompanies::companyModel(), 'company_id');
48
-    }
49
-
50
-    public function account(): BelongsTo
51
-    {
52
-        return $this->belongsTo(Account::class, 'account_id');
53
-    }
54
-
55
-    public function currency(): BelongsTo
56
-    {
57
-        return $this->belongsTo(Currency::class, 'currency_code', 'code');
58
-    }
59
-
60
-    public function changedBy(): BelongsTo
61
-    {
62
-        return $this->belongsTo(FilamentCompanies::userModel(), 'changed_by');
63
-    }
64
-}

+ 0
- 6
app/Models/Setting/Currency.php Dosyayı Görüntüle

@@ -9,7 +9,6 @@ use App\Concerns\HasDefault;
9 9
 use App\Concerns\SyncsWithCompanyDefaults;
10 10
 use App\Facades\Forex;
11 11
 use App\Models\Accounting\Account;
12
-use App\Models\History\AccountHistory;
13 12
 use App\Observers\CurrencyObserver;
14 13
 use App\Utilities\Currency\CurrencyAccessor;
15 14
 use Database\Factories\Setting\CurrencyFactory;
@@ -81,11 +80,6 @@ class Currency extends Model
81 80
         return $this->hasMany(Account::class, 'currency_code', 'code');
82 81
     }
83 82
 
84
-    public function accountHistories(): HasMany
85
-    {
86
-        return $this->hasMany(AccountHistory::class, 'currency_code', 'code');
87
-    }
88
-
89 83
     protected static function newFactory(): Factory
90 84
     {
91 85
         return CurrencyFactory::new();

+ 1
- 33
app/Observers/AccountObserver.php Dosyayı Görüntüle

@@ -38,7 +38,7 @@ class AccountObserver
38 38
 
39 39
     private function setFieldsForBankAccount(Account $account): void
40 40
     {
41
-        $generatedAccountCode = AccountCode::generate($account->company_id, $account->subtype_id);
41
+        $generatedAccountCode = AccountCode::generate($account->subtype_id);
42 42
 
43 43
         $account->code = $generatedAccountCode;
44 44
 
@@ -54,36 +54,4 @@ class AccountObserver
54 54
             $this->setFieldsForBankAccount($account);
55 55
         }
56 56
     }
57
-
58
-    /**
59
-     * Handle the Account "updated" event.
60
-     */
61
-    public function updated(Account $account): void
62
-    {
63
-        //
64
-    }
65
-
66
-    /**
67
-     * Handle the Account "deleted" event.
68
-     */
69
-    public function deleted(Account $account): void
70
-    {
71
-        //
72
-    }
73
-
74
-    /**
75
-     * Handle the Account "restored" event.
76
-     */
77
-    public function restored(Account $account): void
78
-    {
79
-        //
80
-    }
81
-
82
-    /**
83
-     * Handle the Account "force deleted" event.
84
-     */
85
-    public function forceDeleted(Account $account): void
86
-    {
87
-        //
88
-    }
89 57
 }

+ 0
- 69
app/Observers/BankAccountObserver.php Dosyayı Görüntüle

@@ -2,57 +2,12 @@
2 2
 
3 3
 namespace App\Observers;
4 4
 
5
-use App\Enums\Accounting\AccountType;
6
-use App\Models\Accounting\AccountSubtype;
7 5
 use App\Models\Accounting\Transaction;
8 6
 use App\Models\Banking\BankAccount;
9 7
 use Illuminate\Support\Facades\DB;
10 8
 
11 9
 class BankAccountObserver
12 10
 {
13
-    /**
14
-     * Handle the BankAccount "created" event.
15
-     */
16
-    public function created(BankAccount $bankAccount): void
17
-    {
18
-        //
19
-    }
20
-
21
-    /**
22
-     * Handle the BankAccount "creating" event.
23
-     */
24
-    public function creating(BankAccount $bankAccount): void
25
-    {
26
-        //
27
-    }
28
-
29
-    /**
30
-     * Get the default bank account subtype.
31
-     */
32
-    protected function getDefaultBankAccountSubtype(int $companyId, AccountType $type)
33
-    {
34
-        $subType = AccountSubtype::where('company_id', $companyId)
35
-            ->where('name', 'Cash and Cash Equivalents')
36
-            ->where('type', $type)
37
-            ->first();
38
-
39
-        if (! $subType) {
40
-            $subType = AccountSubtype::where('company_id', $companyId)
41
-                ->where('type', $type)
42
-                ->first();
43
-        }
44
-
45
-        return $subType?->id;
46
-    }
47
-
48
-    /**
49
-     * Handle the BankAccount "updated" event.
50
-     */
51
-    public function updated(BankAccount $bankAccount): void
52
-    {
53
-        //
54
-    }
55
-
56 11
     /**
57 12
      * Handle the BankAccount "deleting" event.
58 13
      */
@@ -72,28 +27,4 @@ class BankAccountObserver
72 27
             }
73 28
         });
74 29
     }
75
-
76
-    /**
77
-     * Handle the BankAccount "deleted" event.
78
-     */
79
-    public function deleted(BankAccount $bankAccount): void
80
-    {
81
-        //
82
-    }
83
-
84
-    /**
85
-     * Handle the BankAccount "restored" event.
86
-     */
87
-    public function restored(BankAccount $bankAccount): void
88
-    {
89
-        //
90
-    }
91
-
92
-    /**
93
-     * Handle the BankAccount "force deleted" event.
94
-     */
95
-    public function forceDeleted(BankAccount $bankAccount): void
96
-    {
97
-        //
98
-    }
99 30
 }

+ 0
- 32
app/Observers/CurrencyObserver.php Dosyayı Görüntüle

@@ -8,14 +8,6 @@ use App\Models\Setting\Currency;
8 8
 
9 9
 class CurrencyObserver
10 10
 {
11
-    /**
12
-     * Handle the Currency "created" event.
13
-     */
14
-    public function created(Currency $currency): void
15
-    {
16
-        //
17
-    }
18
-
19 11
     /**
20 12
      * Handle the Currency "updated" event.
21 13
      */
@@ -29,28 +21,4 @@ class CurrencyObserver
29 21
             event(new CurrencyRateChanged($currency, $currency->getOriginal('rate'), $currency->rate));
30 22
         }
31 23
     }
32
-
33
-    /**
34
-     * Handle the Currency "deleted" event.
35
-     */
36
-    public function deleted(Currency $currency): void
37
-    {
38
-        //
39
-    }
40
-
41
-    /**
42
-     * Handle the Currency "restored" event.
43
-     */
44
-    public function restored(Currency $currency): void
45
-    {
46
-        //
47
-    }
48
-
49
-    /**
50
-     * Handle the Currency "force deleted" event.
51
-     */
52
-    public function forceDeleted(Currency $currency): void
53
-    {
54
-        //
55
-    }
56 24
 }

+ 0
- 40
app/Observers/JournalEntryObserver.php Dosyayı Görüntüle

@@ -1,40 +0,0 @@
1
-<?php
2
-
3
-namespace App\Observers;
4
-
5
-use App\Models\Accounting\JournalEntry;
6
-
7
-class JournalEntryObserver
8
-{
9
-    /**
10
-     * Handle the JournalEntry "created" event.
11
-     */
12
-    public function created(JournalEntry $journalEntry): void
13
-    {
14
-        //
15
-    }
16
-
17
-    /**
18
-     * Handle the JournalEntry "updated" event.
19
-     */
20
-    public function updated(JournalEntry $journalEntry): void
21
-    {
22
-        //
23
-    }
24
-
25
-    /**
26
-     * Handle the JournalEntry "deleting" event.
27
-     */
28
-    public function deleting(JournalEntry $journalEntry): void
29
-    {
30
-        //
31
-    }
32
-
33
-    /**
34
-     * Handle the JournalEntry "deleted" event.
35
-     */
36
-    public function deleted(JournalEntry $journalEntry): void
37
-    {
38
-        //
39
-    }
40
-}

+ 15
- 14
app/Utilities/Accounting/AccountCode.php Dosyayı Görüntüle

@@ -3,7 +3,6 @@
3 3
 namespace App\Utilities\Accounting;
4 4
 
5 5
 use App\Enums\Accounting\AccountType;
6
-use App\Models\Accounting\Account;
7 6
 use App\Models\Accounting\AccountSubtype;
8 7
 use RuntimeException;
9 8
 
@@ -49,32 +48,34 @@ class AccountCode
49 48
         };
50 49
     }
51 50
 
52
-    public static function generate(int $companyId, string $subtypeId): string
51
+    public static function generate(AccountSubtype $accountSubtype): string
53 52
     {
54
-        $subtype = AccountSubtype::find($subtypeId);
55
-        $subtypeName = $subtype->name;
56
-        $typeEnum = $subtype->type;
53
+        $subtypeName = $accountSubtype->name;
54
+        $typeEnum = $accountSubtype->type;
57 55
         $typeValue = $typeEnum->value;
58 56
 
59 57
         $baseCode = config("chart-of-accounts.default.{$typeValue}.{$subtypeName}.base_code");
60 58
         $range = self::getRangeForType($typeEnum);
61 59
 
62
-        $lastAccount = Account::where('subtype_id', $subtypeId)
63
-            ->where('company_id', $companyId)
60
+        $lastAccount = $accountSubtype->accounts()
64 61
             ->whereNotNull('code')
65 62
             ->orderBy('code', 'desc')
66 63
             ->first();
67 64
 
68
-        $numericValue = $lastAccount ? (int) explode('-', $lastAccount->code)[0] + 1 : (int) $baseCode;
65
+        $nextNumericValue = $lastAccount ? (int) explode('-', $lastAccount->code)[0] + 1 : (int) $baseCode;
69 66
 
70
-        // Ensure the new code does not exist and is within the acceptable range
71
-        while (Account::where('company_id', $companyId)->where('code', '=', (string) $numericValue)->exists() || $numericValue > $range[1]) {
72
-            if ($numericValue > $range[1]) {
73
-                throw new RuntimeException('No more account codes available within the allowed range for this type.');
67
+        if ($nextNumericValue > $range[1]) {
68
+            throw new RuntimeException("The account code range for a {$typeEnum->getLabel()} has been exceeded.");
69
+        }
70
+
71
+        while ($accountSubtype->accounts()->where('code', '=', (string) $nextNumericValue)->exists()) {
72
+            $nextNumericValue++;
73
+
74
+            if ($nextNumericValue > $range[1]) {
75
+                throw new RuntimeException("The account code range for a {$typeEnum->getLabel()} has been exceeded.");
74 76
             }
75
-            $numericValue++;
76 77
         }
77 78
 
78
-        return (string) $numericValue;
79
+        return (string) $nextNumericValue;
79 80
     }
80 81
 }

+ 1
- 1
composer.json Dosyayı Görüntüle

@@ -1,5 +1,5 @@
1 1
 {
2
-    "name": "laravel/laravel",
2
+    "name": "andrewdwallo/erpsaas",
3 3
     "type": "project",
4 4
     "description": "The skeleton application for the Laravel framework.",
5 5
     "keywords": [

+ 270
- 266
composer.lock
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle


+ 4
- 4
config/chart-of-accounts.php Dosyayı Görüntüle

@@ -31,7 +31,7 @@ return [
31 31
             ],
32 32
             'Prepaid and Deferred Charges' => [
33 33
                 'description' => 'Payments made in advance for future goods or services, such as insurance premiums, rent, and prepaid taxes.',
34
-                'multi_currency' => false,
34
+                'multi_currency' => true,
35 35
                 'base_code' => '1300',
36 36
             ],
37 37
             'Other Current Assets' => [
@@ -48,12 +48,12 @@ return [
48 48
             ],
49 49
             'Fixed Assets' => [
50 50
                 'description' => 'Physical, tangible assets used in the business\'s operations with a useful life exceeding one year, such as buildings, machinery, and vehicles. These assets are subject to depreciation.',
51
-                'multi_currency' => false,
51
+                'multi_currency' => true,
52 52
                 'base_code' => '1600',
53 53
             ],
54 54
             'Intangible Assets' => [
55 55
                 'description' => 'Assets lacking physical substance but offering value to the business, like patents, copyrights, trademarks, software, and goodwill.',
56
-                'multi_currency' => false,
56
+                'multi_currency' => true,
57 57
                 'base_code' => '1700',
58 58
             ],
59 59
             'Other Non-Current Assets' => [
@@ -69,7 +69,7 @@ return [
69 69
                 'base_code' => '1900',
70 70
             ],
71 71
             'Allowances for Receivables' => [
72
-                'description' => 'Accounts representing estimated uncollectible receivables, used to adjust the value of gross receivables to a realistic collectible amount.',
72
+                'description' => 'Accounts representing estimated uncollected receivables, used to adjust the value of gross receivables to a realistic collectible amount.',
73 73
                 'multi_currency' => false,
74 74
                 'base_code' => '1940',
75 75
             ],

+ 0
- 24
database/factories/History/AccountHistoryFactory.php Dosyayı Görüntüle

@@ -1,24 +0,0 @@
1
-<?php
2
-
3
-namespace Database\Factories\History;
4
-
5
-use App\Models\History\AccountHistory;
6
-use Illuminate\Database\Eloquent\Factories\Factory;
7
-
8
-/**
9
- * @extends Factory<AccountHistory>
10
- */
11
-class AccountHistoryFactory extends Factory
12
-{
13
-    /**
14
-     * Define the model's default state.
15
-     *
16
-     * @return array<string, mixed>
17
-     */
18
-    public function definition(): array
19
-    {
20
-        return [
21
-            //
22
-        ];
23
-    }
24
-}

+ 27
- 11
database/factories/UserFactory.php Dosyayı Görüntüle

@@ -2,8 +2,8 @@
2 2
 
3 3
 namespace Database\Factories;
4 4
 
5
+use App\Events\CompanyGenerated;
5 6
 use App\Models\Company;
6
-use App\Models\Setting\CompanyDefault;
7 7
 use App\Models\Setting\CompanyProfile;
8 8
 use App\Models\User;
9 9
 use Illuminate\Database\Eloquent\Factories\Factory;
@@ -56,7 +56,7 @@ class UserFactory extends Factory
56 56
     /**
57 57
      * Indicate that the user should have a personal company.
58 58
      */
59
-    public function withPersonalCompany(?callable $callback = null): static
59
+    public function withPersonalCompany(): static
60 60
     {
61 61
         if (! FilamentCompanies::hasCompanyFeatures()) {
62 62
             return $this->state([]);
@@ -64,19 +64,35 @@ class UserFactory extends Factory
64 64
 
65 65
         $countryCode = $this->faker->countryCode;
66 66
 
67
-        return $this->afterCreating(function (User $user) use ($countryCode, $callback) {
67
+        return $this->afterCreating(function (User $user) use ($countryCode) {
68 68
             Company::factory()
69
-                ->state(static fn (array $attributes, User $user) => [
70
-                    'name' => $user->name . '\'s Company',
71
-                    'user_id' => $user->id,
72
-                    'personal_company' => true,
73
-                ])
74 69
                 ->has(CompanyProfile::factory()->withCountry($countryCode), 'profile')
75 70
                 ->afterCreating(function (Company $company) use ($user, $countryCode) {
76
-                    CompanyDefault::factory()->withDefault($user, $company, $countryCode)->create();
71
+                    CompanyGenerated::dispatch($user, $company, $countryCode);
72
+
73
+                    $defaultBankAccount = $company->bankAccounts()->where('enabled', true)->first();
74
+                    $defaultCurrency = $company->currencies()->where('enabled', true)->first();
75
+                    $defaultSalesTax = $company->taxes()->where('type', 'sales')->where('enabled', true)->first();
76
+                    $defaultPurchaseTax = $company->taxes()->where('type', 'purchase')->where('enabled', true)->first();
77
+                    $defaultSalesDiscount = $company->discounts()->where('type', 'sales')->where('enabled', true)->first();
78
+                    $defaultPurchaseDiscount = $company->discounts()->where('type', 'purchase')->where('enabled', true)->first();
79
+
80
+                    $company->default()->create([
81
+                        'bank_account_id' => $defaultBankAccount?->id,
82
+                        'currency_code' => $defaultCurrency?->code,
83
+                        'sales_tax_id' => $defaultSalesTax?->id,
84
+                        'purchase_tax_id' => $defaultPurchaseTax?->id,
85
+                        'sales_discount_id' => $defaultSalesDiscount?->id,
86
+                        'purchase_discount_id' => $defaultPurchaseDiscount?->id,
87
+                        'created_by' => $user->id,
88
+                        'updated_by' => $user->id,
89
+                    ]);
77 90
                 })
78
-                ->when(is_callable($callback), $callback)
79
-                ->create();
91
+                ->create([
92
+                    'name' => $user->name . '\'s Company',
93
+                    'user_id' => $user->id,
94
+                    'personal_company' => true,
95
+                ]);
80 96
         });
81 97
     }
82 98
 }

+ 1
- 4
database/migrations/0001_01_01_000000_create_users_table.php Dosyayı Görüntüle

@@ -3,7 +3,6 @@
3 3
 use Illuminate\Database\Migrations\Migration;
4 4
 use Illuminate\Database\Schema\Blueprint;
5 5
 use Illuminate\Support\Facades\Schema;
6
-use Wallo\FilamentCompanies\FilamentCompanies;
7 6
 
8 7
 return new class extends Migration
9 8
 {
@@ -17,9 +16,7 @@ return new class extends Migration
17 16
             $table->string('name');
18 17
             $table->string('email')->unique();
19 18
             $table->timestamp('email_verified_at')->nullable();
20
-            $table->string('password')->nullable(
21
-                FilamentCompanies::hasSocialiteFeatures()
22
-            );
19
+            $table->string('password')->nullable();
23 20
             $table->rememberToken();
24 21
             $table->foreignId('current_company_id')->nullable();
25 22
             $table->foreignId('current_connected_account_id')->nullable();

+ 0
- 43
database/migrations/2023_11_06_225016_create_account_histories_table.php Dosyayı Görüntüle

@@ -1,43 +0,0 @@
1
-<?php
2
-
3
-use Illuminate\Database\Migrations\Migration;
4
-use Illuminate\Database\Schema\Blueprint;
5
-use Illuminate\Support\Facades\Schema;
6
-
7
-return new class extends Migration
8
-{
9
-    /**
10
-     * Run the migrations.
11
-     */
12
-    public function up(): void
13
-    {
14
-        Schema::create('account_histories', function (Blueprint $table) {
15
-            $table->id();
16
-            $table->unsignedBigInteger('company_id');
17
-            $table->unsignedBigInteger('account_id');
18
-            $table->string('type');
19
-            $table->string('name');
20
-            $table->string('number');
21
-            $table->string('currency_code');
22
-            $table->bigInteger('opening_balance');
23
-            $table->bigInteger('balance');
24
-            $table->bigInteger('exchange_rate');
25
-            $table->string('status');
26
-            $table->json('actions')->nullable();
27
-            $table->string('description')->nullable();
28
-            $table->boolean('enabled');
29
-            $table->unsignedBigInteger('changed_by')->nullable();
30
-            $table->timestamps();
31
-
32
-            $table->index(['company_id', 'account_id']);
33
-        });
34
-    }
35
-
36
-    /**
37
-     * Reverse the migrations.
38
-     */
39
-    public function down(): void
40
-    {
41
-        Schema::dropIfExists('account_histories');
42
-    }
43
-};

+ 86
- 86
package-lock.json Dosyayı Görüntüle

@@ -507,9 +507,9 @@
507 507
             }
508 508
         },
509 509
         "node_modules/@rollup/rollup-android-arm-eabi": {
510
-            "version": "4.17.0",
511
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.17.0.tgz",
512
-            "integrity": "sha512-nNvLvC2fjC+3+bHYN9uaGF3gcyy7RHGZhtl8TB/kINj9hiOQza8kWJGZh47GRPMrqeseO8U+Z8ElDMCZlWBdHA==",
510
+            "version": "4.17.2",
511
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.17.2.tgz",
512
+            "integrity": "sha512-NM0jFxY8bB8QLkoKxIQeObCaDlJKewVlIEkuyYKm5An1tdVZ966w2+MPQ2l8LBZLjR+SgyV+nRkTIunzOYBMLQ==",
513 513
             "cpu": [
514 514
                 "arm"
515 515
             ],
@@ -520,9 +520,9 @@
520 520
             ]
521 521
         },
522 522
         "node_modules/@rollup/rollup-android-arm64": {
523
-            "version": "4.17.0",
524
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.17.0.tgz",
525
-            "integrity": "sha512-+kjt6dvxnyTIAo7oHeYseYhDyZ7xRKTNl/FoQI96PHkJVxoChldJnne/LzYqpqidoK1/0kX0/q+5rrYqjpth6w==",
523
+            "version": "4.17.2",
524
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.17.2.tgz",
525
+            "integrity": "sha512-yeX/Usk7daNIVwkq2uGoq2BYJKZY1JfyLTaHO/jaiSwi/lsf8fTFoQW/n6IdAsx5tx+iotu2zCJwz8MxI6D/Bw==",
526 526
             "cpu": [
527 527
                 "arm64"
528 528
             ],
@@ -533,9 +533,9 @@
533 533
             ]
534 534
         },
535 535
         "node_modules/@rollup/rollup-darwin-arm64": {
536
-            "version": "4.17.0",
537
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.17.0.tgz",
538
-            "integrity": "sha512-Oj6Tp0unMpGTBjvNwbSRv3DopMNLu+mjBzhKTt2zLbDJ/45fB1pltr/rqrO4bE95LzuYwhYn127pop+x/pzf5w==",
536
+            "version": "4.17.2",
537
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.17.2.tgz",
538
+            "integrity": "sha512-kcMLpE6uCwls023+kknm71ug7MZOrtXo+y5p/tsg6jltpDtgQY1Eq5sGfHcQfb+lfuKwhBmEURDga9N0ol4YPw==",
539 539
             "cpu": [
540 540
                 "arm64"
541 541
             ],
@@ -546,9 +546,9 @@
546 546
             ]
547 547
         },
548 548
         "node_modules/@rollup/rollup-darwin-x64": {
549
-            "version": "4.17.0",
550
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.17.0.tgz",
551
-            "integrity": "sha512-3nJx0T+yptxMd+v93rBRxSPTAVCv8szu/fGZDJiKX7kvRe9sENj2ggXjCH/KK1xZEmJOhaNo0c9sGMgGdfkvEw==",
549
+            "version": "4.17.2",
550
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.17.2.tgz",
551
+            "integrity": "sha512-AtKwD0VEx0zWkL0ZjixEkp5tbNLzX+FCqGG1SvOu993HnSz4qDI6S4kGzubrEJAljpVkhRSlg5bzpV//E6ysTQ==",
552 552
             "cpu": [
553 553
                 "x64"
554 554
             ],
@@ -559,9 +559,9 @@
559 559
             ]
560 560
         },
561 561
         "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
562
-            "version": "4.17.0",
563
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.17.0.tgz",
564
-            "integrity": "sha512-Vb2e8p9b2lxxgqyOlBHmp6hJMu/HSU6g//6Tbr7x5V1DlPCHWLOm37nSIVK314f+IHzORyAQSqL7+9tELxX3zQ==",
562
+            "version": "4.17.2",
563
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.17.2.tgz",
564
+            "integrity": "sha512-3reX2fUHqN7sffBNqmEyMQVj/CKhIHZd4y631duy0hZqI8Qoqf6lTtmAKvJFYa6bhU95B1D0WgzHkmTg33In0A==",
565 565
             "cpu": [
566 566
                 "arm"
567 567
             ],
@@ -572,9 +572,9 @@
572 572
             ]
573 573
         },
574 574
         "node_modules/@rollup/rollup-linux-arm-musleabihf": {
575
-            "version": "4.17.0",
576
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.17.0.tgz",
577
-            "integrity": "sha512-Md60KsmC5ZIaRq/bYYDloklgU+XLEZwS2EXXVcSpiUw+13/ZASvSWQ/P92rQ9YDCL6EIoXxuQ829JkReqdYbGg==",
575
+            "version": "4.17.2",
576
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.17.2.tgz",
577
+            "integrity": "sha512-uSqpsp91mheRgw96xtyAGP9FW5ChctTFEoXP0r5FAzj/3ZRv3Uxjtc7taRQSaQM/q85KEKjKsZuiZM3GyUivRg==",
578 578
             "cpu": [
579 579
                 "arm"
580 580
             ],
@@ -585,9 +585,9 @@
585 585
             ]
586 586
         },
587 587
         "node_modules/@rollup/rollup-linux-arm64-gnu": {
588
-            "version": "4.17.0",
589
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.17.0.tgz",
590
-            "integrity": "sha512-zL5rBFtJ+2EGnMRm2TqKjdjgFqlotSU+ZJEN37nV+fiD3I6Gy0dUh3jBWN0wSlcXVDEJYW7YBe+/2j0N9unb2w==",
588
+            "version": "4.17.2",
589
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.17.2.tgz",
590
+            "integrity": "sha512-EMMPHkiCRtE8Wdk3Qhtciq6BndLtstqZIroHiiGzB3C5LDJmIZcSzVtLRbwuXuUft1Cnv+9fxuDtDxz3k3EW2A==",
591 591
             "cpu": [
592 592
                 "arm64"
593 593
             ],
@@ -598,9 +598,9 @@
598 598
             ]
599 599
         },
600 600
         "node_modules/@rollup/rollup-linux-arm64-musl": {
601
-            "version": "4.17.0",
602
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.17.0.tgz",
603
-            "integrity": "sha512-s2xAyNkJqUdtRVgNK4NK4P9QttS538JuX/kfVQOdZDI5FIKVAUVdLW7qhGfmaySJ1EvN/Bnj9oPm5go9u8navg==",
601
+            "version": "4.17.2",
602
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.17.2.tgz",
603
+            "integrity": "sha512-NMPylUUZ1i0z/xJUIx6VUhISZDRT+uTWpBcjdv0/zkp7b/bQDF+NfnfdzuTiB1G6HTodgoFa93hp0O1xl+/UbA==",
604 604
             "cpu": [
605 605
                 "arm64"
606 606
             ],
@@ -611,9 +611,9 @@
611 611
             ]
612 612
         },
613 613
         "node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
614
-            "version": "4.17.0",
615
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.17.0.tgz",
616
-            "integrity": "sha512-7F99yzVT67B7IUNMjLD9QCFDCyHkyCJMS1dywZrGgVFJao4VJ9szrIEgH67cR+bXQgEaY01ur/WSL6B0jtcLyA==",
614
+            "version": "4.17.2",
615
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.17.2.tgz",
616
+            "integrity": "sha512-T19My13y8uYXPw/L/k0JYaX1fJKFT/PWdXiHr8mTbXWxjVF1t+8Xl31DgBBvEKclw+1b00Chg0hxE2O7bTG7GQ==",
617 617
             "cpu": [
618 618
                 "ppc64"
619 619
             ],
@@ -624,9 +624,9 @@
624 624
             ]
625 625
         },
626 626
         "node_modules/@rollup/rollup-linux-riscv64-gnu": {
627
-            "version": "4.17.0",
628
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.17.0.tgz",
629
-            "integrity": "sha512-leFtyiXisfa3Sg9pgZJwRKITWnrQfhtqDjCamnZhkZuIsk1FXmYwKoTkp6lsCgimIcneFFkHKp/yGLxDesga4g==",
627
+            "version": "4.17.2",
628
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.17.2.tgz",
629
+            "integrity": "sha512-BOaNfthf3X3fOWAB+IJ9kxTgPmMqPPH5f5k2DcCsRrBIbWnaJCgX2ll77dV1TdSy9SaXTR5iDXRL8n7AnoP5cg==",
630 630
             "cpu": [
631 631
                 "riscv64"
632 632
             ],
@@ -637,9 +637,9 @@
637 637
             ]
638 638
         },
639 639
         "node_modules/@rollup/rollup-linux-s390x-gnu": {
640
-            "version": "4.17.0",
641
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.17.0.tgz",
642
-            "integrity": "sha512-FtOgui6qMJ4jbSXTxElsy/60LEe/3U0rXkkz2G5CJ9rbHPAvjMvI+3qF0A0fwLQ5hW+/ZC6PbnS2KfRW9JkgDQ==",
640
+            "version": "4.17.2",
641
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.17.2.tgz",
642
+            "integrity": "sha512-W0UP/x7bnn3xN2eYMql2T/+wpASLE5SjObXILTMPUBDB/Fg/FxC+gX4nvCfPBCbNhz51C+HcqQp2qQ4u25ok6g==",
643 643
             "cpu": [
644 644
                 "s390x"
645 645
             ],
@@ -650,9 +650,9 @@
650 650
             ]
651 651
         },
652 652
         "node_modules/@rollup/rollup-linux-x64-gnu": {
653
-            "version": "4.17.0",
654
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.17.0.tgz",
655
-            "integrity": "sha512-v6eiam/1w3HUfU/ZjzIDodencqgrSqzlNuNtiwH7PFJHYSo1ezL0/UIzmS2lpSJF1ORNaplXeKHYmmdt81vV2g==",
653
+            "version": "4.17.2",
654
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.17.2.tgz",
655
+            "integrity": "sha512-Hy7pLwByUOuyaFC6mAr7m+oMC+V7qyifzs/nW2OJfC8H4hbCzOX07Ov0VFk/zP3kBsELWNFi7rJtgbKYsav9QQ==",
656 656
             "cpu": [
657 657
                 "x64"
658 658
             ],
@@ -663,9 +663,9 @@
663 663
             ]
664 664
         },
665 665
         "node_modules/@rollup/rollup-linux-x64-musl": {
666
-            "version": "4.17.0",
667
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.17.0.tgz",
668
-            "integrity": "sha512-OUhkSdpM5ofVlVU2k4CwVubYwiwu1a4jYWPpubzN7Vzao73GoPBowHcCfaRSFRz1SszJ3HIsk3dZYk4kzbqjgw==",
666
+            "version": "4.17.2",
667
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.17.2.tgz",
668
+            "integrity": "sha512-h1+yTWeYbRdAyJ/jMiVw0l6fOOm/0D1vNLui9iPuqgRGnXA0u21gAqOyB5iHjlM9MMfNOm9RHCQ7zLIzT0x11Q==",
669 669
             "cpu": [
670 670
                 "x64"
671 671
             ],
@@ -676,9 +676,9 @@
676 676
             ]
677 677
         },
678 678
         "node_modules/@rollup/rollup-win32-arm64-msvc": {
679
-            "version": "4.17.0",
680
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.17.0.tgz",
681
-            "integrity": "sha512-uL7UYO/MNJPGL/yflybI+HI+n6+4vlfZmQZOCb4I+z/zy1wisHT3exh7oNQsnL6Eso0EUTEfgQ/PaGzzXf6XyQ==",
679
+            "version": "4.17.2",
680
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.17.2.tgz",
681
+            "integrity": "sha512-tmdtXMfKAjy5+IQsVtDiCfqbynAQE/TQRpWdVataHmhMb9DCoJxp9vLcCBjEQWMiUYxO1QprH/HbY9ragCEFLA==",
682 682
             "cpu": [
683 683
                 "arm64"
684 684
             ],
@@ -689,9 +689,9 @@
689 689
             ]
690 690
         },
691 691
         "node_modules/@rollup/rollup-win32-ia32-msvc": {
692
-            "version": "4.17.0",
693
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.17.0.tgz",
694
-            "integrity": "sha512-4WnSgaUiUmXILwFqREdOcqvSj6GD/7FrvSjhaDjmwakX9w4Z2F8JwiSP1AZZbuRkPqzi444UI5FPv33VKOWYFQ==",
692
+            "version": "4.17.2",
693
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.17.2.tgz",
694
+            "integrity": "sha512-7II/QCSTAHuE5vdZaQEwJq2ZACkBpQDOmQsE6D6XUbnBHW8IAhm4eTufL6msLJorzrHDFv3CF8oCA/hSIRuZeQ==",
695 695
             "cpu": [
696 696
                 "ia32"
697 697
             ],
@@ -702,9 +702,9 @@
702 702
             ]
703 703
         },
704 704
         "node_modules/@rollup/rollup-win32-x64-msvc": {
705
-            "version": "4.17.0",
706
-            "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.17.0.tgz",
707
-            "integrity": "sha512-ve+D8t1prRSRnF2S3pyDtTXDlvW1Pngbz76tjgYFQW1jxVSysmQCZfPoDAo4WP+Ano8zeYp85LsArZBI12HfwQ==",
705
+            "version": "4.17.2",
706
+            "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.17.2.tgz",
707
+            "integrity": "sha512-TGGO7v7qOq4CYmSBVEYpI1Y5xDuCEnbVC5Vth8mOsW0gDSzxNrVERPc790IGHsrT2dQSimgMr9Ub3Y1Jci5/8w==",
708 708
             "cpu": [
709 709
                 "x64"
710 710
             ],
@@ -931,9 +931,9 @@
931 931
             }
932 932
         },
933 933
         "node_modules/caniuse-lite": {
934
-            "version": "1.0.30001613",
935
-            "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001613.tgz",
936
-            "integrity": "sha512-BNjJULJfOONQERivfxte7alLfeLW4QnwHvNW4wEcLEbXfV6VSCYvr+REbf2Sojv8tC1THpjPXBxWgDbq4NtLWg==",
934
+            "version": "1.0.30001616",
935
+            "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001616.tgz",
936
+            "integrity": "sha512-RHVYKov7IcdNjVHJFNY/78RdG4oGVjbayxv8u5IO74Wv7Hlq4PnJE6mo/OjFijjVFNy5ijnCt6H3IIo4t+wfEw==",
937 937
             "dev": true,
938 938
             "funding": [
939 939
                 {
@@ -1079,9 +1079,9 @@
1079 1079
             "dev": true
1080 1080
         },
1081 1081
         "node_modules/electron-to-chromium": {
1082
-            "version": "1.4.750",
1083
-            "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.750.tgz",
1084
-            "integrity": "sha512-9ItEpeu15hW5m8jKdriL+BQrgwDTXEL9pn4SkillWFu73ZNNNQ2BKKLS+ZHv2vC9UkNhosAeyfxOf/5OSeTCPA==",
1082
+            "version": "1.4.757",
1083
+            "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.757.tgz",
1084
+            "integrity": "sha512-jftDaCknYSSt/+KKeXzH3LX5E2CvRLm75P3Hj+J/dv3CL0qUYcOt13d5FN1NiL5IJbbhzHrb3BomeG2tkSlZmw==",
1085 1085
             "dev": true
1086 1086
         },
1087 1087
         "node_modules/emoji-regex": {
@@ -1467,9 +1467,9 @@
1467 1467
             "dev": true
1468 1468
         },
1469 1469
         "node_modules/lru-cache": {
1470
-            "version": "10.2.1",
1471
-            "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.1.tgz",
1472
-            "integrity": "sha512-tS24spDe/zXhWbNPErCHs/AGOzbKGHT+ybSBqmdLm8WZ1xXLWvH8Qn71QPAlqVhd0qUTWjy+Kl9JmISgDdEjsA==",
1470
+            "version": "10.2.2",
1471
+            "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz",
1472
+            "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==",
1473 1473
             "dev": true,
1474 1474
             "engines": {
1475 1475
                 "node": "14 || >=16.14"
@@ -1543,9 +1543,9 @@
1543 1543
             }
1544 1544
         },
1545 1545
         "node_modules/minipass": {
1546
-            "version": "7.0.4",
1547
-            "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz",
1548
-            "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==",
1546
+            "version": "7.1.0",
1547
+            "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.0.tgz",
1548
+            "integrity": "sha512-oGZRv2OT1lO2UF1zUcwdTb3wqUwI0kBGTgt/T7OdSj6M6N5m3o5uPf0AIW6lVxGGoiWUR7e2AwTE+xiwK8WQig==",
1549 1549
             "dev": true,
1550 1550
             "engines": {
1551 1551
                 "node": ">=16 || 14 >=14.17"
@@ -2010,9 +2010,9 @@
2010 2010
             }
2011 2011
         },
2012 2012
         "node_modules/rollup": {
2013
-            "version": "4.17.0",
2014
-            "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.17.0.tgz",
2015
-            "integrity": "sha512-wZJSn0WMtWrxhYKQRt5Z6GIXlziOoMDFmbHmRfL3v+sBTAshx2DBq1AfMArB7eIjF63r4ocn2ZTAyUptg/7kmQ==",
2013
+            "version": "4.17.2",
2014
+            "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.17.2.tgz",
2015
+            "integrity": "sha512-/9ClTJPByC0U4zNLowV1tMBe8yMEAxewtR3cUNX5BoEpGH3dQEWpJLr6CLp0fPdYRF/fzVOgvDb1zXuakwF5kQ==",
2016 2016
             "dev": true,
2017 2017
             "dependencies": {
2018 2018
                 "@types/estree": "1.0.5"
@@ -2025,22 +2025,22 @@
2025 2025
                 "npm": ">=8.0.0"
2026 2026
             },
2027 2027
             "optionalDependencies": {
2028
-                "@rollup/rollup-android-arm-eabi": "4.17.0",
2029
-                "@rollup/rollup-android-arm64": "4.17.0",
2030
-                "@rollup/rollup-darwin-arm64": "4.17.0",
2031
-                "@rollup/rollup-darwin-x64": "4.17.0",
2032
-                "@rollup/rollup-linux-arm-gnueabihf": "4.17.0",
2033
-                "@rollup/rollup-linux-arm-musleabihf": "4.17.0",
2034
-                "@rollup/rollup-linux-arm64-gnu": "4.17.0",
2035
-                "@rollup/rollup-linux-arm64-musl": "4.17.0",
2036
-                "@rollup/rollup-linux-powerpc64le-gnu": "4.17.0",
2037
-                "@rollup/rollup-linux-riscv64-gnu": "4.17.0",
2038
-                "@rollup/rollup-linux-s390x-gnu": "4.17.0",
2039
-                "@rollup/rollup-linux-x64-gnu": "4.17.0",
2040
-                "@rollup/rollup-linux-x64-musl": "4.17.0",
2041
-                "@rollup/rollup-win32-arm64-msvc": "4.17.0",
2042
-                "@rollup/rollup-win32-ia32-msvc": "4.17.0",
2043
-                "@rollup/rollup-win32-x64-msvc": "4.17.0",
2028
+                "@rollup/rollup-android-arm-eabi": "4.17.2",
2029
+                "@rollup/rollup-android-arm64": "4.17.2",
2030
+                "@rollup/rollup-darwin-arm64": "4.17.2",
2031
+                "@rollup/rollup-darwin-x64": "4.17.2",
2032
+                "@rollup/rollup-linux-arm-gnueabihf": "4.17.2",
2033
+                "@rollup/rollup-linux-arm-musleabihf": "4.17.2",
2034
+                "@rollup/rollup-linux-arm64-gnu": "4.17.2",
2035
+                "@rollup/rollup-linux-arm64-musl": "4.17.2",
2036
+                "@rollup/rollup-linux-powerpc64le-gnu": "4.17.2",
2037
+                "@rollup/rollup-linux-riscv64-gnu": "4.17.2",
2038
+                "@rollup/rollup-linux-s390x-gnu": "4.17.2",
2039
+                "@rollup/rollup-linux-x64-gnu": "4.17.2",
2040
+                "@rollup/rollup-linux-x64-musl": "4.17.2",
2041
+                "@rollup/rollup-win32-arm64-msvc": "4.17.2",
2042
+                "@rollup/rollup-win32-ia32-msvc": "4.17.2",
2043
+                "@rollup/rollup-win32-x64-msvc": "4.17.2",
2044 2044
                 "fsevents": "~2.3.2"
2045 2045
             }
2046 2046
         },
@@ -2329,9 +2329,9 @@
2329 2329
             "dev": true
2330 2330
         },
2331 2331
         "node_modules/update-browserslist-db": {
2332
-            "version": "1.0.13",
2333
-            "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz",
2334
-            "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==",
2332
+            "version": "1.0.15",
2333
+            "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.15.tgz",
2334
+            "integrity": "sha512-K9HWH62x3/EalU1U6sjSZiylm9C8tgq2mSvshZpqc7QE69RaA2qjhkW2HlNA0tFpEbtyFz7HTqbSdN4MSwUodA==",
2335 2335
             "dev": true,
2336 2336
             "funding": [
2337 2337
                 {
@@ -2348,7 +2348,7 @@
2348 2348
                 }
2349 2349
             ],
2350 2350
             "dependencies": {
2351
-                "escalade": "^3.1.1",
2351
+                "escalade": "^3.1.2",
2352 2352
                 "picocolors": "^1.0.0"
2353 2353
             },
2354 2354
             "bin": {
@@ -2365,9 +2365,9 @@
2365 2365
             "dev": true
2366 2366
         },
2367 2367
         "node_modules/vite": {
2368
-            "version": "5.2.10",
2369
-            "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.10.tgz",
2370
-            "integrity": "sha512-PAzgUZbP7msvQvqdSD+ErD5qGnSFiGOoWmV5yAKUEI0kdhjbH6nMWVyZQC/hSc4aXwc0oJ9aEdIiF9Oje0JFCw==",
2368
+            "version": "5.2.11",
2369
+            "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.11.tgz",
2370
+            "integrity": "sha512-HndV31LWW05i1BLPMUCE1B9E9GFbOu1MbenhS58FuK6owSO5qHm7GiCotrNY1YE5rMeQSFBGmT5ZaLEjFizgiQ==",
2371 2371
             "dev": true,
2372 2372
             "dependencies": {
2373 2373
                 "esbuild": "^0.20.1",

+ 1
- 1
resources/views/livewire/company/service/connected-account/list-institutions.blade.php Dosyayı Görüntüle

@@ -56,7 +56,7 @@
56 56
 
57 57
                             @if($account?->ending_balance)
58 58
                                 <div class="account-balance flex text-base leading-6 text-gray-700 dark:text-gray-200 space-x-1">
59
-                                    <strong wire:poll.visible>{{ $account->ending_balance->formatted() }}</strong>
59
+                                    <strong wire:poll.visible>{{ $account->ending_balance->format() }}</strong>
60 60
                                     <p>{{ $account->currency_code }}</p>
61 61
                                 </div>
62 62
                             @endif

Loading…
İptal
Kaydet