<?xml version="1.0" encoding="{{$config.charset}}"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{$config.language}}">
<head>
	<title>{{$lang.WZ_order}} {{$aOrder.iOrder}}</title>
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
	<link rel="stylesheet" type="text/css" href="{{$config.dir_templates}}admin/style_invoice.css" />
</head>
<body onload="window.print()">

<table id="body">
	<thead>
		<tr><td>{{$lang.WZ_order}} {{$aOrder.iOrder}}</td></tr>
	</thead>
	<tfoot>
		<tr><td>

		</td></tr>
	</tfoot>
	<tbody>
		<tr>
			<td>
				<div id="seller">
					<strong>{{$lang.Invoices_Seller}}:</strong>
					<p>
						{{$config.invoices_company_name}}<br/>
						{{$config.invoices_address}}<br/>
						{{$config.invoices_postal_code}} {{$config.invoices_city}}<br/>
						{{$lang.Invoices_NIP}}: {{$config.invoices_NIP}}<br/>
						{{$lang.Invoices_REGON}}: {{$config.invoices_REGON}}<br/>
						{{$lang.Invoices_Bank_Short}}: {{$config.invoices_Bank}}<br/>
						{{$lang.Invoices_Account_Nr}}: {{$config.invoices_Account}}
					</p>
				</div>
				<div id="date">
					<p>{{$lang.Invoices_date}}: {{$aOrder.sDate}} {{$config.invoices_city}}<br />{{$lang.Invoices_sell_date}}: {{$aOrder.sDate}}</p>
				</div>

				<div id="buyer">
					<b>{{$lang.Invoices_Buyer}}:</b>
					<p>
						{{if $aOrder.iInvoice == 1}}{{$aOrder.sCompanyName}} {{/if}}{{$aOrder.sFirstName}} {{$aOrder.sLastName}}<br/>
						{{$aOrder.sStreet}}<br/>
						{{$aOrder.sZipCode}} {{$aOrder.sCity}}<br/>
						{{if $aOrder.iInvoice == 1}}{{$lang.Invoices_NIP}}: {{$aOrder.sNip}}<br/>{{/if}}
						{{$lang.Phone}}: {{$aOrder.sPhone}}<br/>
						{{$aOrder.sEmail}}
					</p>
				</div>

				<div id="addressee">
					<b>{{$lang.Invoices_Address_Suply}}:</b>
					<p>
						{{if !empty( $aOrder.sPostalName )}}{{$aOrder.sPostalName}}{{else}}{{$aOrder.sCompanyName}} {{$aOrder.sFirstName}} {{$aOrder.sLastName}}{{/if}}<br/>
						{{if !empty( $aOrder.sPostalStreet )}}{{$aOrder.sPostalStreet}}{{else}}{{$aOrder.sStreet}}{{/if}}<br/>
						{{if !empty( $aOrder.sPostalZipCode )}}{{$aOrder.sPostalZipCode}}{{else}}{{$aOrder.sZipCode}}{{/if}} {{if !empty( $aOrder.sPostalCity )}}{{$aOrder.sPostalCity}}{{else}}{{$aOrder.sCity}}{{/if}}<br/>
						{{$lang.Phone}}: {{if !empty( $aOrder.sPostalPhone )}}{{$aOrder.sPostalPhone}}{{else}}{{$aOrder.sPhone}}{{/if}}<br/>
						{{$aOrder.sEmail}}
					</p>
				</div>
				<table id="list">
					<thead>
						<tr>
							<th>{{$lang.Invoices_List_Nr}}</th>
							<th>{{$lang.Invoices_List_Name}}</th>
							<th>{{$lang.Invoices_List_Code}}</th>
							<th>{{$lang.Invoices_List_Unit}}</th>
							<th>{{$lang.Invoices_List_Count}}</th>
							<th>{{$lang.Invoices_List_Unit_NetPrice}}<br/>[{{$config.currency_symbol}}]</th>
							{{if $aOrder.bPercentDiscount}}<th>{{$lang.Discount_coupon_value}}<br/>[%]</th>
							<th>{{$lang.Net_price_discount}}<br/>[{{$config.currency_symbol}}]</th>{{/if}}
							<th>{{$lang.Invoices_List_NetPrice}}<br/>[{{$config.currency_symbol}}]</th>
							<th>{{$lang.Invoices_List_VAT}}<br/>[%]</th>
							<th>{{$lang.Invoices_List_Tax}}<br/>[{{$config.currency_symbol}}]</th>
							<th>{{$lang.Invoices_List_BruttoPrice}}<br/>[{{$config.currency_symbol}}]</th>
						</tr>
					</thead>
					<tfoot>
						<tr>
							{{if $aOrder.bPercentDiscount}}<td colspan="2" class="foot_desc"></td>{{/if}}
							<td colspan="6" class="foot_desc">{{$lang.Invoices_sum}}</td>
							<td class="number">{{$aOrder.sNetValue}}</td>
							<td class="number">x</td>
							<td class="number">{{$aOrder.sVatValue}}</td>
							<td class="number">{{$aOrder.sBrutValue}}</td>
						</tr>
						{{foreach from=$aOrder.aSubSums item=aSubSum}}
							<tr>
								{{if $aOrder.bPercentDiscount}}<td colspan="2" class="foot_desc"></td>{{/if}}
								<td colspan="7" class="foot_desc">{{$lang.Invoices_subsum}}</td>
								<td class="number">{{$aSubSum.sVatValuePercent}}</td>
								<td class="number">{{$aSubSum.sVatValue}}</td>
								<td class="number">{{$aSubSum.sBrutValue}}</td>
							</tr>
						{{/foreach}}

						
						{{if $aOrder.bDiscountPanelActive}}
							<tr><td colspan="9" class="foot_desc">{{$lang.Discount_coupon_value}}</td><td class="number">{{$aOrder.sDiscountCouponValue}}</td></tr>
							<tr><td colspan="9" class="foot_desc">{{$lang.Summary_after_discount}}:</td><td class="number">{{$aOrder.sProductsSummaryDiscount}}</td></tr>
						{{/if}}

					</tfoot>
					<tbody>

					{{foreach from=$aOrder.aProducts item=aProduct}}
						<tr>
							<td>{{$aProduct.iNr}}</td>
							<td>{{$aProduct.sName}}</td>
							<td>
								{{if !empty( $aProduct.sEan )}}{{$aProduct.sEan}}<br/>{{/if}}
								{{if !empty( $aProduct.sOuterId )}}{{$aProduct.sOuterId}}<br/>{{/if}}
								{{if !empty( $aProduct.sProductIndex )}}{{$aProduct.sProductIndex}}<br/>{{/if}}
								{{if !empty( $aProduct.sCatalogNumber )}}{{$aProduct.sCatalogNumber}}<br/>{{/if}}
							</td>
							<td>{{$aProduct.sMeasure}}</td>
							<td class="number">{{$aProduct.iQuantity}}</td>
							<td class="number">{{$aProduct.sNetPrice}}</td>
							{{if $aOrder.bPercentDiscount}}<td class="number">{{$aProduct.sDiscount}}</td>
							<td class="number">{{$aProduct.sNetPriceD}}</td>{{/if}}
							<td class="number">{{$aProduct.sNetValueD}}</td>
							<td class="number">{{$aProduct.sVatValuePercent}}</td>
							<td class="number">{{$aProduct.sVatValueD}}</td>
							<td class="number">{{$aProduct.sBrutValueD}}</td>
						</tr>
					{{/foreach}}
					
					
					</tbody>
				</table>

				<p>
					<b>{{$lang.Invoices_Summary}}:</b> {{$aOrder.sSummary}} {{$config.currency_symbol}}<br/>
					<b>{{$lang.Invoices_Summary_Text}}:</b> {{$aOrder.sSummaryText}}
				</p>

				<ul id="additional_info">
					{{if isset($aOrder.sComment)}}
						<li><strong>{{$lang.Order_comment}}:</strong> {{$aOrder.sComment}}</li>
					{{/if}}
					{{if isset($aOrder.sCommentAdmin)}}
						<li><strong>{{$lang.Admin_comment}}:</strong> {{$aOrder.sCommentAdmin}}</li>
					{{/if}}
					{{if $aOrder.iGift == '1'}}<li><strong>{{$lang.Pack_as_gift}}</strong></li>
						{{if isset($aOrder.sGiftText)}}
							<li><strong>{{$lang.Gift_Text}}:</strong> {{$aOrder.sGiftText}}</li>
						{{/if}}
						{{if $aOrder.iShowClient}}<li><strong>{{$lang.Show_Client}}</strong></li>{{/if}}
					{{/if}}

					<li><strong>{{$lang.Invoice}}:</strong> {{$aOrder.sInvoice}}</li>
					<li><strong>{{$lang.Payment_methods}}:</strong> {{$aOrder.sPaymentName}}</li>
					<li><strong>{{$lang.Carrier}}:</strong> {{$aOrder.sCarrierName}}</li>
					{{if !empty( $aOrder.mCarrierInfo )}}<li><strong>{{$lang.Carrier_info}}:</strong> {{$aOrder.mCarrierInfo}}</li>{{/if}}
					<li><strong>{{$lang.CSV_iStatus_Order}}:</strong> {{$aOrder.sStatusName}}</li>
				</ul>
				
				
			</td>
		</tr>
	</tbody>
</table>

</body>
</html>