Added machine id checking validation in bulk sticker printing page #1253

Merged
jothi merged 1 commits from ranjith-dev into master 2026-10-15 07:38:17 +00:00

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()