{% load humanize %}
<table class="estimate01T" data-final="{{ set.final_couple_id }}">
    <colgroup>
        <col width="10%">
        <col width="20%">
        <col width="15%">
        <col width="15%">
        <col width="40%">
    </colgroup>
    <thead>
        <tr>
            <th>품번</th>
            <th>구분</th>
            <th>TAG가격</th>
            <th data-rate="{{ set.discount_rate }}" data-acc-rate="{{ set.acc_discount_rate }}" data-max="{{ set.max_rate }}">공급가격</th>
            <th>이미지</th>
        </tr>
    </thead>
    <tbody>
        
        {% for main_fabric in set.boy_product_set %}
        {% if main_fabric.product.product_type.name == 'acc' %}
        <tr class="row-acc">
        {% else %}
        <tr>
        {% endif %}
            <td>{{ main_fabric.product.name }}-{{ main_fabric.index }}</td>
            <td>{{ main_fabric.product.product_type.get_name_display }}(남아)</td>
            <td>{{ main_fabric.price|intcomma }}원</td>
            <td></td>
            {% ifchanged %}
            <td rowspan="13" class="modelImg">
                <img data-couple-id="{{ set.couple_id }}" src="{{ set.image.url }}" alt="">
                {% for obj_quantity in set.option_set %}
                <img src="{{ obj_quantity.option.front_image.url }}" alt="">
                {% endfor %}
            </td>
            {% endifchanged %}
        </tr>
        {% endfor %}
        <tr class="total-boy">
            <td>남아 합계</td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
        {% for main_fabric in set.girl_product_set %}
        {% if main_fabric.product.product_type.name == 'acc' %}
        <tr class="row-acc">
        {% else %}
        <tr>
        {% endif %}
            <td>{{ main_fabric.product.name }}-{{ main_fabric.index }}</td>
            <td>{{ main_fabric.product.product_type.get_name_display }}(여아)</td>
            <td>{{ main_fabric.price|intcomma }}원</td>
            <td></td>
        </tr>
        {% endfor %}
        <tr class="total-girl">
            <td>여아 합계</td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
        {% for i in set.loop_range %}
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
        {% endfor %}
        <tr>
            <td>합 계</td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
    </tbody>
</table>