Merge pull request 'Added pallet controller in panel pallet validation' (#1570) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #1570
This commit was merged in pull request #1570.
This commit is contained in:
@@ -288,6 +288,50 @@ class PalletController extends Controller
|
|||||||
// $mpdf->Output('qr-label.pdf', 'I');
|
// $mpdf->Output('qr-label.pdf', 'I');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function downloadPanelPalletQrPdf($palletNo)
|
||||||
|
{
|
||||||
|
$qrCode = new QrCode($palletNo);
|
||||||
|
$output = new Output\Png;
|
||||||
|
$qrBinary = $output->output($qrCode, 100);
|
||||||
|
$qrBase64 = base64_encode($qrBinary);
|
||||||
|
|
||||||
|
$htmlBlock = '
|
||||||
|
<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">
|
||||||
|
'.htmlspecialchars($palletNo).'
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>';
|
||||||
|
|
||||||
|
return '
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<style>
|
||||||
|
body { margin: 0; padding: 0; width: 60mm; height: auto; font-size: 10pt; font-family: DejaVu Sans, sans-serif; }
|
||||||
|
.sticker-table { width: 60mm; height: 14mm; border-collapse: collapse; page-break-after: always; }
|
||||||
|
.qr-cell { width: 14mm; text-align: right; vertical-align: bottom; padding-left: -8mm; padding-top: 0mm; }
|
||||||
|
.text-cell { text-align: left; vertical-align: middle; font-size: 22pt; padding-left: 1mm; padding-top: 2mm; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: bold; }
|
||||||
|
img.qr { width: 19mm; height: 19mm; display: block; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
'.$htmlBlock.$htmlBlock.'
|
||||||
|
<script>
|
||||||
|
window.onload = function () {
|
||||||
|
window.print();
|
||||||
|
setTimeout(function () {
|
||||||
|
window.close();
|
||||||
|
}, 1000); // Wait 1 second before closing
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function downloadCoilQrPdf($palletNo)
|
public function downloadCoilQrPdf($palletNo)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ Route::get('sticker/get-master-type-data', [StickerMasterController::class, 'get
|
|||||||
|
|
||||||
Route::get('/download-qr-pdf/{palletNo}', [PalletController::class, 'downloadQrPdf'])->name('download-qr-pdf');
|
Route::get('/download-qr-pdf/{palletNo}', [PalletController::class, 'downloadQrPdf'])->name('download-qr-pdf');
|
||||||
|
|
||||||
// Route::get('/download-qr-panel-pdf/{panelPalletNo}', [PalletController::class, 'downloadPanelPalletQrPdf'])->name('download-qr-panel-pdf');
|
Route::get('/download-qr-panel-pdf/{panelPalletNo}', [PalletController::class, 'downloadPanelPalletQrPdf'])->name('download-qr-panel-pdf');
|
||||||
|
|
||||||
Route::get('/download-reprint-qr-pdf/{palletNo}', [PalletController::class, 'downloadReprintQrPdf'])->name('download-reprint-qr-pdf');
|
Route::get('/download-reprint-qr-pdf/{palletNo}', [PalletController::class, 'downloadReprintQrPdf'])->name('download-reprint-qr-pdf');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user