1
0
forked from poc/pds

Added searchable filter in view, default bundle quantity is 2

This commit is contained in:
dhanabalan
2025-04-23 14:00:09 +05:30
parent f303d7b31b
commit 2711758e2e

View File

@@ -169,7 +169,7 @@ class StickerMasterResource extends Resource
->default(0) ->default(0)
->disabled(function ($get) { ->disabled(function ($get) {
return $get('material_type'); return $get('material_type');
}) })
->integer() ->integer()
->nullable(), ->nullable(),
@@ -195,7 +195,7 @@ class StickerMasterResource extends Resource
} }
else else
{ {
$set('bundle_quantity', 1); $set('bundle_quantity', 2);
} }
//$plantId = $get('plant_id'); //$plantId = $get('plant_id');
}) })
@@ -205,8 +205,18 @@ class StickerMasterResource extends Resource
->label('Bundle Quantity') ->label('Bundle Quantity')
->integer() ->integer()
->readOnly(fn (callable $get) => $get('material_type') !== "2") ->readOnly(fn (callable $get) => $get('material_type') !== "2")
->nullable(), ->nullable()
->reactive()
->afterStateUpdated(function ($state, callable $set,callable $get) {
if($get('material_type') !== "2")
{
$set('bundle_quantity', null);
}
else if ($get('bundle_quantity') < 2)
{
$set('bundle_quantity', 2);
}
}),
Forms\Components\Checkbox::make('serial_number_motor') Forms\Components\Checkbox::make('serial_number_motor')
->reactive() ->reactive()
@@ -390,9 +400,11 @@ class StickerMasterResource extends Resource
->numeric() ->numeric()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('item.code') Tables\Columns\TextColumn::make('item.code')
->sortable(), ->sortable()
->searchable(),
Tables\Columns\TextColumn::make('plant.name') Tables\Columns\TextColumn::make('plant.name')
->sortable(), ->sortable()
->searchable(),
Tables\Columns\CheckboxColumn::make('serial_number_motor') Tables\Columns\CheckboxColumn::make('serial_number_motor')
->disabled(true) ->disabled(true)
->sortable(), ->sortable(),