From 8df617e045b4fef026bb348e45b9c16b8bcc0d04 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Fri, 16 Oct 2026 12:04:54 +0530 Subject: [PATCH] Changed logic in bulk sticker prinitng --- app/Filament/Pages/BulkStickerPrinting.php | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/app/Filament/Pages/BulkStickerPrinting.php b/app/Filament/Pages/BulkStickerPrinting.php index 7a5cf437..5b2429cc 100644 --- a/app/Filament/Pages/BulkStickerPrinting.php +++ b/app/Filament/Pages/BulkStickerPrinting.php @@ -1079,9 +1079,13 @@ class BulkStickerPrinting extends Page implements HasForms for ($i = 1; $i <= 8; $i++) { - $machineColumn = "sticker{$i}_machine_id"; + $structureColumn = "sticker_structure{$i}_id"; - if ((string) $stickerMappingMasterItem->{$machineColumn} == (string) $machineId) { + if ( + (string) $stickerMappingMasterItem->{$structureColumn} + == (string) $structure->id + ) { + $machineColumn = "sticker{$i}_machine_id"; $matchedMachineId = $stickerMappingMasterItem->{$machineColumn}; @@ -1089,6 +1093,19 @@ class BulkStickerPrinting extends Page implements HasForms } } + if ( + $matchedMachineId == null || + (string) $matchedMachineId != (string) $machineId + ) { + Notification::make() + ->danger() + ->title('Machine Mapping Mismatch') + ->body("Selected machine '{$machineId}' does not match the machine mapped to the selected sticker.") + ->send(); + + return; + } + if ((string) $matchedMachineId != (string) $machineId) { Notification::make() ->danger() -- 2.49.1