From 48942307e1f72fd67f7951bc9375dae21383925a Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Tue, 29 Jul 2025 11:46:44 +0530 Subject: [PATCH] modified sticker reprint controller logic --- .../ProductionStickerReprintController.php | 151 ++++++++---------- 1 file changed, 71 insertions(+), 80 deletions(-) diff --git a/app/Http/Controllers/ProductionStickerReprintController.php b/app/Http/Controllers/ProductionStickerReprintController.php index b9c4834..a69005b 100644 --- a/app/Http/Controllers/ProductionStickerReprintController.php +++ b/app/Http/Controllers/ProductionStickerReprintController.php @@ -54,97 +54,87 @@ class ProductionStickerReprintController extends Controller $sticker = StickerMaster::where('item_id', $itemId)->first(); // Decide number of copies - $copies = 1; + $copies = 1; + if ($sticker) { - if ($sticker->serial_number_motor == 1) { - $copies = 1; - } elseif (is_null($sticker->serial_number_motor) && $sticker->serial_number_pump == 1) { + if ($sticker->serial_number_pump == 1) { + // If pump is selected (regardless of motor), 2 copies $copies = 2; + } elseif ($sticker->serial_number_motor == 1) { + // Only motor selected, 1 copy + $copies = 1; } } + return ' - - - - - - - - - - -
- QR - -
' . htmlspecialchars($serial) . '  ' . htmlspecialchars($productionOrder) . '
-
-
- ' . htmlspecialchars($item->description) . ' -
-
- + img.qr { + width: 13mm; + height: 13mm; + display: block; + } + + + + - - - '; + + +'; + // //Get sticker master data // $sticker = StickerMaster::where('item_id', $itemId)->first();