Merge pull request 'Added logic in test certificate automatic load of sticker id' (#1438) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s

Reviewed-on: #1438
This commit was merged in pull request #1438.
This commit is contained in:
2026-11-17 04:29:31 +00:00

View File

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