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:
parent
d37e69d006
commit
2d3fdcb8e2
@ -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')
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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(),
|
||||
|
||||
@ -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(),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user