Files
crm.twinpol.com/modules/EcmReports/tpls/VatPurchasesPDF.tpl
2025-05-12 15:46:37 +00:00

201 lines
7.0 KiB
Smarty
Executable File

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
{literal}
@page {
size: auto;
odd-header-name: html_Header;
}
#MainTable {
width: 100%;
font-size: 8pt;
border-collapse: collapse;
}
#MainTable .text-left {
text-align: left;
}
#MainTable .text-right {
text-align: right;
}
#MainTable .border-bottom {
border-collapse: collapse;
border-bottom: 1px solid black;
}
#MainTable .border-top {
border-collapse: collapse;
border-top: 1px solid black;
}
{/literal}
</style>
</head>
<body>
<htmlpageheader name="Header">
<div style="text-align: left; font-weight: bold; font-size: 10pt;">
<table style="width: 100%">
<tr><td style="width: 50%">
<table>
<tr>
<td style="font-size: 12px; font-weight: bold">{$COMPANY_NAME}</td>
</tr>
<tr>
<td style="font-size: 12px; font-weight: bold">Data wydruku: {$CUR_DATE}</td>
</tr>
<tr>
<td style="font-size: 12px; font-weight: bold">Rejestr zakupu za okres od {$DATE_FROM} do {$DATE_TO}</td>
</tr>
<tr>
<td style="font-size: 12px; font-weight: bold">Strona {literal}{PAGENO} z {nbpg}{/literal}</td>
</tr>
</table>
</td><td style="text-align: right; vertical-align: top; font-size: 8pt;">
Ustawienia raportu:<br>
Magazyn: {$S_STOCK}<br>
Rodzaj: {$S_KIND}<br>
Kategoria: {$S_CATEGORY}<br>
</td></tr>
</table>
</div>
</htmlpageheader>
<div>
{foreach from=$PAGES item=PAGE name=page"}
{assign var=pagesCount value=$PAGES|@count}
{assign var=vatColSize value=0}
{math
assign="vatColSize"
equation="round(37/($vatsCount))"
}
<table id="MainTable">
<thead>
<tr>
<th class="border-top border-bottom" style="width: 3%;" rowspan="2">Lp.</th>
<th class="text-left border-top" style="width: 10%;">Nr dok.</th>
<th class="text-left border-top" style="width: 10%;">Data wpływ.</th>
<th class="text-left border-top" style="width: 10%;">Data rejest.</th>
<th class="text-left border-top" style="width: 10%;">Nr PZ</th>
<th class="text-left border-top" colspan="{$vatsCount+1}">Odbiorca - NIP, Nazwa, Adres</th>
</tr>
<tr>
<th class="text-right border-bottom" style="width: 10%;">Rodzaj</th>
<th class="text-right border-bottom" style="width: 10%;">Zak. brutto</th>
<th class="text-right border-bottom" style="width: 10%;">Zak. netto</th>
<th class="text-right border-bottom" style="width: 10%;">Wartość PZ</th>
{foreach from=$VATS key=vat_name item=i}
<th class="text-right border-bottom" style="width: {$vatColSize}%;">Netto {$vat_name}</th>
{if $i=='2'}
<th class="text-right border-bottom" style="width: {$vatColSize}%;">VAT {$vat_name}</th>
{/if}
{/foreach}
<th class="text-right border-bottom" style="width: 10%;">VAT Razem</th>
</tr>
</thead>
<tbody>
{foreach from=$PAGE.rows item=row}
{if $row.is_summary!=1}
<tr>
<td class="text-left border-bottom" rowspan="2">{$row.lp}</td>
<td class="text-left">{$row.document_no}&nbsp;&nbsp;</td>
<td class="text-left">{$row.publish_date}</td>
<td class="text-left">{$row.register_date}</td>
<td class="text-left">{$row.rel_doc}</td>
<td class="text-left" colspan="{$vatsCount+1}">{$row.parent_info}</td>
</tr>
<tr>
<td class="text-right border-bottom">{$row.parent_type}</td>
<td class="text-right border-bottom">{$row.brutto|number_format:2:",":"."}</td>
<td class="text-right border-bottom">{$row.netto|number_format:2:",":"."}</td>
<td class="text-right border-bottom">{$row.rel_doc_total|number_format:2:",":"."}</td>
{foreach from=$row.vats item=v key=k}
<td class="text-right border-bottom">{$v[0]|number_format:2:",":"."}</td>
{if $VATS.$k == '2'}
<td class="text-right border-bottom">{$v[1]|number_format:2:",":"."}</td>
{/if}
{/foreach}
<td class="text-right border-bottom">{$row.vat|number_format:2:",":"."}</td>
</tr>
{else}
<tr>
<td class="text-left" colspan="{$vatsCount+6}"><b>Razem - {$row.index}</b></td>
</tr>
<tr>
<td class="text-right border-bottom" colspan="2">&nbsp;</td>
<td class="text-right border-bottom" >{$row.total_brutto|number_format:2:",":"."}</td>
<td class="text-right border-bottom" >{$row.total_netto|number_format:2:",":"."}</td>
<td class="text-right border-bottom" >{$row.total_rel|number_format:2:",":"."}</td>
{foreach from=$row.vats item=v key=k}
<td class="text-right border-bottom">{$v[0]|number_format:2:",":"."}</td>
{if $VATS.$k == '2'}
<td class="text-right border-bottom">{$v[1]|number_format:2:",":"."}</td>
{/if}
{/foreach}
<td class="text-right border-bottom" >{$row.total_vat|number_format:2:",":"."}</td>
</tr>
{/if}
{/foreach}
<tr>
<td class="text-left" colspan="{$vatsCount+5}">Suma strony:</td>
</tr>
<tr>
<td class="border-bottom" colspan="2">&nbsp;</td>
<td class="text-right border-bottom">{$PAGE.site_brutto|number_format:2:",":"."}</td>
<td class="text-right border-bottom">{$PAGE.site_netto|number_format:2:",":"."}</td>
<td class="text-right border-bottom">{$PAGE.site_pz|number_format:2:",":"."}</td>
{foreach from=$PAGE.site_vats item=v key=k}
<td class="text-right border-bottom">{$v[0]|number_format:2:",":"."}</td>
{if $VATS.$k == '2'}
<td class="text-right border-bottom">{$v[1]|number_format:2:",":"."}</td>
{/if}
{/foreach}
<td class="text-right border-bottom">{$PAGE.site_vat|number_format:2:",":"."}</td>
</tr>
<tr>
<td class="text-left" colspan="{$vatsCount+5}">Suma z przeniesienia:</td>
</tr>
<tr>
<td class="border-bottom" colspan="2">&nbsp;</td>
<td class="text-right border-bottom">{$PAGE.moved_brutto|number_format:2:",":"."}</td>
<td class="text-right border-bottom">{$PAGE.moved_netto|number_format:2:",":"."}</td>
<td class="text-right border-bottom">{$PAGE.moved_pz|number_format:2:",":"."}</td>
{foreach from=$PAGE.moved_vats item=v key=k}
<td class="text-right border-bottom">{$v[0]|number_format:2:",":"."}</td>
{if $VATS.$k == '2'}
<td class="text-right border-bottom">{$v[1]|number_format:2:",":"."}</td>
{/if}
{/foreach}
<td class="text-right border-bottom">{$PAGE.moved_vat|number_format:2:",":"."}</td>
</tr>
<tr>
<td class="text-left" colspan="{$vatsCount+5}">Suma razem:</td>
</tr>
<tr>
<td class="border-bottom" colspan="2">&nbsp;</td>
<td class="text-right border-bottom">{$PAGE.total_brutto|number_format:2:",":"."}</td>
<td class="text-right border-bottom">{$PAGE.total_netto|number_format:2:",":"."}</td>
<td class="text-right border-bottom">{$PAGE.total_pz|number_format:2:",":"."}</td>
{foreach from=$PAGE.total_vats item=v key=k}
<td class="text-right border-bottom">{$v[0]|number_format:2:",":"."}</td>
{if $VATS.$k == '2'}
<td class="text-right border-bottom">{$v[1]|number_format:2:",":"."}</td>
{/if}
{/foreach}
<td class="text-right border-bottom">{$PAGE.total_vat|number_format:2:",":"."}</td>
</tr>
</tbody>
</table>
{if $smarty.foreach.page.index != $pagesCount-1 }
<newpage>
{/if}
{/foreach}
<p style="font-size: 8pt;">
KONIEC WYDRUKU
</p>
</div>
</body>
</html>