Files
kupshop/admin/templates/printCenter/pdf/stockInPDF.tpl
2025-08-02 16:30:27 +02:00

383 lines
10 KiB
Smarty

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>{block "header-title"}{t}Naskladnění{/t}{$body.data.id}{/block}</title>
<style type="text/css" media="all">
{block "style"}
{* todo na všech shopech používat podbloky, blok 'style' smazat *}
{block "style-pdf"}
/* @formatter:off */
{function page}{
size: A4 portrait;
@frame frame_header {
-pdf-frame-content: header{$iteration};
top: 5mm;
left: 10mm;
width: 190mm;
height: 10mm;
}
@frame frame_left {
-pdf-frame-content: left_column{$iteration};
left: 10mm;
top: 15mm;
width: 90mm;
height: 80mm;
}
@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: 75mm;
width: 190mm;
height: 210mm;
}
@frame frame_footer {
-pdf-frame-content: footer;
top: 289mm;
left: 10mm;
width: 190mm;
height: 8mm;
}
}
{/function}
{if $iteration}
@page first{$iteration} {page iteration=$iteration}
{else}
@page {page 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;
}
.product-list {
margin-bottom: 10mm;
}
.product-list td {
font-size: 8pt;
line-height: 1.3;
padding: 1mm 0.5mm 0.2mm;
border-bottom: 1pt solid #bbb;
}
.product-list th {
border: 1pt solid #fff;
background-color: #ddd;
font-size: 7pt;
font-weight: bold;
line-height: 1;
padding: 0.5mm 1mm;
height: 5mm;
}
{* předefinovany, protoze pdf generator nepodporuje 2 identicky css selektory *}
{block "style-css-last"}
/* posledni radek productlistu, doprava */
.last td {
border-top: 1pt solid #333;
border-bottom: 1pt solid #999;
}
{/block}
/* boxík s cenou */
.pricebox th {
border: 1pt solid #fff;
background-color: #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;
}
.table {
width: 100%;
display: table;
padding-top: 10px;
line-height: 1;
}
.table div {
display: inline;
float: left;
width: 50%;
}
.summary {
width: 90%;
text-align: right;
}
{/block}
{/block}
</style>
</head>
<body>
<div class="print">
<div id="header{$iteration}" class="header">
{block "header"}
<table>
<tr>
<td>{block "firm-name"}{$dbcfg.shop_firm_name}<br/>{$dbcfg.shop_firm_owner}{/block}</td>
<td>
<div>{$dbcfg.shop_address|nl2br nofilter}</div>
</td> {* div je potreba kvuli zmensovani *}
<td>{if $dbcfg.shop_ico}{t}IČO{/t}: {$dbcfg.shop_ico}<br/>{/if}{if $dbcfg.shop_dic}{t}DIČ{/t}: {$dbcfg.shop_dic}{/if}</td>
{block "header-table"}{/block}
</tr>
</table>
{/block}
</div>
<pdf:nexttemplate name="regular_template"/>
<div class="table">
<div id="left_column{$iteration}">
{if $cfg.Addr.full_original} {* na locale *}
<img src="{$cfg.Addr.full_original}templates/images/{$cfg.Modules.orders.invoice_logo|default:'logo.png'}"
alt="{$dbcfg.shop_firm_name}"/>
{else}
<img src="{$cfg.Addr.full}templates/images/{$cfg.Modules.orders.invoice_logo|default:'logo.png'}" alt="{$dbcfg.shop_firm_name}"/>
{/if}
</div>
<div id="right_column{$iteration}">
<table>
<tr>
<td><strong>Dodavatel:</strong></td>
<td>{$body.data.header.supplier_name}</td>
</tr>
<tr>
<td><strong>Číslo faktury:</strong></td>
<td>{$body.data.header.code}</td>
</tr>
<tr>
<td><strong>Datum vystavení:</strong></td>
<td>{$body.data.header.date_issued|format_date:'d.m.Y'}</td>
</tr>
<tr>
<td><strong>Datum splatnosti:</strong></td>
<td>{$body.data.header.date_expiration|format_date:'d.m.Y'}</td>
</tr>
<tr>
<td><strong>Typ úhrady:</strong></td>
<td>{$body.data.header.payment_method}</td>
</tr>
<tr>
<td><strong>Kurz měny:</strong></td>
<td>{if $body.data.header.multiplier != 1}{$body.data.header.multiplier}{else}-{/if}</td>
</tr>
<tr>
<td><strong>Poznámka:</strong></td>
<td>{$body.data.header.note}</td>
</tr>
</table>
</div>
</div>
<div class="content" id="down">
{block "items"}
<table class="product-list" repeat="1">
<tr>
<th style="text-align: center; width: 9mm;">{t}Ks{/t}</th>
<th style="width: 80%;">{t}Položky{/t}</th>
<th style="text-align: center; width: 40mm;">{t}Kód{/t}</th>
<th style="text-align: right; width: 25mm">{t}s DPH/ks{/t}</th>
<th style="text-align: right; width: 25mm;">{t}bez DPH/ks{/t}</th>
<th style="text-align: right; width: 14mm;">{t}DPH{/t}</th>
<th style="text-align: right; width: 35mm;">{t}Celkem s DPH{/t}</th>
</tr>
{foreach $body.data.items as $item}
<tr {if $item@last && !$item.id_product}class="last"{/if}>
<td align="center">{$item.quantity}</td>
<td align="left">{$item.name}</td>
<td align="left">{$item.code}</td>
<td style="text-align: right;">{$item.priceObject->getPriceWithVat(false)|format_price:"ceil=no;printcurrency=no"}</td>
<td style="text-align: right;">{$item.priceObject->getPriceWithoutVat(false)|format_price:"printcurrency=no;ceil=no;decimal=dynamic"}</td>
<td style="text-align: right;">{$item.vat}%</td>
<td style="text-align: right;">{$item.priceObject->getPriceWithVat(false)->mul(toDecimal($item.quantity))|format_price:"ceil=no;decimal=dynamic"}</td>
</tr>
{/foreach}
</table>
{/block}
</div>
<div class="summary">
<div><strong>Celková cena bez DPH:</strong> {$body.data.header.total_price|format_price:"ceil=no"}</div>
<div><strong>Celková cena s DPH:</strong> {$body.data.header.total_price_vat|format_price:"ceil=no"}</div>
</div>
{block "footer"}
<div class="print-footer" id="footer">
{block "footer-text"}{/block}
<table>
<tr>
<td align="left">{t}Obchod používá systém{/t} <a href="https://www.wpjshop.cz/">wpjshop.cz</a></td>
<td align="center">{block "footer-url"}{substr_replace($cfg.Addr.print,"",-1)}{/block}</td>
<td align="right">{if $iteration === false}{t escape=false}Strana
<pdf:pagenumber> z
<pdf:pagecount>{/t}{/if}
</td>
</tr>
</table>
</div>
{/block}
</div>
</body>
</html>