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')
|
Textarea::make('notes')
|
||||||
->label('Keterangan / Catatan')
|
->label('Keterangan / Catatan')
|
||||||
->placeholder('Bayar listrik bulanan')
|
->placeholder('Bayar listrik bulanan')
|
||||||
->required()
|
->nullable()
|
||||||
->autocomplete(false),
|
->autocomplete(false),
|
||||||
|
|
||||||
SpatieMediaLibraryFileUpload::make('image')
|
SpatieMediaLibraryFileUpload::make('image')
|
||||||
|
|||||||
@ -34,7 +34,7 @@ class CustomerResource extends Resource
|
|||||||
|
|
||||||
protected static ?string $navigationLabel = 'Pelanggan';
|
protected static ?string $navigationLabel = 'Pelanggan';
|
||||||
|
|
||||||
protected static ?int $navigationSort = 3;
|
protected static ?int $navigationSort = 6;
|
||||||
|
|
||||||
protected static ?string $recordTitleAttribute = 'name';
|
protected static ?string $recordTitleAttribute = 'name';
|
||||||
|
|
||||||
|
|||||||
@ -81,13 +81,10 @@ public static function table(Table $table): Table
|
|||||||
->searchable()
|
->searchable()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
|
||||||
TextColumn::make('unit.name')
|
|
||||||
->label('Satuan')
|
|
||||||
->sortable(),
|
|
||||||
|
|
||||||
TextColumn::make('price')
|
TextColumn::make('price')
|
||||||
->label('Harga')
|
->label('Harga')
|
||||||
->money('IDR', decimalPlaces: 0)
|
->money('IDR', decimalPlaces: 0)
|
||||||
|
->suffix(fn (EggPrice $record) => ' / '.$record->unit?->alias)
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
|
||||||
...TimestampColumns::make(),
|
...TimestampColumns::make(),
|
||||||
|
|||||||
@ -100,14 +100,13 @@ public static function table(Table $table): Table
|
|||||||
TextColumn::make('stock')
|
TextColumn::make('stock')
|
||||||
->label('Stok')
|
->label('Stok')
|
||||||
->numeric(decimalPlaces: 0)
|
->numeric(decimalPlaces: 0)
|
||||||
->suffix(fn (Feed $record) => ' '.$record->unit->alias)
|
->suffix(fn (Feed $record) => ' '.$record->unit?->alias)
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
|
||||||
TextColumn::make('price')
|
TextColumn::make('price')
|
||||||
->label('Harga')
|
->label('Harga')
|
||||||
->formatStateUsing(
|
->money('IDR', decimalPlaces: 0)
|
||||||
fn ($state, $record) => 'Rp '.number_format($state, 0, ',', '.').' / '.($record->unit?->alias ?? '-')
|
->suffix(fn (Feed $record) => ' / '.$record->unit?->alias)
|
||||||
)
|
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
|
||||||
...TimestampColumns::make(),
|
...TimestampColumns::make(),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user