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 ' - -
- - - -|
- |
-
- ' . htmlspecialchars($serial) . ' ' . htmlspecialchars($productionOrder) . '-
- ' . htmlspecialchars($item->description) . '
-
- |
-