<div class="content2">
	<h1>{{@page_data.title}}</h1>
	<p align="left">
		<button type="button" class="show_window" href="/messages/continue?uri={{urlencode('/egais/send_replyrests?id='.@GET.id)}}">
			<i class="fas fa-link"></i>
			Создать документ инвентаризации
		</button>
		<a href="{{@base_settings['url_egais']}}/api/db/out/download/{{@GET.id}}">
			<button type="button" class="right">
				<i class="fas fa-save"></i>
				Скачать
			</button>
		</a>
	</p>
	<h2>Остатки на складе на {{date('d.m.Y H:i', strtotime(@rests['RestsDate']))}}</h2>
	<table class="work_table">
		<tr>
			<th>
				Наименование / Алкокод
			</th>
			<th width="70">
				На складе
			</th>
			<th>
				Поставщик
			</th>
			<th>
				Справка 1 / Справка 2
			</th>
			<th width="100">
				
			</th>
		</tr>
		<repeat group="{{@rests['positions']}}" key="{{@key}}" value="{{@position}}">
		<tr>
			<td>
				{{@position['Product']['FullName']}}
				<br>
				<small>{{@position['Product']['AlcCode']}}</small>
			</td>
			<td align="center">
				{{@position['Quantity']}}
			</td>
			<td align="center">
				{{@position['Product']['Producer']['ShortName']}}
				<p>
					<a href="/egais/createttn?{{http_build_query(@position['Product']['Producer'])}}"><small>отправить ТТН контрагенту</small></a>
				</p>
			</td>
			<td align="center">
				{{@position['InformARegId']}}
				<br>
				{{@position['InformBRegId']}}
			</td>
			<td>
				<form action="/egais/restbcode" method="GET">
					<input type="hidden" name="formb" value="{{@position['InformBRegId']}}">
					<button type="submit">Марки</button>
				</form>
			</td>
		</tr>
		</repeat>
	</table>
</div>