<htmlpageheader name="test">
<table style="width:100%">
	<tr>
		<td style="width:30%; text-align:left" rowspan="2">
			<img src="upload/{$EcmSysInfo->getLogo()}" height="80px">
		</td>
		<td>
			Arkusz Remanentu: {$EcmInventory->document_no}<br>
			Data dokumentu: {$EcmInventory->register_date}<br>
			Typ: Wszystko<br>
			Strona: {literal} {PAGENO} / {nbpg}{/literal}<br>
			Magazyn: {$EcmStock->name}
		</td>
	</tr>
</table>
</htmlpageheader>
<sethtmlpageheader name="test" value="on" show-this-page="1" page="ALL"/>

<table style="width:100%;border: 1px solid black; border-collapse: collapse;font-size:11">
	<thead>
		<tr>
			<td style="padding:3px;vertical-align:middle;background-color:#c2c2c2; width:4%;border: 1px solid black; text-align:center">
				Lp.
			</td>
			<td style="padding:3px;vertical-align:middle;background-color:#c2c2c2; width:15%;border: 1px solid black;text-align:left">
				Indeks
			</td>
			<td style="padding:3px;vertical-align:middle;background-color:#c2c2c2; width:36%;border: 1px solid black;text-align:left">
				Nazwa towaru
			</td>
			<td style="padding:3px;vertical-align:middle;background-color:#c2c2c2; width:8%;border: 1px solid black; text-align:center">
				J.m.
			</td>
			<td style="padding:3px;vertical-align:middle;background-color:#c2c2c2; width:8%;border: 1px solid black;text-align:center">
				Kategoria
			</td>
			<td style="padding:3px;vertical-align:middle;background-color:#c2c2c2; width:5%;border: 1px solid black;text-align:center">
				Ilość remanentowa
			</td>
			<td style="padding:3px;vertical-align:middle;background-color:#c2c2c2; width:12%;border: 1px solid black; text-align:center">
				Cena zakupu
			</td>
			<td style="padding:3px;vertical-align:middle;background-color:#c2c2c2; width:12%;border: 1px solid black;text-align:center">
				Stan kartotekowy
			</td>
			<td style="padding:3px;vertical-align:middle;background-color:#c2c2c2; width:12%;border: 1px solid black;text-align:center">
				Różnica
			</td>
			<td style="padding:3px;vertical-align:middle;background-color:#c2c2c2; width:12%;border: 1px solid black;text-align:center">
				Wartość
			</td>
		</tr>
	</thead>
	<tbody>
		{assign var='pozycja' value=0}
		{foreach from=$EcmInventory->position_list item=positon}
			{assign var='precision' value=$positon.dd_unit_precision}
			<tr>
				<td style="text-align: center;border: 1px solid black">
					{assign var='pozycja' value=$pozycja+1}
					{$pozycja}
				</td>
				<td style="text-align: left;border: 1px solid black">
					{$positon.code}
				</td>
				<td style="text-align: left;border: 1px solid black">
					{$positon.name}
				</td>
				<td style="text-align: right;border: 1px solid black">
					{$positon.dd_unit_name}
				</td>
				<td style="text-align: center;border: 1px solid black">
					{$position.ecmproductcategory_id}
				</td>
				<td style="text-align: right;border: 1px solid black">
					{$positon.quantity|number_format:$precision:",":"."}
				</td>
				<td style="text-align: right;border: 1px solid black">
					{$positon.price|number_format:2:",":"."}
				</td>
				<td style="text-align: right;border: 1px solid black">
					{$positon.stock_state|number_format:$precision:",":"."}
				</td>
				<td style="text-align: right;border: 1px solid black">
					{$positon.stock_state_quantity_difference|number_format:$precision:",":"."}
				</td>
				<td style="text-align: right;border: 1px solid black">
					{assign var='suma' value=$suma+$positon.projected_price}
					{$positon.projected_price|number_format:2:",":"."}
				</td>
				
			</tr>
		{/foreach}
	</tbody>
		<tfoot>
		<tr>
			<td colspan="8" style="border-left: 0px;border-bottom: 0px" >
			
			</td>
			<td style="text-align: right;border: 1px solid black">
			Suma:
			</td>
			<td  style="text-align: right;border: 1px solid black">
				{$suma|number_format:2:",":"."}
			</td>
		</tr>
	</tfoot>
</table>

{if $EcmInventory->pdf_text != ''}
	<br><br>
	Uwagi:
	<br>
	{$EcmInventory->pdf_text}
{/if}
