Added logic in test certificate automatic load of sticker id #1438

Merged
jothi merged 1 commits from ranjith-dev into master 2026-11-17 04:29:32 +00:00

View File

@@ -259,6 +259,7 @@ class TestCertificate extends Page implements HasForms
->label('Sticker ID')
->options(fn (callable $get) => $get('sticker_options') ?? [])
->reactive()
->searchable()
->afterStateUpdated(function ($state, callable $set) {
if (blank($state)) {
@@ -435,6 +436,13 @@ class TestCertificate extends Page implements HasForms
$set('machine_id', (string) $machineOptions[0]);
}
$set('sticker_options', $stickerOptions);
$firstStickerId = array_key_first($stickerOptions);
$set('sticker_id', null);
if ($firstStickerId !== null) {
$set('sticker_id', (string) $firstStickerId);
}
$set('production_order', $record->aufnr);
}),
TextInput::make('to_serial_number')