<table cellspacing="0" cellpadding="0" border="0">
	<tr>
		<td><img src="themes/Sugar/images/EcmProducts.gif" style="margin-top: 3px; margin-right: 3px;" alt="EcmProducts"
				width="16" border="0" height="16"></td>
		<td>
			<h2>{$MOD.LBL_LISTNEWSALES_NAME}</h2>
		</td>
	</tr>
</table>
<br />
<form style="display:none;" action="index.php?module=EcmSales&action=ProductSummary" method="post"
	name="SearchFormListNewSales">
	<ul class="tablist" style="width:100%;">
		<li>
			<a class="current" href="#">{$MOD.LBL_SEARCH}</a>
		</li>
	</ul>
	<table style="border-top: 0px none; margin-bottom: 4px;width:100%" class="tabForm" border="0" cellpadding="0"
		cellspacing="0">
		<tr>
			<td width="5%" nowrap="">
				{$MOD.LBL_LISTNEWSALES_DATE_START}:
			</td>
			<td width="30%" nowrap="">
				<input type="text" maxlength="10" size="11" tabindex="" title=""
					value="{if $POST.date_from!=''}{$POST.date_from}{else}{$smarty.now|date_format:"%d.%m.%Y"}{/if}"
					id="date_from" name="date_from" autocomplete="off">
				<img align="absmiddle" border="0" id="date_from_trigger" name="date_from_trigger" alt="Enter Date"
					src="themes/default/images/jscalendar.gif">
				<script type="text/javascript">
					{literal} 
						// musi być tu w pliku js nie chce działać
						Calendar.setup({
							inputField: "date_from",
							daFormat: "%d.%m.%Y",
							button: "date_from_trigger",
							singleClick: true,
							dateStr: "",
							step: 1,
							weekNumbers: false
						});
					{/literal} 
				</script>

				{$MOD.LBL_LISTNEWSALES_DATE_END}:

				<input type="text" maxlength="10" size="11" tabindex="" title=""
					value="{if $POST.date_to!=''}{$POST.date_to}{else}{$smarty.now|date_format:"%d.%m.%Y"}{/if}"
					id="date_to" name="date_to" autocomplete="off">
				<img align="absmiddle" border="0" id="date_to_trigger" name="date_to_trigger" alt="Enter Date"
					src="themes/default/images/jscalendar.gif">
				<script type="text/javascript">
					{literal} 
						// musi być tu w pliku js nie chce działać
						Calendar.setup({
							inputField: "date_to",
							daFormat: "%d.%m.%Y",
							button: "date_to_trigger",
							singleClick: true,
							dateStr: "",
							step: 1,
							weekNumbers: false
						});
					{/literal} 
				</script>
			</td>
			<td width="5%" nowrap="">
				{$MOD.LBL_LISTNEWSALES_ACCOUNT_NAME}:
			</td>
			<td width="5%" nowrap="">
				<input type="text" title="" value="{if $POST.account_name!=''}{$POST.account_name}{/if}" size=""
					id="account_name" tabindex="" name="account_name">
				<input type="hidden" value="{if $POST.account_id!=''}{$POST.account_id}{/if}" id="account_id"
					name="account_id">
				<input type="button"
					onclick="{literal}open_popup(&quot;Accounts&quot;, 600, 400, &quot;&quot;, true, false, {&quot;call_back_function&quot;:&quot;set_return&quot;,&quot;form_name&quot;:&quot;SearchFormListNewSales&quot;,&quot;field_to_name_array&quot;:{&quot;id&quot;:&quot;account_id&quot;,&quot;name&quot;:&quot;account_name&quot;}}, &quot;single&quot;, true);{/literal}"
					value="Wybierz" class="button" accesskey="T" title="Select [Alt+T]" tabindex=""
					name="btn_account_name">
				<button value="Wyczyść" onclick="this.form.account_name.value = ''; this.form.account_id.value = '';"
					class="button lastChild" accesskey="C" title="Wyczyść[Alt+C]" tabindex=""
					name="btn_clr_parent_name_basic" type="button"><img
						src="themes/default/images/id-ff-clear.png?s=bed8cd35065048ceebdc639ebe305e2c&amp;c=1"></button>
			</td>
			<td width="5%" nowrap="">
				{$MOD.LBL_LISTNEWSALES_DOCUMENT_CREATE_DATE_START}:
			</td>
			<td width="30%" nowrap="">
				<input type="text" value="{if $POST.time_from!=''}{$POST.time_from}{/if}" id="time_from"
					name="time_from">
				<img align="absmiddle" border="0" id="time_from_trigger" name="time_from_trigger" alt="Enter Date"
					src="themes/default/images/jscalendar.gif">
				<script type="text/javascript">
					{literal} 
						// musi być tu w pliku js nie chce działać
						Calendar.setup({
							inputField: "time_from",
							daFormat: "%d.%m.%Y",
							button: "time_from_trigger",
							singleClick: true,
							dateStr: "",
							step: 1,
							weekNumbers: false
						});
					{/literal} 
				</script>

				{$MOD.LBL_LISTNEWSALES_DATE_END}:

				<input type="text" value="{if $POST.time_to!=''}{$POST.time_to}{/if}" id="time_to" name="time_to">
				<img align="absmiddle" border="0" id="time_to_trigger" name="time_to_trigger" alt="Enter Date"
					src="themes/default/images/jscalendar.gif">
				<script type="text/javascript">
					{literal} 
						// musi być tu w pliku js nie chce działać
						Calendar.setup({
							inputField: "time_to",
							daFormat: "%d.%m.%Y",
							button: "time_to_trigger",
							singleClick: true,
							dateStr: "",
							step: 1,
							weekNumbers: false
						});
					{/literal} 
				</script>
			<td width="5%" nowrap="">
				{$MOD.LBL_LISTNEWSALES_NOT_ASSIGNED}:
			</td>
			<td width="5%" nowrap="">
				<input type="checkbox" name="wz" value="1" {if $POST.wz=='1'}checked{/if}>
			</td>
		</tr>
		<tr>
			<td width="5%" nowrap="">
				{$MOD.LBL_LISTNEWSALES_ORDER_NO}:
			</td>
			<td width="5%" nowrap="">
				<input type="text" value="{if $POST.parent_order_no!=''}{$POST.parent_order_no}{/if}"
					name="parent_order_no">
			</td>
			<td width="5%" nowrap="">
				{$MOD.LBL_LISTNEWSALES_ORDER_TYPE}:
			</td>
			<td width="30%" nowrap="nowrap" class="dataField"><select id="sale_type" name="sale_type">
					<option selected="" value="all" {if $POST.sale_type=='all'}selected{/if}>Wszystkie</option>
					<option value="sale" {if $POST.sale_type=='sale'}selected{/if}>Zamówienie</option>
					<option value="gratis" {if $POST.sale_type=='gratis'}selected{/if}>Próbki</option>
				</select></td>
		</tr>
	</table>
	<input type="submit" value="{$MOD.LBL_LISTNEWSALES_POST}" name="submit" class="button">
	<input type="button" onclick="location.href='index.php?module=EcmSales&amp;action=ListNewSales';"
		value="{$MOD.LBL_LISTNEWSALES_CLEAR}" name="clear" class="button">
</form>
<form action="index.php?module=EcmSales&action=ProductSummary" method="get" name="SearchFormListNewSales">
	{$MOD.LBL_LISTNEWSALES_GROUP_KS}: <select id="product_group" name="product_group">
		<option selected="" value="all" {if $GET.product_group=='all'}selected{/if}>Wszystkie</option>
		<option value="1" {if $GET.product_group=='1'}selected{/if}>{$MOD.LBL_LISTNEWSALES_GROUP_KS_1}</option>
		<option value="2" {if $GET.product_group=='2'}selected{/if}>{$MOD.LBL_LISTNEWSALES_GROUP_KS_2}</option>
		<option value="3" {if $GET.product_group=='3'}selected{/if}>{$MOD.LBL_LISTNEWSALES_GROUP_KS_3}</option>
	</select>

	<input type="hidden" value="EcmSales" name='module' id='module'>
	<input type="hidden" value="ProductSummary" name='action' id='action'>
	<input type="submit" value="{$MOD.LBL_LISTNEWSALES_POST}" name="submit" class="button">
	<input type="hidden" value="{$IDS}" name='ids' id='ids'>

</form>

<table cellspacing="0" cellpadding="0" style="width:100%;" id="myTable" class="tablesorter">
	<thead>
		<tr>
			<th width="5%"><input type="checkbox" name="selectall" id="selectall"></th>
			<th width="8%">{$MOD.LBL_LISTNEWSALES_PRODUCTCODE}</th>
			<th width="35%">{$MOD.LBL_LISTNEWSALES_PRODUCTNAME}</th>
			<th width="12%">{$MOD.LBL_LISTNEWSALES_CATEGORY}</th>
			<th width="4%">{$MOD.LBL_LISTNEWSALES_GROUP_KS}</th>
			<th width="10%">{$MOD.LBL_LISTNEWSALES_QUANTITY}</th>
			<th width="10%">{$MOD.LBL_LISTNEWSALES_STOCK}</th>
			<th width="15">Adres magazynowy</th>
		</tr>
	</thead>
	<tbody>
		{foreach from=$POSITION_LIST key="key" item="item" name="components"}
			{if $item.id!=''}
				<tr style="vertical-align:top;">
					<td style="text-align:center;"><input type="checkbox" value="{$item.id}" class="make_pdf"
							id="make_pdf_{$item.position}" name="selectedid[]"></td>
					<td>{$item.code}</td>
					<td>{$item.name}</td>
					<td>{$item.product_category_name}</td>
					<td>{$item.group_ks_name}</td>

					{if $item.quantity>$item.stock}
						<td style="text-align: right;color:red;">{$item.quantity|number_format:2:".":","}</td>
						<td style="text-align: right;color:red;">{$item.stock|number_format:2:".":","}</td>
					{else}
						<td style="text-align: right;">{$item.quantity|number_format:2:".":","}</td>
						<td style="text-align: right;">{$item.stock|number_format:2:".":","}</td>
					{/if}
					<td>{$item.stock_addresses}</td>
				</tr>
			{/if}

		{/foreach}
	</tbody>
	<tr>
		<td></td>
		<td></td>
		<td></td>
		<td></td>
		<td><b>{$MOD.LBL_LISTNEWSALES_SUMMARY}:</b></td>
		<td style="text-align: right;"><b>{$POSITION_LIST.quantity|number_format:2:".":","}</b></td>
		<td style="text-align: right;"><b>{$POSITION_LIST.stock|number_format:2:".":","}</b></td>
		<td></td>
	</tr>
</table>
7