From 2d3fdcb8e2cb5431020da5d7b9a577d1fce6aab7 Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Thu, 19 Feb 2026 12:46:59 +0700 Subject: [PATCH] feat: Enhance price and stock column display with unit aliases, allow nullable expense notes, and update customer navigation sort order. --- .../Resources/Finance/Expenses/ExpenseResource.php | 2 +- .../Resources/Master/Customers/CustomerResource.php | 2 +- .../Resources/Master/EggPrices/EggPriceResource.php | 5 +---- app/Filament/Resources/Master/Feeds/FeedResource.php | 7 +++---- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/app/Filament/Resources/Finance/Expenses/ExpenseResource.php b/app/Filament/Resources/Finance/Expenses/ExpenseResource.php index 8695c41..0d619c7 100644 --- a/app/Filament/Resources/Finance/Expenses/ExpenseResource.php +++ b/app/Filament/Resources/Finance/Expenses/ExpenseResource.php @@ -66,7 +66,7 @@ public static function form(Schema $schema): Schema Textarea::make('notes') ->label('Keterangan / Catatan') ->placeholder('Bayar listrik bulanan') - ->required() + ->nullable() ->autocomplete(false), SpatieMediaLibraryFileUpload::make('image') diff --git a/app/Filament/Resources/Master/Customers/CustomerResource.php b/app/Filament/Resources/Master/Customers/CustomerResource.php index 07edfc8..8d086c8 100644 --- a/app/Filament/Resources/Master/Customers/CustomerResource.php +++ b/app/Filament/Resources/Master/Customers/CustomerResource.php @@ -34,7 +34,7 @@ class CustomerResource extends Resource protected static ?string $navigationLabel = 'Pelanggan'; - protected static ?int $navigationSort = 3; + protected static ?int $navigationSort = 6; protected static ?string $recordTitleAttribute = 'name'; diff --git a/app/Filament/Resources/Master/EggPrices/EggPriceResource.php b/app/Filament/Resources/Master/EggPrices/EggPriceResource.php index 4daacf5..20991a8 100644 --- a/app/Filament/Resources/Master/EggPrices/EggPriceResource.php +++ b/app/Filament/Resources/Master/EggPrices/EggPriceResource.php @@ -81,13 +81,10 @@ public static function table(Table $table): Table ->searchable() ->sortable(), - TextColumn::make('unit.name') - ->label('Satuan') - ->sortable(), - TextColumn::make('price') ->label('Harga') ->money('IDR', decimalPlaces: 0) + ->suffix(fn (EggPrice $record) => ' / '.$record->unit?->alias) ->sortable(), ...TimestampColumns::make(), diff --git a/app/Filament/Resources/Master/Feeds/FeedResource.php b/app/Filament/Resources/Master/Feeds/FeedResource.php index 55c372b..6dd0d6d 100644 --- a/app/Filament/Resources/Master/Feeds/FeedResource.php +++ b/app/Filament/Resources/Master/Feeds/FeedResource.php @@ -100,14 +100,13 @@ public static function table(Table $table): Table TextColumn::make('stock') ->label('Stok') ->numeric(decimalPlaces: 0) - ->suffix(fn (Feed $record) => ' '.$record->unit->alias) + ->suffix(fn (Feed $record) => ' '.$record->unit?->alias) ->sortable(), TextColumn::make('price') ->label('Harga') - ->formatStateUsing( - fn ($state, $record) => 'Rp '.number_format($state, 0, ',', '.').' / '.($record->unit?->alias ?? '-') - ) + ->money('IDR', decimalPlaces: 0) + ->suffix(fn (Feed $record) => ' / '.$record->unit?->alias) ->sortable(), ...TimestampColumns::make(),