Added logic in test certificate automatic load of sticker id #1438
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user