From 36355bd9c865aba96e0b63b34fb8cad00875b90b Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Sun, 4 Oct 2026 16:00:40 +0530 Subject: [PATCH] Added validation for sticker order reprint --- app/Filament/Pages/StickerOrderReprint.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/app/Filament/Pages/StickerOrderReprint.php b/app/Filament/Pages/StickerOrderReprint.php index d6d8711f..14a7975b 100644 --- a/app/Filament/Pages/StickerOrderReprint.php +++ b/app/Filament/Pages/StickerOrderReprint.php @@ -986,6 +986,22 @@ class StickerOrderReprint extends Page implements HasForms return; } + $stickerOrderExist = StickerOrder::where('plant_id', $plantId) + ->where('item_id',$itemCharacteristicId) + ->where('sticker_id', $stickerId) + ->where('production_order', $pOrder) + ->first(); + + if (!$stickerOrderExist) { + + Notification::make() + ->danger() + ->title('Invalid Sticker Reprint') + ->body("No records found for sticker reprint in the sticker order for sticker ID '{$stickerId}'.") + ->send(); + return; + } + $itemCode = Item::where('id',$itemCharacteristicId)->where('plant_id',$plantId)->value('code'); if (!$itemCode) { @@ -1005,13 +1021,13 @@ class StickerOrderReprint extends Page implements HasForms Notification::make() ->danger() ->title('Sticker Details Not Found') - ->body('No sticker details configured for the selected sticker.') + ->body("No sticker details configured for the selected sticker.") ->send(); return; } - //.. + //.. $matchedMachineId = null;