<table class="window">
	<tr>
		<td>
			<div class="frame_center settings_form">
				<h1>{{@page_data.title}}</h1>
				<form name="settings_fr_form" action="/settings/kkm" method="POST">
					<input type="hidden" name="device" value="kkm">
					<table width="100%">
						<tr>
							<td>
								Использовать ККМ
							</td>
							<td>
								<select name="active">
									<option value="0">Нет</option>
									<option value="1" {{@data.active==1?'selected="selected"':""}}>Да</option>
								</select>
							</td>
						</tr>
						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
							<td>
								Тип ККМ
							</td>
							<td>
								<select name="type">
									<option value="1" {{@data.type==1?'selected="selected"':""}}>Фискальный регистратор</option>
									<option value="0" {{@data.type==0?'selected="selected"':""}}>Чекопечатающий принтер</option>
								</select>
							</td>
						</tr>

						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
							<td colspan="2" align="center">
								СНО для ручного выбора при закрытии чека
							</td>
						</tr>
						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
							<td colspan="2">
								<div class="sno_div">
								<repeat group="{{@sno}}" key="{{@value}}" value="{{@title}}">
								<p>
									<label>
										<input type="checkbox" class="classic_checkbox" name="sno_types[]" value="{{@value}}" {{in_array(@value, @data['sno_types'])?'checked="checked"':''}}>
										{{@title}}
									</label>
								</p>
								</repeat>
								</div>
							</td>
						</tr>
						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
							<td colspan="2" align="center">
								ПСР для ручного выбора при закрытии чека
							</td>
						</tr>
						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
							<td colspan="2">
								<div class="sno_div">
								<repeat group="{{@psr}}" key="{{@value}}" value="{{@title}}">
								<p>
									<label>
										<input type="checkbox" class="classic_checkbox" name="psr[]" value="{{@value}}" {{in_array(@value, @data['psr'])?'checked="checked"':''}}>
										{{@title}}
									</label>
								</p>
								</repeat>
								</div>
							</td>
						</tr>

						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
							<td>
								Драйвер ККМ
							</td>
							<td>
								<select name="driver">
									<option value="">Нет</option>
									<repeat group="{{@drivers}}" value="{{@d}}">
									<option value="{{@d['path']}}" {{@data.driver==@d['path']?'selected="selected"':""}} data-url="{{@d['url']}}">{{@d['title']}}</option>
									</repeat>
								</select>
							</td>
						</tr>
						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
							<td colspan="2" align="center">
								<a href="/settings/drivers?path={{@data.driver}}" id="driver_settings" class="show_window {{@data.driver==''?'hide':''}}"><small>(настройка драйвера)</small></a>
							</td>
						</tr>

						<tr class="active kkm_type" {{!@data.active || @data.type==0?'style="display:none;"':''}}>
							<td>
								Версия ФФД
							</td>
							<td>
								<select name="version">
									<option value="1.05" {{@data.version=="1.05"?'selected="selected"':""}}>1.05</option>
									<option value="1.1" {{@data.version=="1.1"?'selected="selected"':""}}>1.1</option>
									<option value="1.2" {{@data.version=="1.2"?'selected="selected"':""}}>1.2</option>
								</select>
							</td>
						</tr>

						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
							<td>
								Адрес ФР
							</td>
							<td>
								<input type="text" name="url" value="{{@data.url}}">
							</td>
						</tr>
						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
							<td colspan="2" align="center">
								Оплата
							</td>
						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
						<repeat group="{{@pays}}" value="{{@p}}">
						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
							<td>
								Номер оплаты "{{@p.title}}"
							</td>
							<td>
								<input type="text" name="pays[{{@p.id}}]" value="{{isset(@data.pays_type[@p.id])?@data.pays_type[@p.id]:abs(@p.cash-1)}}">
							</td>
						</tr>
						</repeat>

						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
							<td colspan="2">
								<p align="center">Верхняя часть чека</p>
								<textarea name="header">{{@data.header}}</textarea>
							</td>
						</tr>
						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
							<td colspan="2">
								<p align="center">Нижняя часть чека</p>
								<textarea name="footer">{{@data.footer}}</textarea>
							</td>
						</tr>
						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
							<td colspan="2" align="center">
								<a class="show_window" href="/settings/manualforprinters"><small>Команды для чекопечатающего оборудования</small></a>
							</td>
						</tr>
						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
							<td>
								Наименование позиции при свободной продажи
							</td>
							<td>
								<input type="text" name="free_title" placeholder="Наименование позиции при свободной продажи" value="{{@data.free_title}}">
							</td>
						</tr>
						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
							<td>
								НДС при свободной продажи
							</td>
							<td>
								<select name="free_vat">
									<option value="-1">Нет</option>
									<option value="0" {{@data.free_vat==0?'selected="selected"':''}}>НДС 0%</option>
									<option value="-20" {{@data.free_vat==-20?'selected="selected"':''}}>Выделить 20%</option>
									<option value="-10" {{@data.free_vat==-10?'selected="selected"':''}}>Выделить 10%</option>
								</select>
							</td>
						</tr>
						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
							<td>
								Кассир по умолчанию
							</td>
							<td>
								<input type="text" name="fix_user" placeholder="ФИО кассира" value="{{@data.fix_user}}">
							</td>
						</tr>
						<tr class="active" {{!@data.active?'style="display:none;"':''}}>
							<td>
								ИНН кассира по умолчанию
							</td>
							<td>
								<input type="text" name="fix_inn" placeholder="ИНН кассира" value="{{@data.fix_inn}}">
							</td>
						</tr>
						<tr>
							<td>
								Автоматическое изъятие денег из кассы при закрытии смены
							</td>
							<td>
								<select name="auto_incassation">
									<option value="0">Нет</option>
									<option value="1" {{@data.auto_incassation==1?'selected="selected"':""}}>Изъятие с фискализацией</option>
									<option value="2" {{@data.auto_incassation==2?'selected="selected"':""}}>Изъятие без фискализации</option>
								</select>
							</td>
						</tr>
						<tr>
							<td>
								Печатать программный отчет при закрытии смены
							</td>
							<td>
								<select name="price_programm_z">
									<option value="0">Нет</option>
									<option value="1" {{@data.price_programm_z==1?'selected="selected"':""}}>Да</option>
								</select>
							</td>
						</tr>
						<tr>
							<td colspan="2" align="center">
								<input type="submit" value="Сохранить">
							</td>
						</tr>
					</table>
				</form>
			</div>
		</td>
	</tr>
</table>
