{% extends 'custom_admin_base.html' %}
{% load staticfiles %}
{% block extrastyle %}
<link rel="stylesheet" href="{% static 'order_contract/css/sales_status.css' %}">
{% endblock extrastyle %}
{% block content %}
{% include 'order_contract/custom_admin/custom_admin_order_sub.html' %}
	<article>
		<h3 class="salestitle">1) 유통별 낙찰현황</h3>
		<p class="salessubtitle">시즌 : </p>
		<table class="salestable first">
			<colgroup>
				<col width="15%">
				<col width="7%">
				<col width="7%">
				<col width="7%">
				<col width="7%">
				<col width="7%">
				<col width="7%">
				<col width="7%">
				<col width="7%">
				<col width="7%">
				<col width="7%">
				<col width="15%">
			</colgroup>
			<tr class="salestableth">
				<td rowspan="3" class="nobackGray">유통</td>
				<td colspan="10" class="doubleBorderBot">완료</td>
				<td class="doubleBorderBot">계약중</td>
			</tr>
			<tr class="salestableth">
				<td colspan="2">동복정복</td>
				<td colspan="2" class="doubleBorder">동복체육복</td>
				<td colspan="2">하복정복</td>
				<td colspan="2" class="doubleBorder">하복체육복</td>
				<td colspan="2">소계</td>
				<td>소계</td>
			</tr>
			<tr>
				<td>원수</td>
				<td>주문수량</td>
				<td>원수</td>
				<td class="doubleBorder">주문수량</td>
				<td>원수</td>
				<td>주문수량</td>
				<td>원수</td>
				<td class="doubleBorder">주문수량</td>
				<td>원수</td>
				<td>주문수량</td>
				<td>원수</td>
			</tr>
			{% for company in company_set %}
			<tr>
				<td>{{ company.name }}</td>
				<td>{{ company.winterformal.kindergarten }}</td>
				<td>{{ company.winterformal.product }}</td>
				<td>{{ company.wintertraining.kindergarten }}</td>
				<td class="doubleBorder">{{ company.wintertraining.product }}</td>
				<td>{{ company.summerformal.kindergarten }}</td>
				<td>{{ company.summerformal.product }}</td>
				<td>{{ company.summertraining.kindergarten }}</td>
				<td class="doubleBorder">{{ company.summertraining.product }}</td>
				<td>{{ company.subtotal_kindergarten }}</td>
				<td>{{ company.subtotal_product }}</td>
				<td>{{ company.under_contract }}</td>
			</tr>
			{% endfor %}
			<tr class="salestotal">
				<td>합계</td>
				<td></td>
				<td></td>
				<td></td>
				<td class="doubleBorder"></td>
				<td></td>
				<td></td>
				<td></td>
				<td class="doubleBorder"></td>
				<td></td>
				<td></td>
				<td></td>
			</tr>
		</table>
		<h3 class="salestitle">2) 상권별 낙찰현황</h3>
		<p class="salessubtitle">시즌 : </p>
		<table class="salestable second">
			<colgroup>
				<col width="15%">
				<col width="7%">
				<col width="7%">
				<col width="7%">
				<col width="7%">
				<col width="7%">
				<col width="7%">
				<col width="7%">
				<col width="7%">
				<col width="7%">
				<col width="7%">
				<col width="15%">
			</colgroup>
			<tr class="salestableth">
				<td rowspan="3"  class="nobackGray">유통</td>
				<td colspan="10" class="doubleBorderBot">완료</td>
				<td class="doubleBorderBot">계약중</td>
			</tr>
			<tr class="salestableth">
				<td colspan="2">동복정복</td>
				<td colspan="2" class="doubleBorder">동복체육복</td>
				<td colspan="2">하복정복</td>
				<td colspan="2" class="doubleBorder">하복체육복</td>
				<td colspan="2">소계</td>
				<td>소계</td>
			</tr>
			<tr>
				<td>원수</td>
				<td>주문수량</td>
				<td>원수</td>
				<td class="doubleBorder">주문수량</td>
				<td>원수</td>
				<td>주문수량</td>
				<td>원수</td>
				<td class="doubleBorder">주문수량</td>
				<td>원수</td>
				<td>주문수량</td>
				<td>원수</td>
			</tr>
			{% for area in area_set %}
			<tr>
				<td>{{ area.name }}</td>
				<td>{{ area.winterformal.kindergarten }}</td>
				<td>{{ area.winterformal.product }}</td>
				<td>{{ area.wintertraining.kindergarten }}</td>
				<td class="doubleBorder">{{ area.wintertraining.product }}</td>
				<td>{{ area.summerformal.kindergarten }}</td>
				<td>{{ area.summerformal.product }}</td>
				<td>{{ area.summertraining.kindergarten }}</td>
				<td class="doubleBorder">{{ area.summertraining.product }}</td>
				<td>{{ area.subtotal_kindergarten }}</td>
				<td>{{ area.subtotal_product }}</td>
				<td>{{ area.under_contract }}</td>
			</tr>
			{% endfor %}
			<tr class="salestotal">
				<td>합계</td>
				<td></td>
				<td></td>
				<td></td>
				<td class="doubleBorder"></td>
				<td></td>
				<td></td>
				<td></td>
				<td class="doubleBorder"></td>
				<td></td>
				<td></td>
				<td></td>
			</tr>
		</table>
		<h3 class="salestitle">3) 제품별 판매현황</h3>
		<p class="salessubtitle">시즌 : </p>
		<table class="salestable third">
			<caption>[단위: 원/VAT포함가] [기준:공급가격]</caption>
			<colgroup>
				<col width="10%">
				<col width="10%">
				<col width="8%">
				<col width="8%">
				<col width="8%">
				<col width="8%">
				<col width="8%">
				<col width="8%">
				<col width="8%">
				<col width="8%">
				<col width="8%">
				<col width="8%">
			</colgroup>
			<tr class="salestableth">
				<td rowspan="2">품목</td>
				<td rowspan="2">품목명</td>
				<td colspan="10">가격ZONE</td>
			</tr>
			<tr class="salestableth">
				<td>~19,999</td>
				<td>20,000~25,000</td>
				<td>25,001~30,000</td>
				<td>30,001~35,000</td>
				<td>35,001~40,000</td>
				<td>40,001~45,000</td>
				<td>45,001~50,000</td>
				<td>50,001~60,000</td>
				<td>60,001~70,000</td>
				<td>70,001~</td>
			</tr>
			{% for set in product_set.items %}
			{% for child in set.child %}
			<tr>
				{% if forloop.first %}
				<td rowspan="{{ set.child|length }}">{{ set.name }}</td>
				{% endif %}
				<td>{{ child.name }}</td>
				<td>{{ child.price1 }}</td>
				<td>{{ child.price2 }}</td>
				<td>{{ child.price3 }}</td>
				<td>{{ child.price4 }}</td>
				<td>{{ child.price5 }}</td>
				<td>{{ child.price6 }}</td>
				<td>{{ child.price7 }}</td>
				<td>{{ child.price8 }}</td>
				<td>{{ child.price9 }}</td>
				<td>{{ child.price10 }}</td>
			</tr>
			{% endfor %}
			{% endfor %}
		</table>
	</article>
{% endblock content %}
{% block extrascript %}
<script type="text/javascript" src="{% static 'order_contract/js/sales_status.js' %}"></script>
<script type="text/javascript">

	$('table.third tr td').not(".salestableth td").each(function () {
		var num = $(this).attr("rowspan");
		if (num == 2){
			$(this).addClass('doubleBorder3');
		}
	})
	

</script>
{% endblock %}