<htmlpageheader name="test">
<table style="width:100%">
	<tr>
		<td style="width:50%; text-align:center" rowspan="2">
			<img src="upload/{$EcmSysInfo->getLogo()}"  width="235px">
		</td>
		<td style="width:50%;background-color:#c2c2c2;text-align:center;font-size:14pt">
			Faktura VAT		
		</td>
	</tr>
	<tr>
		<td style="text-align:center;font-size:14pt">
			<b>nr FV/{$EcmInvoiceOut->document_no}<b>
		</td>
	</tr>
	<tr>
		<td>
		
		</td> 
	</tr>
	<tr>
		<td style="padding:2px;">
			<b>Sprzedawca:</b>
		</td>


	</tr>
	<tr>
		<td>
		 
		</td>
		<td style="padding:2px;">
			Data wystawienia: <b>{$EcmInvoiceOut->register_date}</b> Data sprzedaży: <b>{$EcmInvoiceOut->sell_date}</b>
		</td>
	</tr>
	<tr>
		<td style="padding:2px;letter-spacing: 0px;">
			<b>Przedsiębiorstwo Handlowo Usługowe<br>MAT INSTAL Karol Kluczewski</b>
		</td>
		<td style="padding:2px;letter-spacing: 0px;">
			Miejsce wystawienia: <b>Toruń</b>{$duplikat}
		</td>
	</tr>
	</tr>
	<tr>
		<td style="padding:2px;">
			ul. Płocka 3, 87-100 Toruń
		</td>
		<td style="padding:2px;">
		</td>
	</tr>
	<tr>
		<td style="padding:2px;">
			NIP: 879-155-19-52
		</td>
		<td style="padding:2px;">
		</td>
	</tr>
	<tr>
		<td style="padding:2px;">
			www.matinstal.pl
		</td>
		<td style="background-color:#c2c2c2; text-align:center">
			Strona: <b>{literal} {PAGENO} / {nbpg}{/literal}</b>
	</tr>
	<tr>
		<td style="padding:2px;">
			Tel/fax: 56 648 40 88
		</td>
		<td style="padding:2px;">
		</td>
	</tr>
</table>

<br><br>

<table style="width:100%;">
	<tr>
		<td style="width:52%;height: 26px;vertical-align:top;">
			Bank BGŻ BNP Paribas S.A
		</td>
		<td style="width:48%;height: 26px;vertical-align:top;">
			Nr rachunku: {$EcmInvoiceOut->bankaccount}
		</td>
	</tr>
	<tr>
		<td style="padding:2px;height: 26px;vertical-align:top;">
			<b>Nabywca:</b>
		</td>
		<td style="padding:2px;height: 26px;vertical-align:top;">
			<b>Odbiorca:</b>
		</td>
	</tr>
	<tr>
		<td style="padding:2px;height: 26px;vertical-align:top;">
			<b>{$EcmInvoiceOut->parent_name}</b>
		</td>
		<td style="padding:2px;height: 26px;vertical-align:top;">
			<b>{$EcmInvoiceOut->parent_name}</b>
		</td>
	</tr>
	<tr>
		<td style="padding:2px;">
			{$EcmInvoiceOut->parent_address_street}
		</td>
		<td style="padding:2px;">
			{$EcmInvoiceOut->parent_address_street}
		</td>
	</tr>
	<tr>
		<td style="padding:2px;">
			{$EcmInvoiceOut->parent_address_postalcode} {$EcmInvoiceOut->parent_address_city}
		</td>
		<td style="padding:2px;">
			{$EcmInvoiceOut->parent_address_postalcode} {$EcmInvoiceOut->parent_address_city}
		</td>
	</tr>
	<tr>
		<td style="padding:2px;">
			NIP: {$EcmInvoiceOut->parent_nip}
		</td>
		<td style="padding:2px;">
			NIP: {$EcmInvoiceOut->parent_nip}
		</td>
	</tr>
</table>
</htmlpageheader>
<sethtmlpageheader name="test" value="on" show-this-page="1" page="ALL"/>

<htmlpagefooter name="test2">
<table style="width:100%">
	<tr>
		<td colspan="2" style="font-size:16">
			<b>Razem do zapłaty:</b>
		</td>
		<td style="text-align:right;font-size:16" colspan="2">
			<b>{$EcmInvoiceOut->total_brutto|number_format:2:",":" "} {$EcmInvoiceOut->currency_id}</b>
		</td>
	</tr>
	<tr>
		<td colspan=4 style="text-align:right">
			<i>Słownie: {$slownieKwota}</i>
		</td>
	</tr>
	<tr>
		<td style="text-align:left">Zapłacono:</td>
		<td style="text-align:center">{$EcmInvoiceOut->paid_val|number_format:2:",":" "} {assign var="Currency_id" value=$EcmInvoiceOut->currency_id}
				{$APP_LIST_STRINGS.currency_dom.$Currency_id}</td>
		<td style="text-align:center">Pozostało do zapłaty:</td>
		<td style="text-align:right">{$EcmInvoiceOut->total_brutto-$EcmInvoiceOut->paid_val|number_format:2:",":" "} {assign var="Currency_id" value=$EcmInvoiceOut->currency_id}
				{$APP_LIST_STRINGS.currency_dom.$Currency_id}</td>
	</tr>
	<tr>
		<td colspan="4" style="padding=0;margin:0;"><hr style="color:#c2c2c2;padding=0;margin:0;"></td>
	</tr>
</table>
<table style="width:100%">
	<tr>
		<td style="text-align:center;"><b>{$EcmInvoiceOut->assigned_user_name}</b></td>
		<td style="text-align:center;"></td>
		<td style="text-align:center;"></td>
		<td style="text-align:center;"></td>
		<td style="text-align:center;"></td>

	</tr>
	<tr>
		<td style="width:27%;text-align:center;border-top: 1px solid #c2c2c2;font-size:10">Podpis osoby uprawnionej do wystawienia faktury</td>
		<td style="width:10%;text-align:center"></td>
		<td style="width:20%;text-align:center;border-top: 1px solid #c2c2c2;font-size:10">Data odbioru</td>
		<td style="width:10%;text-align:center"></td>
		<td style="width:27%;text-align:center;border-top: 1px solid #c2c2c2;font-size:10">Podpis osoby uprawnionej do obioru faktury</td>

	</tr>
</table>
</htmlpagefooter>
<sethtmlpagefooter name="test2" value="on" show-this-page="1" page="ALL"/>

<table style="width:100%;border: none; border-collapse: collapse;font-size:11">
	<thead>
		<tr>
			<td style="padding:3px;vertical-align:middle;background-color:#c2c2c2; width:4%;border-left: 1px solid #c2c2c2; border-right: 1px solid #c2c2c2; text-align:center">
				Lp.
			</td>
			<td style="padding:3px;vertical-align:middle;background-color:#c2c2c2; width:36%;border-left: 1px solid #c2c2c2; border-right: 1px solid #c2c2c2;text-align:left">
				Nazwa towaru/usługi
			</td>
			<td style="padding:3px;vertical-align:middle;background-color:#c2c2c2; width:8%;border-left: 1px solid #c2c2c2; border-right: 1px solid #c2c2c2; text-align:center">
				Ilość
			</td>
			<td style="padding:3px;vertical-align:middle;background-color:#c2c2c2; width:8%;border-left: 1px solid #c2c2c2; border-right: 1px solid #c2c2c2;text-align:center">
				J.m.
			</td>
			<td style="padding:3px;vertical-align:middle;background-color:#c2c2c2; width:5%;border-left: 1px solid #c2c2c2; border-right: 1px solid #c2c2c2;text-align:center">
				VAT
			</td>
			<td style="padding:3px;vertical-align:middle;background-color:#c2c2c2; width:12%;border-left: 1px solid #c2c2c2; border-right: 1px solid #c2c2c2; text-align:center">
				Cena netto
			</td>
			<td style="padding:3px;vertical-align:middle;background-color:#c2c2c2; width:12%;border-left: 1px solid #c2c2c2; border-right: 1px solid #c2c2c2;text-align:center">
				Wartość netto
			</td>
		</tr>
	</thead>
	<tbody>
		{foreach from=$EcmInvoiceOut->position_list item=positon}
			<tr>
				<td style="text-align: center;">
					{$positon.position+1}
				</td>
				<td style="text-align: left;">
					{$positon.name}
				</td>
				<td style="text-align: right;">
					{$positon.quantity|number_format:4:",":" "}
				</td>
				<td style="text-align: center;">
					{$positon.unit_name}
				</td>
				<td style="text-align: center;">
					{$positon.ecmvat_name}
				</td>
				<td style="text-align: right;">
					{$positon.price_netto|number_format:2:",":" "}
				</td>
				<td style="text-align: right;">
					{$positon.total_netto|number_format:2:",":" "}
				</td>
			</tr>
		{/foreach}
	</tbody>
</table>
<br>
<table style="width:100%;border: none; border-collapse: collapse;font-size:11">
	<thead>
		<tr>
			<td style="width:40%;"></td>
			<td style="width:10%;background-color:#c2c2c2;border-left: 1px solid #c2c2c2; border-right: 1px solid #c2c2c2; text-align:center">
				Waluta
			</td>
			<td style="width:5%;background-color:#c2c2c2;border-left: 1px solid #c2c2c2; border-right: 1px solid #c2c2c2; text-align:left">
				
			</td>
			<td style="width:5%;background-color:#c2c2c2;border-left: 1px solid #c2c2c2; border-right: 1px solid #c2c2c2; text-align:right">
				Stawka
			</td>
			<td style="width:10%;background-color:#c2c2c2;border-left: 1px solid #c2c2c2; border-right: 1px solid #c2c2c2; text-align:right">
				Netto&nbsp;&nbsp;
			</td>
			<td style="width:15%;background-color:#c2c2c2;border-left: 1px solid #c2c2c2; border-right: 1px solid #c2c2c2; text-align:right">
				VAT&nbsp;&nbsp;
			</td>
			<td style="width:15%;background-color:#c2c2c2;border-left: 1px solid #c2c2c2; border-right: 1px solid #c2c2c2; text-align:right">
				Brutto&nbsp;&nbsp;
			</td>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td style=></td>
			<td style="text-align:center">
				{assign var="Currency_id" value=$EcmInvoiceOut->currency_id}
				{$APP_LIST_STRINGS.currency_dom.$Currency_id}
			</td>
			<td style=" text-align:left">
				Razem:
			</td>
			<td style="text-align:center">
				
			</td>
			<td style=" text-align:right">
				<b>{$EcmInvoiceOut->total_netto|number_format:2:",":" "}</b>
			</td>
			<td style=" text-align:right">
				<b>{$EcmInvoiceOut->total_vat|number_format:2:",":" "}</b>
			</td>
			<td style="text-align:right">
				<b>{$EcmInvoiceOut->total_brutto|number_format:2:",":" "}</b>
			</td>
		</tr>
		{foreach from=$EcmInvoiceOut->vats_summary item=vat_row name=vat_pozycje}
			<tr>
				<td></td>
				<td style="text-align:center">
					
				</td>
				<td style=" text-align:right">
					{if $smarty.foreach.vat_pozycje.iteration eq 1}
						W tym:
					{/if}
				</td>
				<td style="text-align:center">
					{$vat_row.0}
				</td>
				<td style=" text-align:right">
					{$vat_row.1|number_format:2:",":" "}
				</td>
				<td style=" text-align:right">
					{$vat_row.2|number_format:2:",":" "}
				</td>
				<td style="text-align:right">
					{$vat_row.3|number_format:2:",":" "}
				</td>
			</tr>
		{/foreach}
	</tbody>
</table>
<br><br>
<table style="width:50%;border: none; border-collapse: collapse;">
	<thead>
		<tr>
			<td style="background-color:#c2c2c2;border-left: 1px solid #c2c2c2; border-right: 1px solid #c2c2c2; text-align:center">
				Forma płatności
			</td>
			<td style="background-color:#c2c2c2;border-left: 1px solid #c2c2c2; border-right: 1px solid #c2c2c2; text-align:center">
				Termin
			</td>
			<td style="background-color:#c2c2c2;border-left: 1px solid #c2c2c2; border-right: 1px solid #c2c2c2; text-align:center">
				Kwota
			</td>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td style=" text-align:center">
				{$EcmInvoiceOut->payment_method}
			</td>
			<td style=" text-align:center">
				{$EcmInvoiceOut->payment_date}
			</td>
			<td style="text-align:center">
				{$EcmInvoiceOut->total_brutto|number_format:2:",":" "}
			</td>
		</tr>
	</tbody>
</table>

<br>

<div style="padding:5px;width:100%;border: 1px solid #c2c2c2">
	Uwagi:
	<br><br>
	{$EcmInvoiceOut->pdf_text}
</div>

