{{function name="countPages" iPages=1 iPageNumber=1 sUrl="" sUrl2=""}}
	{{if $iPageNumber > 1}}
		<a href="{{$sUrl}}{{if $iPageNumber > 2}}&amp;iPage={{$iPageNumber - 1}}{{/if}}{{$sUrl2}}">&laquo;&nbsp;{{$lang.pages_prev}}</a>
	{{/if}}
	{{$iPaginationSpacer = false}}
	{{section name=pages start=1 loop=$iPages+1 step=1}}
		{{if $smarty.section.pages.index != $iPageNumber && (abs($smarty.section.pages.index - $iPageNumber) <= $config.pagination_counter_admin || $smarty.section.pages.index <= $config.pagination_counter_admin || $smarty.section.pages.index >=  + $iPages - $config.pagination_counter_admin + 1)}}
			<a href="{{$sUrl}}{{if $smarty.section.pages.index > 1}}&amp;iPage={{$smarty.section.pages.index}}{{/if}}{{$sUrl2}}">{{$smarty.section.pages.index}}</a>
		{{$iPaginationSpacer = false}}
		{{elseif $smarty.section.pages.index == $iPageNumber}}
			<strong>{{$smarty.section.pages.index}}</strong>
		{{else}}
			{{if $iPaginationSpacer === false}}
			<strong>...</strong>
			{{$iPaginationSpacer = true}}
			{{/if}}
		{{/if}}
	{{/section}}
	{{if $iPageNumber < $iPages}}
		<a href="{{$sUrl}}&amp;iPage={{$iPageNumber + 1}}{{$sUrl2}}">{{$lang.pages_next}}&nbsp;&raquo;</a>
	{{/if}}
{{/function}}

{{function name="selectOptions" aOptions=0 mOption=0}}
	{{foreach from=$aOptions item=sOption}}
		<option value="{{$sOption@key}}" {{if ( is_array( $mOption ) && in_array( $sOption@key, $mOption ) ) || ( $sOption@key == $mOption )}}selected="selected"{{/if}}>{{$sOption}}</option>
	{{/foreach}}
{{/function}}

<h1>{{$lang.Orders}}</h1>

<form action="" method="get" id="orders-search-form" class="filter">
<fieldset style="display: inline-block;">
<input type="hidden" name="p" value="{{$_GET.p}}" />
<input  id="orders-search-phrase" type="text" name="sPhrase" value="{{$_GET.sPhrase}}" class="input" size="50" />
<select name="iStatus"><option value="">{{$lang.All_status}}</option><option value="x" {{if $_GET.iStatus == 'x'}}selected="selected"{{/if}}>{{$lang.Active_statuses}}</option>{{selectOptions aOptions=$aGeneralInfo.aStatuses mOption=$_GET.iStatus}}</select>
{{$lang.From}}: <input type="text" name="sDateFrom" id="date-from" value="{{$_GET.sDateFrom}}" /> {{$lang.To}}: <input type="text" name="sDateTo" id="date-to" value="{{$_GET.sDateTo}}" />
{{$lang.Orders_search_products}} <input type="checkbox" name="iProducts" value="1" {{if $_GET.iProducts}}checked="checked"{{/if}} />
<input type="submit" class="submit" value="{{$lang.search}}" />
</fieldset>
<fieldset style="float: right;">
<button type="submit" class="submit" name="p" value="orders-list-export">Eksportuj</button>
</fieldset>
</form>

{{if count( $aOrders.aList ) > 0}}

<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
	$("form#orders-list").validate();
	$("form#orders-list #orders-status").rules("add", {required: true});
	
	$('a.dpdgen').click(function(e){
		var packagecount = $(this).parent().find('select.dpd-count').val();
		var packagesrc = $(this).parent().find('.dpd-src').val();
		if( packagesrc && packagecount ){
			$(this).prop( 'href', $(this).prop('href') + '&iPackageCount=' + packagecount + '&sSource=' + encodeURIComponent( packagesrc ) );
		} else{
			e.preventDefault();
			alert('{{$lang.DPD_select_package_count}}');
		}
	});
	$('a.dpd_protocol').click(function(e){
		var packagesrc = $(this).parent().find('.dpd-src').val();
		if( packagesrc ){
			$(this).prop( 'href', $(this).prop('href') + '&sSource=' + packagesrc );
		} else{
			e.preventDefault();
			alert('{{$lang.DPD_select_package_count}}');
		}
	});

	$('a.paczkomaty').click(function(e){
		var packagesrc = $(this).parent().find('.paczkomaty-src').val();
		if( packagesrc ){
			$.colorbox({width: '600', height: '200', href: $(this).prop('href') + '&sSource=' + encodeURIComponent( packagesrc ), onComplete: function(){ $('select#packType').trigger('change'); } });
			e.preventDefault();
		} else{
			e.preventDefault();
			alert('{{$lang.Paczkomaty_select_package_count}}');
		}
	});
	$('a.paczkomaty_protocol').click(function(e){
		var packagesrc = $(this).parent().find('.paczkomaty-src').val();
		if( packagesrc ){
			$(this).prop( 'href', $(this).prop('href') + '&sSource=' + packagesrc );
		} else{
			e.preventDefault();
			alert('{{$lang.Paczkomaty_select_package_count}}');
		}
	});

	$('a.dhl').click(function(e){
		var packagecount = $(this).parent().find('select.dhl-count').val();
		var packagesrc = $(this).parent().find('.dhl-src').val();
		if( packagesrc && packagecount ){
			$.colorbox({width: '600', height: '400', href: $(this).prop('href') + '&iPackageCount=' + packagecount + '&sSource=' + encodeURIComponent( packagesrc ), onComplete: function(){ $('select#packType').trigger('change'); } });
			e.preventDefault();
		} else{
			e.preventDefault();
			alert('{{$lang.DHL_select_package_count}}');
		}
	});

	$('a.order-fv').click(function(e){
		var link = $(this);
		e.preventDefault();
		if( $(this).attr('href') != '#' ){
			$.get( $(this).prop('href')+'&ajax=ajax', function( data ){
				if( data == 'ok' ){
					link.attr('href', '#').html('<img src="{{$config.dir_templates}}admin/images/fvat_done.png" alt="{{$lang.Invoice_ready}}" />');
				} else{
					alert( data );
				}
			});
		}
	});
});
//]]>
</script>
<form action="?p={{$_GET.p}}&amp;iStatus={{$_GET.iStatus}}" method="post" id="orders-list" >
<fieldset>
<table class="list" id="orders">
<thead>
<tr class="actions">
<td colspan="3" class="pages">{{if $aOrders.aPagesCountData.iCount > 1}}{{$lang.Pages}}: {{countPages iPages=$aOrders.aPagesCountData.iCount iPageNumber=$aOrders.aPagesCountData.iPageNumber sUrl=$aGeneralInfo.sUrl}}{{/if}}</td>
<td colspan="7" class="save">
	{{if !empty( $config.DHL_Login )}}
		<div style="float: right; line-height: 27px;">
			<a target="_blank" href="?p=orders-dhl_protocol_list"><img src="{{$config.dir_templates}}admin/images/ico/dhl_list.png" title="{{$lang.DHL_protocols_list}}" /></a>
			<a target="_blank" href="?p=orders-dhl_protocol" class="dhl_protocol">{{$lang.DHL_generate_protocol}}</a>{{/if}}
		</div>
	{{if !empty( $config.DPD_Login )}}
		<div style="float: right; line-height: 27px;">
			<a target="_blank" href="?p=orders-dpd_protocol_list"><img src="{{$config.dir_templates}}admin/images/ico/dpd_list.png" title="{{$lang.DPD_protocols_list}}" /></a>
			{{if count( $aGeneralInfo.aStores ) > 1}}
				<select class="dpd-src" style="vertical-align: top; margin-top: 5px;">
					<option value="">?</option>
					{{selectOptions aOptions=$aGeneralInfo.aStores mOption=null}}
				</select>
			{{else}}
				<input class="dpd-src" type="hidden" value="{{array_shift( array_keys( $aGeneralInfo.aStores ) )}}" />
			{{/if}}
			<a target="_blank" href="?p=orders-dpd_protocol" class="dpd_protocol" style="vertical-align: middle;">{{$lang.DPD_generate_protocol}}</a>
		</div>
	{{/if}}
	{{if !empty( $config.enadawca_user )}}<a target="_blank" href="?p=orders-enadawca_protocol" class="pp_protocol">{{$lang.POCZTA_generate_protocol}}</a>{{/if}}
	{{if !empty( $config.paczkomaty_email )}}
		<div style="float: right; line-height: 27px;">
			<a target="_blank" href="?p=orders-paczkomaty_protocol_list"><img src="{{$config.dir_templates}}admin/images/ico/paczkomat_list.png" title="{{$lang.Paczkomat_protocols_list}}" /></a>
			{{if count( $aGeneralInfo.aStores ) > 1}}
				<select class="paczkomaty-src" style="vertical-align: top; margin-top: 5px;">
					<option value="">?</option>
					{{selectOptions aOptions=$aGeneralInfo.aStores mOption=null}}
				</select>
			{{else}}
				<input class="paczkomaty-src" type="hidden" value="{{array_shift( array_keys( $aGeneralInfo.aStores ) )}}" />
			{{/if}}
			<a target="_blank" href="?p=orders-paczkomaty_protocol" class="paczkomaty_protocol">{{$lang.PACZKOMAT_generate_protocol}}</a>
		</div>
	{{/if}}
	<a href="#" onclick="$('.status input').prop('checked', true);return false;">{{$lang.Check_all}}</a>&nbsp;&nbsp;&nbsp;<select id="orders-status" name="iStatus" style="width:200px; text-align:left;"><option>{{$lang.Change_status}}</option>{{selectOptions aOptions=$aGeneralInfo.aStatuses}}</select> <input type="submit" class="submit" name="sOption" value="{{$lang.Save}}" />
</td>
</tr>
<tr class="order">
<th class="id">{{$lang.Id}}</th>
<th class="name">{{$lang.First_and_last_name}}</th>
<th class="email">{{$lang.Email}}</th>
<th class="phone">{{$lang.Telephone}}</th>
<th class="company">{{$lang.Company}}</th>
<th class="date" colspan="2">{{$lang.Date}}</th>
<th class="status">{{$lang.Status}}</th>
<th class="actions" colspan="2">{{$lang.Actions}}</th>
</tr>
<tr class="header">
	<th></th>
	<th colspan="4">{{$lang.Name}}</th>
	<th colspan="2">{{$lang.Price}}</th>
	<th>{{$lang.Quantity}}</th>
	<th colspan="2"><strong>{{$lang.Summary}}</strong></th>
</tr>
</thead>
<tfoot>
<tr class="actions">
<td colspan="5" class="pages">{{if $aOrders.aPagesCountData.iCount > 1}}{{$lang.Pages}}: {{countPages iPages=$aOrders.aPagesCountData.iCount iPageNumber=$aOrders.aPagesCountData.iPageNumber sUrl=$aGeneralInfo.sUrl}}{{/if}}</td>
<td colspan="5" class="save"><input type="submit" class="submit" name="sOption" value="{{$lang.Save}}" /></td>
</tr>
</tfoot>
<tbody>
<tr class="space"><td colspan="7"></td></tr>
{{foreach from=$aOrders.aList item=aOrder}}
<tr class="order {{if preg_match( '/allegro:/i', $aOrder.sComment )}}allegro{{/if}}">
<td class="id">
	{{$aOrder.iOrder}}
	{{if !empty( $aOrder.aVCOrders )}} <img class="tTip" style="vertical-align: middle; display: inline-block;" src="templates/images/ff0000/discount.png"  title="{{$lang.help_orders_vc_prefix}}{{implode( ', ', $aOrder.aVCOrders )}}{{$lang.help_orders_vc_suffix}}" />{{/if}}
	{{if !empty( $aOrder.aVCOrdersOK )}} <img class="tTip" style="vertical-align: middle; display: inline-block;" src="templates/images/008000/discount.png"  title="{{$lang.help_orders_vc_prefix}}{{implode( ', ', $aOrder.aVCOrdersOK )}}{{$lang.help_orders_vc_suffix_ok}}" />{{/if}}
</td>
<td class="name">{{$aOrder.sFirstName}} {{$aOrder.sLastName}}</td>
<td class="email">{{$aOrder.sEmail}}</td>
<td class="phone">{{$aOrder.sPhone}}</td>
<td class="company">{{$aOrder.sCompanyName}}</td>
<td class="date" colspan="2"><label>{{$aOrder.sDate}}</label>
{{if isset( $aOrder.sComment ) || isset( $aOrder.sCommentAdmin )}}&nbsp;{{/if}}
{{if isset( $aOrder.sComment )}}<img class="tTip" src="templates/admin/images/ico/comment-new.png" title="{{$aOrder.sComment}}" />{{/if}}
{{if isset( $aOrder.sComment ) && isset( $aOrder.sCommentAdmin )}}&nbsp;{{/if}}
{{if isset( $aOrder.sCommentAdmin )}}<img class="tTip" src="templates/admin/images/ico/comment.png" title="{{$aOrder.sCommentAdmin}}" />{{/if}}
</td>
{{*<td class="status {{if $aOrder.iStatus==8}}done
				  {{elseif $aOrder.iStatus == 1 && $aOrder.iTime < ( time() - 24 * 3600 * 3 ) }}adminerror
				  {{elseif $aOrder.iStatus == 1}}new
				  {{elseif ($aOrder.iStatus == 3 or $aOrder.iStatus == 4 or $aOrder.iStatus == 5 or $aOrder.iStatus == 6 or $aOrder.iStatus == 17)}}inprogress
				  {{elseif $aOrder.iStatus == 14}}readytosend
				  {{elseif ($aOrder.iStatus == 2 or $aOrder.iStatus == 7)}}send
				  {{elseif $aOrder.iStatus>50}}cancel
				  {{elseif ($aOrder.iStatus == 9 or $aOrder.iStatus == 11)}}change
				  {{elseif $aOrder.iStatus == 10}}back
				  {{elseif $aOrder.iStatus == 13}}law
				  {{elseif $aOrder.iStatus == 12}}usererror
				  {{/if}}">*}}
<td class="status {{if $aOrder.iStatus==8 or $aOrder.iStatus==51 or $aOrder.iStatus==52 or $aOrder.iStatus==53}}done
				  {{elseif $aOrder.iStatus == 1 && $aOrder.iTime < ( time() - 24 * 3600 * 3 ) }}adminerror
				  {{elseif $aOrder.iStatus == 1}}new
				  {{elseif ($aOrder.iStatus == 3 or $aOrder.iStatus == 17 or $aOrder.iStatus == 23)}}waitforpay
				  {{elseif ($aOrder.iStatus == 4 or $aOrder.iStatus == 5 or $aOrder.iStatus == 6 or $aOrder.iStatus == 24)}}inprogress
				  {{elseif ($aOrder.iStatus == 21 )}}readytosendlong
				  {{elseif ($aOrder.iStatus == 14 or $aOrder.iStatus == 7)}}readytosend
				  {{elseif ($aOrder.iStatus == 22)}}inprogresslongtime
				  {{elseif ($aOrder.iStatus == 2 or $aOrder.iStatus == 18 or $aOrder.iStatus == 19 or $aOrder.iStatus == 20)}}send
				  {{elseif ($aOrder.iStatus == 9 or $aOrder.iStatus == 10 or $aOrder.iStatus == 11 or $aOrder.iStatus == 13)}}change
				  {{elseif $aOrder.iStatus == 54 or $aOrder.iStatus == 12}}donedifferent
				  {{elseif $aOrder.iStatus == 15 or $aOrder.iStatus == 16}}waitforuser
				  {{/if}}">
<input type="checkbox" name="aStatus[{{$aOrder.iOrder}}]" value="1" class="checkbox" /><a href="?p={{$aActions.f}}-form&amp;iOrder={{$aOrder.iOrder}}">{{$aOrder.sStatus}}</a></td>
<td class="actions" colspan="2">
{{if $aOrder.sInvoiceId}}
	<img src="{{$config.dir_templates}}admin/images/fvat_done.png" alt="{{$lang.Invoice_ready}}" />
{{else}}
	<a href="?p={{$aActions.f}}-fv_activate&amp;iOrder={{$aOrder.iOrder}}" class="order-fv"><img src="{{$config.dir_templates}}admin/images/fvat_wait.png" alt="{{$lang.Invoice_not_ready}}" /></a>
{{/if}}
{{if $config.oscGT_auth_code}}
<img src="{{$config.dir_templates}}admin/images/ico/gt{{$aOrder.iGTExported}}.png" title="{{$lang['activate_gt_'|cat:$aOrder.iGTExported]}}" alt="{{$lang['activate_gt_'|cat:$aOrder.iGTExported]}}" />
{{/if}}
<a href="?p={{$aActions.f}}-form&amp;iOrder={{$aOrder.iOrder}}" class="order-edit"><img src="{{$config.dir_templates}}admin/images/ico/edit.png" alt="{{$lang.Edit}}" title="{{$lang.Edit}}" /></a>
<a href="?p={{$aActions.f}}-delete&amp;iOrder={{$aOrder.iOrder}}" class="order-delete delete" ><img src="{{$config.dir_templates}}admin/images/ico/delete.png" alt="{{$lang.Delete}}" title="{{$lang.Delete}}"/></a>
<a href="?p={{$aActions.f}}-wz&amp;iOrder={{$aOrder.iOrder}}" target="_blank"  class="order-wz" ><img src="{{$config.dir_templates}}admin/images/ico/form-wz.png" alt="{{$lang.WZ}}" title="{{$lang.W_Z}}"/></a>
{{if $config.flysoft}}
<a href="?p={{$aActions.f}}-flysoft&amp;iOrder={{$aOrder.iOrder}}"><img src="{{$config.dir_templates}}admin/images/ico/flysoft.png" alt="{{$lang.flysoftCSV}}" title="{{$lang.FlySoft}}" /></a>
{{/if}}
{{if $config.ifirma_login &&  $config.ifirma_klucz_faktura}}
	<a href="?p={{$aActions.f}}-ifirma&amp;iOrder={{$aOrder.iOrder}}" class="ifirma"><img src="{{$config.dir_templates}}admin/images/ico/ifirma.png" alt="iFirma" title="iFirma" /></a>
{{/if}}
{{if $aOrder.iCarrierSystem == $config.carrier_dpd_api}}
	{{if !isset( $aOrder.sPackageNumber ) || $aOrder.sPackageNumber[0] != $config.DPD_API_courier_id || strlen( $aOrder.sPackageNumber ) <= 2}}
		<select class="dpd-count"><option value="">?</option>{{for $var=1 to 10}}<option value="{{$var}}">{{$var}}</option>{{/for}}</select>
		{{if count( $aGeneralInfo.aStores ) > 1}}
			<select class="dpd-src">
				<option value="">?</option>
				{{selectOptions aOptions=$aGeneralInfo.aStores mOption=null}}
			</select>
		{{else}}
			<input class="dpd-src" type="hidden" value="{{array_shift( array_keys( $aGeneralInfo.aStores ) )}}" />
		{{/if}}
		{{*<a href="#" target="_blank" class="dpdgen disabled"><img src="{{$config.dir_templates}}admin/images/ico/dpd_api.png" alt="{{$lang.DPD_generate_package}}" title="{{$lang.DPD_generate_package}}" /></a>*}}
		<a href="?p={{$aActions.f}}-dpd&amp;iOrder={{$aOrder.iOrder}}" target="_blank" class="dpdgen disabled"><img src="{{$config.dir_templates}}admin/images/ico/dpd_api.png" alt="{{$lang.DPD_generate_package}}" title="{{$lang.DPD_generate_package}}" /></a>
	{{else}}
		{{$aOrder.mCarrierInfo}}
		<a href="?p={{$aActions.f}}-dpd&amp;iOrder={{$aOrder.iOrder}}" target="_blank"><img src="{{$config.dir_templates}}admin/images/ico/dpd_list.png" alt="{{$lang.DPD_show_package}}" title="{{$lang.DPD_show_package}}" /></a>
	{{/if}}
{{/if}}
{{if $aOrder.iCarrierSystem == $config.carrier_dhl_api}}
	{{if !isset( $aOrder.sPackageNumber ) || $aOrder.sPackageNumber[0] != $config.DHL_API_courier_id || strlen( $aOrder.sPackageNumber ) <= 2}}
		<select class="dhl-count"><option value="">?</option>{{for $var=1 to 10}}<option value="{{$var}}">{{$var}}</option>{{/for}}</select>
		{{if count( $aGeneralInfo.aStores ) > 1}}
			<select class="dhl-src">
				<option value="">?</option>
				{{selectOptions aOptions=$aGeneralInfo.aStores mOption=null}}
			</select>
		{{else}}
			<input class="dhl-src" type="hidden" value="{{array_shift( array_keys( $aGeneralInfo.aStores ) )}}" />
		{{/if}}
		<a href="?p={{$aActions.f}}-dhl&amp;iOrder={{$aOrder.iOrder}}" class="dhl"><img src="{{$config.dir_templates}}admin/images/ico/dhl_api.png" alt="{{$lang.DHL_generate_package}}" title="{{$lang.DHL_generate_package}}" /></a>
	{{else}}
		<a href="?p={{$aActions.f}}-dhl_list&amp;iOrder={{$aOrder.iOrder}}" target="_blank"><img src="{{$config.dir_templates}}admin/images/ico/dhl_list.png" alt="{{$lang.DHL_show_package}}" title="{{$lang.DHL_show_package}}" /></a>
	{{/if}}
{{/if}}
{{if in_array( $aOrder.iCarrierSystem, $config.aCarriersPoczta )}}
	<a href="?p={{$aActions.f}}-enadawca_add&amp;iOrder={{$aOrder.iOrder}}" {{if empty( $aOrder.mCarrierInfo )}}class="poczta"{{/if}}><img src="{{$config.dir_templates}}admin/images/ico/pp_list.png" alt="{{$lang.POCZTA_show_package}}" title="{{$lang.POCZTA_show_package}}" /></a>
{{/if}}
{{if $aOrder.iCarrierSystem == $config.carrier_paczkomaty}}
	{{if !isset( $aOrder.sPackageNumber ) || substr( $aOrder.sPackageNumber, 0, 2 ) != $config.Paczkomaty_courier_id || strlen( $aOrder.sPackageNumber ) <= 3}}
		{{if count( $aGeneralInfo.aStores ) > 1}}
			<select class="paczkomaty-src">
				<option value="">?</option>
				{{selectOptions aOptions=$aGeneralInfo.aStores mOption=null}}
			</select>
		{{else}}
			<input class="paczkomaty-src" type="hidden" value="{{array_shift( array_keys( $aGeneralInfo.aStores ) )}}" />
		{{/if}}
		<a href="?p={{$aActions.f}}-paczkomaty&amp;iOrder={{$aOrder.iOrder}}" class="paczkomaty"><img src="{{$config.dir_templates}}admin/images/ico/paczkomat_api.png" alt="{{$lang.PACZKOMAT_generate_package}}" title="{{$lang.PACZKOMAT_generate_package}}" /></a>
	{{else}}
		<a href="?p={{$aActions.f}}-paczkomaty_list&amp;iOrder={{$aOrder.iOrder}}"><img src="{{$config.dir_templates}}admin/images/ico/paczkomat_list.png" alt="{{$lang.PACZKOMAT_show_package}}" title="{{$lang.PACZKOMAT_show_package}}" /></a>
	{{/if}}
{{/if}}
<a href="index.php?p=send_email-send_order&amp;iOrder={{$aOrder.iOrder}}" class="colorbox"><img src="{{$config.dir_templates}}admin/images/ico/email-send_again.png" alt="{{$lang.send_again}}" title="{{$lang.send_again}}"/></a>
</td>
</tr>
	{{foreach from=$aOrder.aProducts.aProducts item=aProduct}}
		<tr class="product">
			<td></td>
			<td colspan="4">
				{{if !empty( $aProduct.sLinkName )}}
					<a href="{{$aProduct.sLinkName}}" target="_blank">{{$aProduct.sName}}</a>
				{{else}}
					{{$aProduct.sName}}
				{{/if}}
				&nbsp;
				{{if is_array( $aProduct.aStores )}}
					<a href="admin.php?p=products-variants_ajax&iProduct={{$aProduct.iProduct}}" class="colorbox_stores">({{foreach from=$aProduct.aStores item=aStore}}{{if !$aStore@first}}, {{/if}}{{$aStore.sName}}: {{$aStore.iQuantity}}{{/foreach}})</a>
				{{/if}}
				&nbsp;
				{{if !empty( $aProduct.sAdminInfo )}}<img src="templates/admin/images/ico/comment-new.png" title="{{$aProduct.sAdminInfo}}" class="tTip" style="width: 15px; height: 15px;" />{{/if}}
				{{if isset( $aProduct.aDataImage )}}
					<a href="{{$config.dir_files}}{{$aProduct.aDataImage.sFileName}}" class="photo"><img src="{{$config.dir_templates}}admin/images/ico_photo.png" alt="(f)" style="display: inline;" /></a>
				{{else}}
					<img src="{{$config.dir_templates}}admin/images/ico_nophoto.png" alt="(f)" style="display: inline;" />
				{{/if}}
				<a href="admin.php?p=products-form&amp;iProduct={{$aProduct.iProduct}}"><img src="{{$config.dir_templates}}admin/images/ico/edit.png" style="width: 15px; height: 15px;" /></a>
			</td>
			<td class="netto">{{number_format( $aProduct.fPrice / ( 1 + $aProduct.fVat ), 2, '.', '' )}}</td>
			<td class="gross">{{$aProduct.fPrice}}</td>
			<td>{{$aProduct.iQuantity}}</td>
			<td class="netto">{{number_format( $aProduct.fSummary / ( 1 + $aProduct.fVat ), 2, '.', '' )}}</td>
			<td class="gross">{{$aProduct.fSummary}} {{if isset( $aProduct.bDiscount )}}<img class="tTip discount_{{if $aProduct.bDiscount}}true{{else}}false{{/if}}" title="{{if $aProduct.bDiscount}}{{$lang.Discount_affected}}{{else}}{{$lang.Discount_not_affected}}{{/if}}" src="{{$config.dir_templates}}images/discount.png" />{{/if}}</td>
		</tr>
	{{/foreach}}
	<tr class="product summary"><td colspan="8"><span style="font-weight: normal;">{{$lang.Summary}}:</span> {{$aOrder.sPaymentName}}{{if $aOrder.iGift}}<span style="color:red"> + {{$lang.Packing_as_gift}}</span>{{/if}}</td><td colspan="2" class="gross"><strong>{{$aOrder.aProducts.sOrderSummary}}</strong></td></tr>
	{{if $aOrder.fOrderAdvance != '' && $aOrder.fOrderAdvance > 0}}
		<tr class="product advance"><td colspan="8">{{$lang.Advance_order}}</td><td class="advance" colspan="2"><strong>{{$aOrder.fOrderAdvance}}</strong></td></tr>
	{{/if}}
	<tr class="space"><td colspan="10"></td></tr>
{{/foreach}}
</tbody></table></fieldset></form>
{{else}}
	<div class="msg" id="error">
		<img src="{{$config.dir_templates}}admin/images/ico/msg_error.png" class="imgv" alt="" /> {{$lang.Data_not_found}}
	</div>
{{/if}}