<div class="container only_hand_close" id="basket">
	<table width="100%" height="100%">
		<tr>
			<td valign="bottom">
				<div class="basket_list" href="{{@URI}}">
					<div class="reload">
						<table width="100%" class="border-bottom">
						<repeat group="{{@products}}" value="{{@p}}">
							<tr class="card_div product_{{@p['product_id']}} product_{{@p['product_id']}}_parent_{{@p['parent_id']}} product_{{@p['product_id']}}_line_{{@p['id']}} {{@p['parent_id']==0?'border-top':''}} {{@p['parent_id']==0 && !isset(@mods[@p['id']])?'border-bottom':''}}">
								<td width="40" valign="middle" align="center" class="border-left">
									<check if="{{@p['parent_id']==0}}">
										<true>
									<div class="images images40 d-flex">
										<check if="{{is_array(@p['img']) && count(@p['img'])>0}}">
											<true>
										<img src="//{{@api_data['domen']}}/upload/{{@api_data['subdomen']}}/40_40/{{@p['img'][0]}}" class="small_img">
											</true>
											<false>
										<div class="no_img"></div>
											</false>
										</check>
									</div>
										</true>
										<false>
											<i class="fas fa-plus"></i>
										</false>
									</check>
								</td>
								<td width="40">
									<check if="{{@p['parent_id']>0}}">
									<div class="images images40 d-flex">
										<check if="{{is_array(@p['img']) && count(@p['img'])>0}}">
											<true>
										<img src="//{{@api_data['domen']}}/upload/{{@api_data['subdomen']}}/40_40/{{@p['img'][0]}}" class="small_img">
											</true>
											<false>
										<div class="no_img"></div>
											</false>
										</check>
									</div>
									</check>
								</td>
								<td valign="middle">
									<check if="{{@p['combo_id']>0}}">
										<true>
									{{@p['description']}}
									<br>
									<a href="/products/detail?id={{@p['product_id']}}" class="show_window text-body small">{{@p['product_title']}}</a>
										</true>
										<false>
									<a href="/products/detail?id={{@p['product_id']}}" class="show_window text-body">{{@p['product_title']}}</a>
										</false>
									</check>
								</td>
								<td valign="middle" width="100">
									{~@price=@p['price0']+(@p['price0']*(@p['vat']/100))*max(0, @p['vat_type'])~}
						            {~@price=round(@price, 2)~}
								  	<big>{{number_format(@price, 2, '.', '')}}</big> руб.
								</td>
								<td valign="middle" width="180" class="border-right">
									<div class="change_count">
					                    <div class="basket_minus btn btn-primary" parent_id="{{@p['parent_id']}}" line_id="{{@p['id']}}">
					                      <i class="fas fa-minus"></i>
					                    </div>
					                    <input type="hidden" name="product_id" value="{{@p['product_id']}}">
					                    <input type="number" name="basket_count" value="{{@p['count']>floor(@p['count'])?str_replace(',', '.', @p['count']):@p['count']}}">
					                    <div class="basket_plus btn btn-primary" parent_id="{{@p['parent_id']}}" line_id="{{@p['id']}}">
					                      <i class="fas fa-plus"></i>
					                    </div>
									</div>
								</td>
							</tr>
						</repeat>
						</table>
					</div>
				</div>
			</td>
			<td width="380">
				<div class="tab_page_select">
					{~@p=@paymentmethods[array_search(0, array_column(@paymentmethods, 'cash'))]~}
					<form name="receipt_pay_form_{{@p.id}}" id="basket_pay_form" class="receipt_pay_form" method="POST" action="/receipts/sales">
						<div id="basket_select_epay" align="center">
							<div class="container">
								<div id="receipts_buttons" href="{{@URI}}">
									<div class="reload">
										<input type="hidden" name="client_sum[{{@p.id}}]" class="client_sum" value="{{number_format(@sum, 2, '.', '')}}">
										<input type="hidden" name="paymentmethod[]" value="{{@p.id}}">
										<input type="hidden" name="type" value="{{@type}}">
										<input type="hidden" name="sales_receipts" class="sales_receipts" value="{{@base_settings['auto_sales_receipts']?1:0}}">
										<input type="hidden" name="client" class="client" value="{{@receipt['client']}}">
										<input type="hidden" name="executor" class="executor" value="">
										<input type="hidden" name="discount" value="{{@receipt['discount']}}">
										<input type="hidden" name="partner_id" value="{{@receipt['partner_id']}}">
										<check if="{{in_array('receipts/hold', @authorization_user.module)}}">
										<input type="hidden" name="hold" class="hold" value="0">
										<input type="hidden" name="nofr" class="nofr" value="0">
										</check>
										<input type="hidden" name="show_message" value="1">
										<check if="{{@receipt['partner_id']}}">
											<true>
										<button class="btn btn-primary send_ajax w-100" type="button" href="/receipts/remove_partner">
											<i class="fa fa-times" aria-hidden="true"></i>
											{{@receipt['partner']['name']}}
										</button>
											</true>
											<false>
										<button class="btn btn-primary show_window w-100" type="button" href="/partners/search">
											Я постоянный клиент
										</button>
										<br><br>
										<button class="btn btn-primary add_client w-100" type="button">
											Получить электронный чек
										</button>
											</false>
										</check>
									</div>
								</div>
								<p align="center"><br><big>Выберите способ оплаты</big></p>
								<repeat group="{{@epays}}" value="{{@e}}">
								<input type="radio" class="custom-checkbox" name="epay" id="epay_{{@e['id']}}" value="{{@e['id']}}">
								<label for="epay_{{@e['id']}}" class="w-100">{{@e['title']}}</label>
								</repeat>
							</div>
						</div>
						<input type="hidden" name="fr_print" class="fr_print" value="{{@base_settings['kiosk_receipt_print']}}">
					</form>
				</div>
			</td>
		</tr>
	</table>
</div>
<script type="text/javascript">
show_basket();
</script>
<div id="client_0" class="hide">
	<div class="popup_area">
		<div class="popup_content">
			<input type="text" class="client_0 w-100" placeholder="E-mail или телефон" autocomplete="off">
			<div class="virtual_keyboard virtual_keyboard_client_0 full_keyboard" align="center">
				{~@keys='1234567890-|QWERTYUIOP_|ASDFGHJKL@+|ZXCVBNM.'~}
				<loop from="{{@i=0}}" to="{{@i<mb_strlen(@keys)}}" step="{{@i++}}">
					<check if="{{@keys[@i]=='|'}}">
						<true>
				<br>
						</true>
						<false>
				<button type="button" class="virtual_key btn btn-light border border-secondary" value="{{@keys[@i]}}" for="client_0">{{@keys[@i]}}</button>
						</false>
					</check>
				</loop>
				<button type="button" class="virtual_key_bks btn btn-light border border-secondary" for='client_0'>
					<i class="fas fa-long-arrow-alt-left"></i>
				</button>
				<button type="button" class="virtual_key_delete btn btn-light border border-secondary" for='client_0' value="CE">CE</button>
				<button type="button" class="virtual_key_ok client_0_close btn btn-primary border border-secondary" value="OK">OK</button>
			</div>
		</div>
	</div>
</div>