<?php
$sym = setting('currency_symbol', 'Rs.');
$name = $product['product_name'] ?? '';
$code = $product['barcode'] ?? '';
?>
<!doctype html><html><head><meta charset="utf-8"><title><?=e($pageTitle??'Barcode Label')?></title>
<style>@page{size:50mm 30mm;margin:2mm}body{margin:0;font-family:Arial,sans-serif}.label{width:46mm;height:26mm;text-align:center;display:flex;flex-direction:column;justify-content:center}.name{font-size:9pt;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.code{font:11pt monospace;letter-spacing:1px;margin-top:3px}.price{font-size:10pt;font-weight:700;margin-top:2px}@media print{.no-print{display:none}}</style></head><body>
<div class="label"><div class="name"><?=e($name)?></div><div class="code"><?=e($code)?></div><div class="price"><?=e($sym)?> <?=number_format((float)($product['selling_price']??0),2)?></div></div>
<script>window.addEventListener('load',()=>window.print());</script></body></html>
