<style type="text/css" media="all">
   @media print {
      @page {
         margin: 0 !important;
         padding: 0;
      }

      .stitek {
         float: none !important;
         border: none !important;
      }
   }

   body {
      margin: 0;
      padding: 0;
      color: black;
   }

   .stitek {
      width: 45mm;
      height: 45mm;
      box-sizing: border-box;
      page-break-after: always;
      border: dimgrey dashed 1px;
      overflow: hidden;
      position: relative;
      background-color: white;
   }

   .title {
      padding: 2px 2px 2px 4px;
      font-weight: bold;
   }
   .variation_title {
      padding: 2px 2px 2px 4px;
      font-size: 12px;
   }

   .price {
      position: absolute;
      right: 2mm;
      bottom: 2mm;
   }
   .price td {
      padding: 0px 3px;
      vertical-align: baseline;
   }
   .price td:first-child {
      text-align: right;
      font-weight: bold;
   }
   .price td.price_sDPH {
      font-size: 24px;
   }
   .price td.price_bezDPH {
      font-size: 18px;
   }

   .barcode {
      width: 100%;
      height: 17mm;
      overflow: hidden;
      font-size: 13px;
      line-height: 12px;
      text-align: center;
   }

   .barcode > svg {
      max-width: 85%;
   }

   .barcode-large {
      font-size: 140%;
   }

</style>

<div class="print-hidden" style="margin: 15px">
   <div class="row">
      <div class="col-md-3">
         <select data-supplier class="selecter">
            <option value="0">-- Vybrat konkrétního dodavatele --</option>
             {foreach $suppliers_codes as $id => $row}
                <option value="{$id}"
                        {if ($smarty.get.id_supplier && $smarty.get.id_supplier == $id)} selected{/if}>{$row.name} - {$row.code}</option>
             {/foreach}
         </select>
      </div>
      <div class="col-md-1">
         <button data-select class="btn btn-sm btn-primary">Vybrat</button>
      </div>
   </div>
   <script>
      function updateQueryStringParameter(uri, key, value) {
         var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
         var separator = uri.indexOf('?') !== -1 ? "&" : "?";
         if (uri.match(re)) {
            return uri.replace(re, '$1' + key + "=" + value + '$2');
         }
         else {
            return uri + separator + key + "=" + value;
         }
      }

      $('[data-select]').on('click', function () {
         var value =$('[data-supplier]').val();
         window.location.href = updateQueryStringParameter(window.location.href, 'id_supplier', value);
      });
   </script>
</div>

<div class="stitek">
   <div class="title">
       {$reclamation.code} <small>(Objednávka: {$reclamation.id_order})</small>
   </div>
   <div class="variation_title">
      {$reclamation.address.name} {$reclamation.address.surname}
   </div>
   <div class="variation_title">
      {$reclamation.item.descr}
   </div>
    {if !empty($product_barcode_chars)}
       <div class="barcode">
           {insert_barcode type="EAN13" code=$product_barcode_chars height=45 width=2}
          <br>
           {$product_barcode_chars|substr:'0':'-3'}
          <span class="barcode-large">{$product_barcode_chars|substr:'-3'}</span>
       </div>
    {/if}
   {ifmodule PRODUCTS_SERIAL_NUMBERS}
      {if $serial_number}
         <div class="serial-number">
            {$serial_number}
         </div>
      {/if}
   {/ifmodule}
   <div class="variation_title">
      {$boughtDate|format_date:'j.n.Y'} / {$reclamation.date_accepted|format_date:'j.n.Y'}
   </div>
   <div class="price">
      {if !empty($suppliers_codes)}
         {foreach $suppliers_codes as $id => $row}
            {if ($smarty.get.id_supplier && $smarty.get.id_supplier == $id) || !$smarty.get.id_supplier}
               <div class="variation_title">
                  {$row.name} - {$row.code}
               </div>
            {/if}
         {/foreach}
      {/if}
   </div>
</div>

<script>
   //window.print();
</script>
