|
@@ -440,9 +440,13 @@ class InvoiceResource extends Resource
|
440
|
440
|
Forms\Components\Select::make('bank_account_id')
|
441
|
441
|
->label('Account')
|
442
|
442
|
->required()
|
443
|
|
- ->options(BankAccount::query()
|
444
|
|
- ->get()
|
445
|
|
- ->pluck('account.name', 'id'))
|
|
443
|
+ ->options(function () {
|
|
444
|
+ return BankAccount::query()
|
|
445
|
+ ->join('accounts', 'bank_accounts.account_id', '=', 'accounts.id')
|
|
446
|
+ ->select(['bank_accounts.id', 'accounts.name'])
|
|
447
|
+ ->pluck('accounts.name', 'bank_accounts.id')
|
|
448
|
+ ->toArray();
|
|
449
|
+ })
|
446
|
450
|
->searchable(),
|
447
|
451
|
Forms\Components\Textarea::make('notes')
|
448
|
452
|
->label('Notes'),
|
|
@@ -606,9 +610,13 @@ class InvoiceResource extends Resource
|
606
|
610
|
Forms\Components\Select::make('bank_account_id')
|
607
|
611
|
->label('Account')
|
608
|
612
|
->required()
|
609
|
|
- ->options(BankAccount::query()
|
610
|
|
- ->get()
|
611
|
|
- ->pluck('account.name', 'id'))
|
|
613
|
+ ->options(function () {
|
|
614
|
+ return BankAccount::query()
|
|
615
|
+ ->join('accounts', 'bank_accounts.account_id', '=', 'accounts.id')
|
|
616
|
+ ->select(['bank_accounts.id', 'accounts.name'])
|
|
617
|
+ ->pluck('accounts.name', 'bank_accounts.id')
|
|
618
|
+ ->toArray();
|
|
619
|
+ })
|
612
|
620
|
->searchable(),
|
613
|
621
|
Forms\Components\Textarea::make('notes')
|
614
|
622
|
->label('Notes'),
|