feat: Enhance price and stock column display with unit aliases, allow nullable expense notes, and update customer navigation sort order.

This commit is contained in:
Yoga Pangestu 2026-02-19 12:46:59 +07:00
parent d37e69d006
commit 2d3fdcb8e2
4 changed files with 6 additions and 10 deletions

View File

@ -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')

View File

@ -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';

View File

@ -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(),

View File

@ -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(),