<h1>{{@page_data['title']}}</h1>
<p align="center"><b>{{@products['products'][0]['title']}}</b></p>
<form name="receipts_chpok_end_form" method="POST" action="/receipts/chpok">
	<input type="hidden" name="product_id" value="{{@products['products'][0]['id']}}">
	<p align="center">
	<table width="100%">
		<tr style="{{@products['products'][0]['egais']==2?'display: none;':''}}">
			<td align="center">
				<p><b>Отсканируйте марку</b></p>
				<i class="fas icon fa-qrcode"></i>
			</td>
			<td align="right">
				<input type="text" name="code" class="marking_input" pattern=".{11,}"  placeholder="Марка товара (минимум 11 символов)" autocomplete="off" {{@products['products'][0]['egais']==1?'required="true"':'' }} value="{{@mark}}">

				<check if="{{@base_settings.virtual_keyboard==1}}">
				<div class="virtual_keyboard virtual_keyboard_marking_input full_keyboard virtual_keyboard_hide">
					{~@keys='1234567890-+|QWERTYUIOP_|ASDFGHJKL@|ZXCVBNM'~}
					<div class="eng hide">
					<loop from="{{@i=0}}" to="{{@i<mb_strlen(@keys)}}" step="{{@i++}}">
						<check if="{{@keys[@i]=='|'}}">
							<true>
						<br>
							</true>
							<false>
						<input type="button" class="virtual_key" value="{{@keys[@i]}}" for='marking_input'>
							</false>
						</check>
					</loop>
						<button type="button" class="virtual_key_bks" for='marking_input'>
							<i class="fas fa-long-arrow-alt-left"></i>
						</button>
						<input type="button" class="virtual_key_delete" for='marking_input' value="CE">
						<br>
						<input type="button" class="virtual_key_ru" value="RU">
						<input type="button" class="virtual_key virtual_key_space" for='marking_input' value=" ">
						<input type="button" class="virtual_key" for='marking_input' value=",">
						<input type="button" class="virtual_key" for='marking_input' value=".">
						<input tabindex="3" type="button" class="virtual_key virtual_key_ok" value="OK">
					</div>
					{~@keys='1234567890-+|ЙЦУКЕНГШЩЗХЪ|ФЫВАПРОЛДЖЭ_|ЯЧСМИТЬБЮ'~}
					<div class="ru">
					<loop from="{{@i=0}}" to="{{@i<mb_strlen(@keys)}}" step="{{@i++}}">
						{~@a=mb_substr(@keys, @i, 1)~}
						<check if="{{@a=='|'}}">
							<true>
						<br>
							</true>
							<false>
						<input type="button" class="virtual_key" value="{{@a}}" for='marking_input'>
							</false>
						</check>
					</loop>
						<button type="button" class="virtual_key_bks" for='marking_input'>
							<i class="fas fa-long-arrow-alt-left"></i>
						</button>
						<input type="button" class="virtual_key_delete" for='marking_input' value="CE">
						<br>
						<input type="button" class="virtual_key_eng" value="ENG">
						<input type="button" class="virtual_key virtual_key_space" for='marking_input' value=" ">
						<input type="button" class="virtual_key" for='marking_input' value="@">
						<input type="button" class="virtual_key" for='marking_input' value=",">
						<input type="button" class="virtual_key" for='marking_input' value=".">
						<input tabindex="3" type="button" class="virtual_key virtual_key_ok" value="OK">
					</div>
				</div>
				</check>

			</td>
		</tr>
		<tr style="{{@products['products'][0]['barcodes'][0]['barcode']?'display: none;':''}}">
			<td align="center">
				<i class="fas icon fa-barcode"></i>
			</td>
			<td align="right">
				<input type="text" name="barcode" value="{{@products['products'][0]['barcodes'][0]['barcode']}}" placeholder="Штрих-код или наименование" autocomplete="off" required="true" pattern="[0-9]{8}|[0-9]{13}">
			</td>
		</tr>
		<tr style="{{@products['products'][0]['price']>0?'display: none;':''}}">
			<td align="center">
				<i class="fas icon fa-ruble-sign"></i>
			</td>
			<td align="right">
				<input type="text" name="price" placeholder="Цена товара" value="{{(float)@products['products'][0]['price']>0?@products['products'][0]['price']:''}}" autocomplete="off" {{(float)@products['products'][0]['price']<=0?'required="true"':''}}>
			</td>
		</tr>
		<tr>
			<td align="center" colspan="2">
				<button type="submit" title="Вскрыть">
					<i class="fas fa-glass-cheers"></i>
					Вскрыть
				</button>
			</td>
		</tr>
	</table>
	<check if="{{@bottles}}">
	<p align="center">
		<b>Или выберите бутылку</b>
	</p>
	<div class="select_open_bottle_div">
	<repeat group="{{@bottles}}" value="{{@bottle}}">
		<div align="center" class="select_open_bottle_product">
			<button type="button" class="select_open_bottle {{isset(@add_marks) && in_array(@bottle['mark'], @add_marks)?'hide':''}}" data-mark="{{@bottle['mark']}}">
				<i class="fas fa-qrcode left"></i>
				{{$bottle['serial']}} {{$bottle['number']}}<br>
				<small>{{@bottle['current_volume']}} / {{@bottle['capacity']*1000}}мл</small>
			</button>

		</div>
	</repeat>
	</div>
	</check>
</form>
<script type="text/javascript">
$('form[name="receipts_chpok_end_form"] input[name="code"]').focus();
</script>
<check if="{{isset(@mark) && @mark!=''}}">
<script type="text/javascript">
$('form[name="receipts_chpok_end_form"] input[name="code"]').submit();
</script>
</check>
<script>
window_open_alarm();
</script>