Added machine id checking validation in bulk sticker printing page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 16s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Pint / pint (pull_request) Successful in 3m25s
Laravel Larastan / larastan (pull_request) Failing after 6m44s

This commit is contained in:
dhanabalan
2026-10-15 13:08:04 +05:30
parent 0c4134bd59
commit 09e113451c

View File

@@ -1008,24 +1008,26 @@ class BulkStickerPrinting extends Page implements HasForms
$matchedMachineId = null;
for ($i = 1; $i <= 8; $i++) {
// for ($i = 1; $i <= 8; $i++) {
$machineColumn = "sticker{$i}_machine_id";
// $machineColumn = "sticker{$i}_machine_id";
if ((string) $stickerMappingMasterItem->{$machineColumn} == (string) $machineId) {
// if ((string) $stickerMappingMasterItem->{$machineColumn} == (string) $machineId) {
$matchedMachineId = $stickerMappingMasterItem->{$machineColumn};
// $matchedMachineId = $stickerMappingMasterItem->{$machineColumn};
break;
}
}
// break;
// }
// }
$matchedMachineId = StickerMappingMaster::where('plant_id', $plantId)->where('item_id', $pOrderExist->item_id)->where('sticker_structure1_id', $structure->id)->where('sticker1_machine_id', $machineId)->first();
if (!$matchedMachineId) {
Notification::make()
->danger()
->title('Machine Not Found')
->body("Machine '{$machineId}' is not mapped for Item Code '{$itemCode}' in the selected sticker mapping.")
->body("Machine '{$machineId}' is not mapped for Item Code '{$itemCode}' in sticker mapping master.")
->send();
return;
@@ -1113,6 +1115,7 @@ class BulkStickerPrinting extends Page implements HasForms
'print_status' => 'Printed',
]);
}
}
Notification::make()