ranjith-dev #805

Merged
jothi merged 2 commits from ranjith-dev into master 2026-07-06 10:42:22 +00:00
Showing only changes of commit d24b4f35f4 - Show all commits

View File

@@ -71,44 +71,8 @@ class WireMasterPackingResource extends Resource
}) })
->required() ->required()
->afterStateUpdated(function ($state, callable $set) { ->afterStateUpdated(function ($state, callable $set) {
if (!$state) {
$set('item_id', null);
return;
}
$set('item_id', null);
$set('wire_packing_number', null); $set('wire_packing_number', null);
// $customerPo = CustomerPoMaster::find($state);
// if ($customerPo && $customerPo->item_id) {
// $item = Item::find($customerPo->item_id);
// $set('item', $item?->code);
// } else {
// $set('item', null);
// }
}), }),
Forms\Components\Select::make('item_id')
->label('Item Code')
->reactive()
->searchable()
->options(function (callable $get) {
$customerPoId = $get('customer_po_master_id');
if (!$customerPoId) {
return [];
}
return Item::whereIn(
'id',
CustomerPoMaster::where('customer_po', $customerPoId)
->pluck('item_id')
)->pluck('code', 'id');
})
->required(),
Forms\Components\TextInput::make('wire_packing_number') Forms\Components\TextInput::make('wire_packing_number')
->label('Scan Wire Packing No') ->label('Scan Wire Packing No')
->reactive() ->reactive()