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

<div class="bgToolBarButtons">
	<div><img src="${pageContext.request.contextPath}/img/left.png" height="32" onclick="showBlock( 'balanceRoot', 'balanceInfo', balanceQuery );"></div>
	<div class="bgMenu">
		<img src="${pageContext.request.contextPath}/img/filter.png" height="32">
		<ul style="left: -25px;">
			<li onclick="showBlock( 'balanceRoot', 'payments', { ...balanceQuery, periodMonth: 6 } ); return false;">за последние 6 месяцев</li>
			<li onclick="showBlock( 'balanceRoot', 'payments', { ...balanceQuery, periodMonth: 12 } ); return false;">за последние 12 месяцев</li>
			<li onclick="showBlock( 'balanceRoot', 'payments', { ...balanceQuery, periodMonth: 36 } ); return false;">за последние 36 месяцев</li>
			<li onclick="showBlock( 'balanceRoot', 'payments', { ...balanceQuery, periodMonth: 0 } ); return false;">за весь период действия договора</li>
		</ul>
	</div>
</div>
<div class="tile">
	<div class="flexRow titleBottomLine" style="align-items: center; margin-bottom: 2rem;"><span class="titleFont3">Платежи</span> <span class="paramColor">[<fmt:formatDate value="${balancePeriod.dateFrom}" dateStyle="SHORT"/> - <fmt:formatDate value="${balancePeriod.dateTo}" dateStyle="SHORT"/>]</span></div>
	<c:forEach var="item" varStatus="status" items="${balancePayments}">
		<div class="flexRow" style="margin: 10px 5px 5px 10px; color: #555;">
			<div>
				<div style="overflow: auto;">
					<span style="float: left; margin-right: 15px;"><fmt:formatDate value="${item.date}" dateStyle="SHORT" /></span>
					<span style="float: left; font-weight: bold;">${balancePaymentTypes[item.typeId].guiTitle}</span>
				</div>
				<div style="margin-top: 5px;" class="paramColor">${item.comment}</div>
			</div>
			<div class="sum3">
			    <jsp:include page="../include/payment_receipt_link.jsp">
                    <jsp:param name="type" value="payment"/>
                    <jsp:param name="id" value="${item.id}"/>
                </jsp:include>

			    <fmt:formatNumber value="${item.sum}" groupingUsed="true" maxFractionDigits="2" minFractionDigits="2" currencyCode="" /><span class="CUR"/>
			</div>
		</div>
		<c:if test="${not status.last}"><div class="line"></div></c:if>
	</c:forEach>
</div>