<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/WEB-INF/jspf/taglibs.jsp"%>

<h4>${l.l('Остатки на складе')}
	<p:check action="/admin/plugin/sync1c/instance:importFileForm">
		<c:url var="importCsvUrl" value="/admin/plugin/sync1c/instance.do">
			<c:param name="method" value="importFileForm"/>
			<c:param name="storeId" value="${s.id}"/>
		</c:url>
		<button type="button" class="btn-white btn-small ml1" onclick="$$.ajax.loadContent('${importCsvUrl}')">
			<i class="ti-upload"></i> ${l.l('Загрузить CSV')}</button>
	</p:check>
</h4>

<c:choose>
	<c:when test="${not empty frd.balanceList}">
		<table class="data hl">
			<tr>
				<td width="100%">${l.l('Номенклатура')}</td>
				<td class="nowrap">${l.l('Количество')}</td>
				<td class="nowrap">${l.l('Зарезервировано')}</td>
			</tr>
			<c:forEach var="row" items="${frd.balanceList}">
				<tr>
					<td>${row.itemTitle}</td>
					<td class="nowrap">${row.quantity}</td>
					<td class="nowrap">${row.reserved}</td>
				</tr>
			</c:forEach>
		</table>
	</c:when>
	<c:otherwise>
		<p class="inv-empty">${l.l('Склад пуст')}</p>
	</c:otherwise>
</c:choose>
