{~@type=array(@receipt_sales=>'Продажа', @receipt_return=>'Возврат', @receipt_correct_sales=>'Коррекция/Продажа', @receipt_correct_return=>'Коррекция/Возврат', @receipt_cashin=>'Внесение', @receipt_cashout=>'Изъятие', @receipt_cashin=>'Внесение', @receipt_cashout=>'Изъятие', @receipt_change_open=>'Открытие смены', @receipt_change_close=>'Закрытие смены', @receipt_chpok=>'Вскрытие тары', @receipt_keg_connection=>'Подключение кега', @receipt_writeoff=>'Списание')~}
<table width="100%">
	<tr>
		<td valign="top" class="content2" id="receipts_search_result">
			<include href="pagination.htm" />
			<table class="work_table big_table">
				<tr>
					<th width="100">
						Чек
					</th>
					<th>
						Номенклатура
					</th>
					<th class="receipts_search_buttons" width="50">
					</th>
				</tr>
				<repeat group="{{@receipts}}" value="{{@receipt}}">
				<tr>
					<td align="left">
						<p class="small">№ {{@receipt.id}} Смена {{@receipt.changes}}</p>
						<p class="small">{{date('d.m.Y H:i:s', @receipt.time)}}</p>
						<p class="small">{{@type[@receipt.type]}}</p>
						<check if="{{@base_settings['cafe_mode']>0}}">
						<p class="small">Зал: {{@receipt.room_title}}
							<br>
							Стол: {{@receipt.table_title}}
						</p>
						</check>
						<p class="small">
							{{@receipt.short_name}}
						</p>
					</td>
					<td class="receipt_body_td">
						<div class="receipt_body">
							<check if="{{@receipt.description!=''}}">
							<p class="small">{{@receipt.description}}</p>
							</check>
							<check if="{{@receipt.receiptlines}}">
								<repeat group="{{@receipt.receiptlines}}" value="{{@line}}">
									{~@price=@line.price+(@line.price*(@line.vat/100))*max(0, @line.vat_type)~}
									{~@price=round(@price, 2)~}
									{~if(@line.loyalty==0)@d_sum=round(@price*(@line.discount/100), 2); else @d_sum=0;~}
									{~@price-=@d_sum~}
							<p class="small">{{@line.product_title}} {{numberformat(@line.count, 3, '.', '')}}X{{number_format(@price, 2, '.', '')}}&equiv;{{number_format(@price*@line.count, 2, '.', '')}}</p>
								</repeat>
							</check>
						</div>
						<div class="receipt_body_summ">{{number_format(abs(@receipt.sum), 2, '.', '')}}</div>
					</td>
					<td align="right" class="receipts_search_buttons">
						<check if="{{in_array('receipts/show', @authorization_user.module)}}">
						<button class="show_window" href="/receipts/show?id={{@receipt.id}}" title="Просмотр">
							<i class="fas fa-search"></i>
							<br>
							<div class="small">Просмотр</div>
						</button>
						</check>
						<i class="fas fa-upload {{@receipt.synch==1?'true':'false'}}" title="{{@receipt.synch==1?'Чек загружен в Агорту':'Чек не загружен в Агорту'}}"></i>
					</td>
				</tr>
				</repeat>
			</table>
			<include href="pagination.htm" />
		</td>
		<td id="receipts_search_panel" valign="top">
			<form name="receipts_search_form" class="no_ajax" method="GET" action="/receipts/search">
				<input type="text" name="id" class="receipt_id" value="{{@GET.id}}" autofocus autocomplete="off" placeholder="Номер чека">
				<br>
				<input type="text" name="changes" class="changes_id" value="{{@GET.changes}}" autofocus autocomplete="off" placeholder="Номер смены">
				<br>
				<input type="text" name="barcode" class="barcode" value="{{@GET.barcode}}" autocomplete="off" placeholder="Штрих-код товара">
				<br>
				<input type="text" name="dates" value="{{@GET.dates}}" autocomplete="off" placeholder="Период">
				<br>
				<select name="type">
					<option value="">Все чеки</option>
					<repeat group="{{@type}}" key="{{@type_id}}" value="{{@type_title}}">
					<option value="{{@type_id}}" {{@GET.type==@type_id?'selected="selected"':''}}>{{@type_title}}</option>
					</repeat>
				</select>
				<div class="virtual_keyboard">

					<input type="button" class="virtual_key" value='7' for='receipt_id'>
					<input type="button" class="virtual_key" value='8' for='receipt_id'>
					<input type="button" class="virtual_key" value='9' for='receipt_id'>
					<br>
					<input type="button" class="virtual_key" value='4' for='receipt_id'>
					<input type="button" class="virtual_key" value='5' for='receipt_id'>
					<input type="button" class="virtual_key" value='6' for='receipt_id'>
					<br>
					<input type="button" class="virtual_key" value='1' for='receipt_id'>
					<input type="button" class="virtual_key" value='2' for='receipt_id'>
					<input type="button" class="virtual_key" value='3' for='receipt_id'>
					<br>
					<input type="button" class="virtual_key virtual_key_delete" for='receipt_id' value="CE">
					<input type="button" class="virtual_key" value='0' for='receipt_id'>
					<button type="button" class="virtual_key_bks" for='receipt_id'>
						<i class="fas fa-long-arrow-alt-left"></i>
					</button>
					<br>
					<button type="submit">
						<i class="fas fa-search"></i>
					</button>
				</div>
			</form>
		</td>
	</tr>
</table>
<script type="text/javascript" src="/ui/scripts/moment.min.js"></script>
<script type="text/javascript" src="/ui/scripts/daterangepicker.min.js"></script>
<link rel="stylesheet" type="text/css" href="/ui/css/daterangepicker.css" />
<script>
calendar($('input[name="dates"]'));
</script>
