{extends '[common]pdf/invoicePDF.tpl'}

<style>
   {block "style-pdf"}

   /* @formatter:off */
   {function page2}{
      size: A4 portrait;

   @frame frame_header {
      -pdf-frame-content: header{$iteration};
      top: 5mm;
      left: 10mm;
      width: 190mm;
      height: 10mm;
      /*-pdf-frame-border: 1;*/
   }

   @frame frame_left {
      -pdf-frame-content: left_column{$iteration};
      left: 10mm;
      top: 15mm;
      width: 90mm;
      height: 100mm;
      /*-pdf-frame-border: 1;*/
   }

   @frame frame_right {
      -pdf-frame-content: right_column{$iteration};
      left: 110.22mm;
      top: 15mm;
      width: 90mm;
      height: 80mm;
    /*-pdf-frame-border: 1;*/
   }

   @frame frame_down {
      left: 10mm;
      top: 110mm;
      width: 190mm;
      height: 190mm;
   }

   @frame frame_footer {
      -pdf-frame-content: footer;
      top: 289mm;
      left: 10mm;
      width: 190mm;
      height: 8mm;
   }
   }
   {/function}

   {if $iteration}
   @page first{$iteration} {page2 iteration=$iteration}
   {else}
   @page {page2 iteration=$iteration}
   {/if}

   /* druhá a další stránka */
   @page regular_template {
      @frame frame_header {
      -pdf-frame-content: header;
      top: 5mm;
      left: 10mm;
      width: 190mm;
      height: 10mm;
   }

   @frame frame_footer {
   -pdf-frame-content:footer;
   top: 289mm;
   left: 10mm;
   width: 190mm;
   height: 8mm;
   }

   @frame frame_down {
   left: 10mm;
   top: 21mm;
   width: 190mm;
   height: 263mm;
   }
   }
   /* @formatter:on */
   {/block}

   {block "style-css"}

   @font-face {
      font-family: ArialFont;
      src: url(http://html2pdf.wpj.cz/fonts/arial.ttf);
   }

   @font-face {
      font-family: ArialFont;
      src: url(http://html2pdf.wpj.cz/fonts/arialbd.ttf);
      font-weight: bold;
   }

   body {
      color: #000000;
      font-family: ArialFont, sans-serif;
      font-size: 8pt;
      line-height: 1.5;
   }

   /* cislo faktury - v ramecku */
   h1 {
      font-size: 13pt;
      font-weight: normal;
      padding: 3mm 2.5mm 1.8mm;
      margin: 0 0 5mm;
      border: 1pt solid #000000;
      border-top: 0;
      line-height: 1;
   }

   /* bank ucet, odberatel, dodaci udaje a zpusob odberu */
   h2 {
      border-bottom: 1pt solid #bbb;
      font-size: 8pt;
      font-weight: bold;
      margin: 0 0 2mm;
      padding: 2mm 0 1mm;
      line-height: 1;
   }

   /* jmeno a firma (dodaci i fakturacni) */
   h3 {
      font-weight: bold;
      font-size: 9pt;
      margin: 0;
      padding: 0;
      line-height: 1.2;
   }

   p {
      margin: 0;
      padding: 0;
      line-height: 1.5;
   }

   /* hlavicka, adresa prodejce */
   .header {
      border-bottom: 0.7mm solid black;
      font-weight: bold;
      height: 10mm;
   }

   .header td {
      vertical-align: top;
   }

   {* kdyz je sidlo firmy na 3 radky, zmensi se to *}
   .header div {
      -pdf-keep-in-frame-mode: shrink;
   }

   /* obchod používá wpjshop */
   .print-footer {
      color: #999;
   }

   /* bankovni udaje, data splatnosti */
   .bank {
      margin-bottom: 2mm;
   }

   .bank td {
      vertical-align: top;
   }

   /* 2 tabulky odberatel a dodaci udaje */
   .address td {
      vertical-align: top;
      padding: 0.7mm 0;
   }

   /* nesmi se oriznout! */
   .address {
      -pdf-keep-in-frame-mode: shrink;
   }

   .product-list {
      margin-bottom: 10mm;
   }

   .product-list td {
      font-size: 8pt;
      line-height: 1.3;
      padding: 1mm 0.5mm 0.2mm;
   }

   .product-list th {
      border: 1pt solid #fff;
      background: #ddd;
      font-size: 7pt;
      font-weight: bold;
      line-height: 1;
      padding: 0.5mm 1mm;
      height: 5mm;
   }

   /* posledni radek productlistu, doprava */
   .last td {
      border-top: 1pt solid #333;
      border-bottom: 1pt solid #999;
   }

   /* boxík s cenou */
   .pricebox th {
      border: 1pt solid #fff;
      background: #ddd;
      font-size: 8pt;
      font-weight: bold;
      line-height: 1;
      padding: 0.5mm 1mm;
      height: 6mm;
   }

   .pricebox td {
      font-size: 8pt;
      line-height: 1;
      padding: 0 0.5mm;
      height: 6mm;
   }

   /* cena celkem */
   .pricebox-final td {
      border: 2pt solid #222;
      height: 8mm;
      font-weight: bold;
      font-size: 10pt;
      line-height: 1;
      padding: 0.2mm 0.6mm 0;
   }

   .pricebox-final td:first-child {
      border-right: 0;
   }

   .pricebox-final td:last-child {
      border-left: 0;
   }

   .logo td {
      vertical-align: middle;
      padding: 2mm 1mm;
   }

   .print:last-of-type {
      page-break-after: auto;
   }

   .large {
      font-size: 10pt;
      font-weight: 700;
   }

   .storno {
      font-size: 50pt;
      color: red;
      text-align: center;
   }

   {/block}
</style>

{block "header-table"}
   <td align="right" valign="bottom" width="136"><pdf:barcode value="{$reclamation.code}" type="code128" humanreadable="0" barheight="27" barWidth="1" /></td>
{/block}

{block "header-title"}
   {t}Reklamační protokol{/t}: {$reclamation.code}
{/block}

{block "invoice-title"}
   <h1 class="bordered">{t}Reklamační protokol{/t} {$reclamation.code}</h1>
   {if $order}
      <p>{t}z objednávky č.{/t} {$order.order_no}</p><br>
   {/if}
{/block}

{block "invoice-dates"}
   <table width="100%" class="dates">
      <tr>
         <td width="60%">
            {get_datetime assign="now"}
            <strong>{t}Přijetí{/t}:</strong>
         </td>
         <td align="right" width="40%" style="padding-right: 1mm;">{$reclamation.date_created|format_date:'d.m.Y'}</td>
      </tr>
      <tr>
         <td>
            <strong>{t}Vyřízení{/t}:</strong>
         </td>
         {$date_handle = $reclamation.date_handle|default:$now}
         <td align="right" style="padding-right: 1mm;"> {$date_handle|format_date:'d.m.Y'}</td>
      </tr>
   </table>
{/block}

{block "left-table"}
      <tr>
         <td colspan="2">
            <h2>{t}Dodavatel{/t}:</h2>
            {$dbcfg.shop_firm_name}<br>
            {$dbcfg.shop_address|nl2br nofilter}<br>
            {if $dbcfg.shop_ico}{t}IČO{/t}: {$dbcfg.shop_ico} {/if}<br>
            {if $dbcfg.shop_dic}{t}DIČ{/t}: {$dbcfg.shop_dic}{/if}
         </td>
      </tr>
{/block}

{block "customer-address"}
   <table class="address">
      <tr>
         <td colspan="2">
            <h2>{t}Odběratel{/t}:</h2>
         </td>
      </tr>
      <tr>
         <td>
            <h3>{$reclamation.address.name} {$reclamation.address.surname}</h3>
         </td>
         <td>
            {$reclamation.address.street} <br/>
            {$reclamation.address.zip} {$reclamation.address.city}
         </td>
      </tr>
      <tr>
         <td>
            <h3><strong>{t}Telefon{/t}:</strong> {$reclamation.address.phone}</h3>
            <p>
               <strong>{t}Email{/t}:</strong> {$reclamation.email}
            </p>
         </td>
      </tr>
      {block "delivery-address"}
         <tr>
            <td colspan="2">
               <h2>{t}Dodací údaje{/t}</h2>
            </td>
         </tr>
         <tr>
            <td>
               <h3>{$reclamation.address.name} {$reclamation.address.surname}</h3>
            </td>
            <td>
               {$reclamation.address.street} <br/>
               {$reclamation.address.zip} {$reclamation.address.city}
            </td>
         </tr>
      {/block}
   </table>
{/block}

{block "delivery"}{/block}


{block "items"}
   <div class="product-list">
      <h2>{t}Informace o reklamaci{/t}</h2>
      <table>
         <tr>
            <td width="25%" style="vertical-align: top;"><strong>{t}Název zboží{/t}</strong></td>
            <td width="75%">{$reclamation.item.descr}<br>
               {t}Kód:{/t} {$reclamation.item.code}{if $reclamation.item.ean}, {t}EAN:{/t} {$reclamation.item.ean}{/if}
            </td>
         </tr>
         <tr>
            <td width="25%"><strong>{t}Důvod reklamace{/t}</strong></td>
            <td width="75%">{$reclamation.user_note}</td>
         </tr>
         <tr>
            <td width="25%"><strong>{t}Požadovaný způsob vyřízení{/t}</strong></td>
            <td width="75%">{$reclamation.preferred_handle_type_name}</td>
         </tr>
         <tr>
            <td width="25%"><strong>{t}Způsob vyřízení{/t}</strong></td>
            <td width="75%">{$reclamation.handle_type_name}</td>
         </tr>
         <tr>
            <td width="25%"><strong>{t}Posudek{/t}</strong></td>
            <td width="75%">{$reclamation.descr}</td>
         </tr>
      </table>
   </div>
{/block}

{block "invoice-bottom"}{/block}
