diff --git a/app/Filament/Pages/BulkStickerPrinting.php b/app/Filament/Pages/BulkStickerPrinting.php index a8ca248b..6c8d2a53 100644 --- a/app/Filament/Pages/BulkStickerPrinting.php +++ b/app/Filament/Pages/BulkStickerPrinting.php @@ -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()