modified sticker reprint controller logic

This commit is contained in:
dhanabalan
2025-07-29 11:46:44 +05:30
parent 8c5f2b5b39
commit 48942307e1

View File

@@ -55,17 +55,21 @@ class ProductionStickerReprintController extends Controller
// 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) {
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 '
<html>
<head>
<html>
<head>
<style>
body {
margin: 0;
@@ -128,22 +132,8 @@ class ProductionStickerReprintController extends Controller
display: block;
}
</style>
</head>
<body>
<table class="sticker-table">
<tr>
<td class="qr-cell">
<img class="qr" src="data:image/png;base64,' . $qrBase64 . '" alt="QR" />
</td>
<td class="text-cell">
<div class="text-row"><pre><span class="serial">' . htmlspecialchars($serial) . '</span> <span class="po-number">' . htmlspecialchars($productionOrder) . '</span></pre>
</div>
<div class="desc-row">
' . htmlspecialchars($item->description) . '
</div>
</td>
</tr>
</table>
</head>
<body>
<div id="print-container"></div>
<script>
@@ -178,9 +168,10 @@ class ProductionStickerReprintController extends Controller
}, 500);
};
</script>
</body>
</html>
';
</body>
</html>
';
// //Get sticker master data
// $sticker = StickerMaster::where('item_id', $itemId)->first();