first(); if (!$item) { abort(404, "Item with code {$itemCode} not found."); } $itemId = $item->id; $production = ProductionQuantity::where('item_id', $itemId) ->where('serial_number', $serial) ->first(); if (!$production) { abort(404, "Production data for item code '{$itemCode}' with serial '{$serial}' not found."); } $productionOrder = $production->production_order; $qrCode = new QrCode($palletNo); $output = new Output\Png(); $qrBinary = $output->output($qrCode, 100); $qrBase64 = base64_encode($qrBinary); $sticker = StickerMaster::where('item_id', $itemId)->first(); // Decide number of copies $copies = 1; if ($sticker) { if ($sticker->serial_number_motor == 1) { $copies = 1; } elseif (is_null($sticker->serial_number_motor) && $sticker->serial_number_pump == 1) { $copies = 2; } } return '
|
|
' . htmlspecialchars($serial) . ' ' . htmlspecialchars($productionOrder) . '
' . htmlspecialchars($item->description) . '
|