feat(client): add journals relation and improve transaction ledger handling
- Add journals relation to Client model via Branch - Update branch selection in JournalsRelationManager to use code instead of name - Improve tax, withholding, and cash account ledger queries by adding client_id filter and amount checks - Add missing import for GenerateVoucher command in ExpensesRelationManager - Label 'Normal Balance' column in AccountsRelationManager
This commit is contained in:
@@ -37,7 +37,7 @@ class AccountsRelationManager extends RelationManager
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('account')->description(fn (Account $record): string => $record->description ?? ''),
|
||||
Tables\Columns\TextColumn::make('accountType.type'),
|
||||
Tables\Columns\TextColumn::make('accountType.normal_balance'),
|
||||
Tables\Columns\TextColumn::make('accountType.normal_balance')->label('Normal Balance'),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Filament\Resources\ClientResource\RelationManagers;
|
||||
|
||||
use App\Actions\Transactions\CreateTransactionAction;
|
||||
use App\Commands\Expenses\GenerateVoucher;
|
||||
use App\DataObjects\CreateTransactionDTO;
|
||||
use App\Models\Account;
|
||||
use App\Models\Branch;
|
||||
|
||||
@@ -35,7 +35,7 @@ class JournalsRelationManager extends RelationManager
|
||||
->schema([
|
||||
Select::make('branch_id')
|
||||
->label('Branch')
|
||||
->options(fn () => Branch::where('client_id', $this->getOwnerRecord()->id)->pluck('name', 'id'))
|
||||
->options(fn () => Branch::where('client_id', $this->getOwnerRecord()->id)->pluck('code', 'id'))
|
||||
->required()
|
||||
->default(fn () => Branch::where('client_id', $this->getOwnerRecord()->id)->first()?->id),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user