<div class="content2">
<h1>{{@base_settings['cafe_mode']>0?'Модификаторы':'Сопутствующие товары'}} для "{{@line.product_title}}"</h1>
<form name="add_free_modfiers" action="/receipts/add_line" method="GET">
	<input type="hidden" name="product_id" value="{{0}}">
	<input type="hidden" name="parent_id" value="{{@line.id}}">
	<input type="hidden" name="count" value="1">
	<input type="hidden" name="price" value="0">
	Комментарий
	<input type="text" name="free_title" required="true" class="free_title" autocomplete="off">
	<input type="submit" value="Добавить">
	<check if="{{@base_settings.virtual_keyboard}}">
	<div class="virtual_keyboard virtual_keyboard_hide virtual_keyboard_free_title full_keyboard">
		{~@keys='1234567890-+|QWERTYUIOP_|ASDFGHJKL@|ZXCVBNM'~}
		<div class="eng">
			<loop from="{{@i=0}}" to="{{@i<mb_strlen(@keys)}}" step="{{@i++}}">
				<check if="{{@keys[@i]=='|'}}">
					<true>
			<br>
					</true>
					<false>
			<input tabindex="3" type="button" class="virtual_key" value="{{@keys[@i]}}" for="free_title">
					</false>
				</check>
			</loop>
			<button type="button" class="virtual_key_bks" for='free_title'>
				<i class="fas fa-long-arrow-alt-left"></i>
			</button>
			<input tabindex="3" type="button" class="virtual_key_delete" for='free_title' value="CE">
			<br>
			<input tabindex="3" type="button" class="virtual_key_ru" value="RU">
			<input tabindex="3" type="button" class="virtual_key virtual_key_space" for='free_title' value=" ">
			<input tabindex="3" type="button" class="virtual_key" for='free_title' value=",">
			<input tabindex="3" type="button" class="virtual_key" for='free_title' 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 tabindex="3" type="button" class="virtual_key" value="{{@a}}" for="free_title">
					</false>
				</check>
			</loop>
			<button type="button" class="virtual_key_bks" for='free_title'>
				<i class="fas fa-long-arrow-alt-left"></i>
			</button>
			<input tabindex="3" type="button" class="virtual_key_delete" for='free_title' value="CE">
			<br>
			<input tabindex="3" type="button" class="virtual_key_eng" value="ENG">
			<input tabindex="3" type="button" class="virtual_key virtual_key_space" for='free_title' value=" ">
			<input tabindex="3" type="button" class="virtual_key" for='free_title' value=",">
			<input tabindex="3" type="button" class="virtual_key" for='free_title' value=".">
			<input tabindex="3" type="button" class="virtual_key virtual_key_ok" value="OK">
		</div>
	</div>
	</check>
</form>
<div class="only_hand_close"></div>
<include href="pagination.htm" />
<table class="work_table" id="search_products_table">
	<tr>
		<check if="{{!@base_settings['autonomous'] && in_array('products/img', @authorization_user.module)}}">
		<th width="50" class="order_hide">
			Фото
		</th>
		</check>
		<th>
			Наименование
		</th>
		<th width="150" class="order_hide">
			Категория
		</th>
		<th width="50">
			Цена
		</th>
		<check if="{{!@base_settings['autonomous'] && in_array('products/currentstock', @authorization_user.module)}}">
		<th width="100" class="order_hide">
			На складе
		</th>
		</check>
		<th id="modifiers_count_td">
			Кол-во
		</th>
	</tr>
	<repeat group="{{@products}}" value="{{@product}}">
	<tr class="product_line">
		<check if="{{!@base_settings['autonomous'] && in_array('products/img', @authorization_user.module)}}">
		<td align="center" valign="middle" class="order_hide">
			<check if="{{@product.img && is_array(@product.img)}}">
				<true>
			{~@img=array_shift(@product.img)~}
			<button class="show_window" href="/products/img?img={{@img}}">
				<i class="far fa-file-image"></i>
			</button>
				</true>
				<false>
			<i class="fas fa-times"></i>
				</false>
			</check>
		</td>
		</check>
		<td>
			{{@product.title}}
		</td>
		<td align="center" class="order_hide">
			{{@product.category_title}}
		</td>
		<td align="center">
			{~@price=@product.price+(@product.price*(@product.vat/100))*max(0, @product.vat_type)~}
			{~@price=round(@price, 2)~}
			{{number_format(@price, 2)}}
		</td>
		<check if="{{!@base_settings['autonomous'] && in_array('products/currentstock', @authorization_user.module)}}">
		<td align="center" class="order_hide">
			{{numberformat(@product.stock, 3, '.', '')}}
		</td>
		</check>
		<td align="left">
			<div class="modifiers_count">
				<button type="button" class="count_minus count_button">
					<i class="fas fa-minus"></i>
				</button>
				<input type="text" inputmode="numeric" name="count" class="modifiers_{{@product.id}} modifiers_count_0 {{@modifiers[@product.id]?'modifiers_count_1':''}}" value="{{@modifiers[@product.id]?@modifiers[@product.id]:0}}" step="{{@product.quantity}}" min="0" data-product="{{@product.id}}" data-parent="{{@line.id}}">
				<button type="button" class="count_plus count_button">
					<i class="fas fa-plus"></i>
				</button>
			</div>
		</td>
	</tr>
	</repeat>
</table>
</div>
