From 737515f0f86c120ea3771aea3ba783be6d1a9c59 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Thu, 10 Sep 2026 18:11:22 +0530 Subject: [PATCH] Added duplicate logic for bulk sticker printing --- app/Filament/Pages/BulkStickerPrinting.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/Filament/Pages/BulkStickerPrinting.php b/app/Filament/Pages/BulkStickerPrinting.php index 7103751..fe27e75 100644 --- a/app/Filament/Pages/BulkStickerPrinting.php +++ b/app/Filament/Pages/BulkStickerPrinting.php @@ -879,6 +879,18 @@ class BulkStickerPrinting extends Page implements HasForms } } + $updatePrintStatusCompleted = ProductionOrder::where('plant_id', $plantId)->where('production_order', $pOrder)->where('from_serial_number', $fromSerNo)->where('to_serial_number', $toSerNo)->where('print_status', 'Printed')->first(); + + if ($updatePrintStatusCompleted) { + Notification::make() + ->danger() + ->title('Duplicate Sticker') + ->body("Already Sticker generated successfully for Production Order '$pOrder' and plant '$plantName'.") + ->send(); + return; + } + + $structure = StickerStructureDetail::where('sticker_id',$stickerId)->first(); if (!$structure) { @@ -1035,6 +1047,13 @@ class BulkStickerPrinting extends Page implements HasForms $totalStickers = ($toSerNo - $fromSerNo) + 1; + $updatePrintStatus = ProductionOrder::where('plant_id', $plantId)->where('production_order', $pOrder)->where('from_serial_number', $fromSerNo)->where('to_serial_number', $toSerNo)->first(); + + if ($updatePrintStatus) { + $updatePrintStatus->update([ + 'print_status' => 'Printed', + ]); + } Notification::make() ->success()