{~@type=array(@receipt_sales=>'Продажа', @receipt_return=>'Возврат', @receipt_correct_sales=>'Коррекция/Продажа', @receipt_correct_return=>'Коррекция/Возврат', @receipt_writeoff=>'Списание')~}
<div class="content2 receipts_list receipts_search_result">
	<div class="reload">
		<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>
					<check if="{{@receipt.time>0}}">
					<p class="small">Создан {{date('d.m.Y H:i:s', @receipt.time)}}</p>
					</check>
					<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.lines}}">
							<repeat group="{{@receipt.lines}}" 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.lines_sum), 2, '.', '')}}</div>
				</td>
				<td align="right" class="receipts_search_buttons">
					<check if="{{@receipt.user_id!=@authorization_user.id || (@base_settings['cafe_mode']==1 &&  @receipt.table_id==0) || (@base_settings['cafe_mode']==0 &&  @receipt.table_id!=0) || @receipt.ip}}">
			          <true>
		        	<button title="Открыть чек" class="show_window" href="/messages/continue?uri={{urlencode("/receipts/intercept?not_ajax=1&id=".@receipt.id.(@receipt.ip?'-'.@receipt.ip:''))}}">
						<i class="fas fa-receipt"></i>
						<br>
						<div class="small">Открыть чек</div>
					</button>
			          </true>
			          <false>
			        <a href="/receipts/switch?id={{@receipt.id}}{{@base_settings.cafe_mode>0?'&table_id='.@receipt.table_id:''}}">
			        	<button title="Открыть чек">
							<i class="fas fa-receipt"></i>
							<br>
							<div class="small">Открыть чек</div>
						</button>
			    	</a>
			          </false>
			        </check>
				</td>
			</tr>
			</repeat>
		</table>
	</div>
</div>