<style>
    .div-tb{
        margin-top:10px;
        height:100%;
        font-size:16px;
        color:black;
    }
    .div-tb table{
        width:100%;
    }
    .div-tb table td{
        height:30px;
    }

    .div-tb td img{
        height:100px;
    }

    #print-area .div-tb table tbody td{
        border: 1px solid black;
    }



    #pg-title .tt{
        color:black;
        font-weight:bold;
        font-size:20px;
        padding-right:20px;
    }
    table,tr,td{
        border:1px solid black;
    }
    td{
        position: relative;
    }
    td[class=first]:before{
        content: "";
        position: absolute;
        width: 1px;
        height:185px;
        top:0;
        left:0;
        background-color: black;
        display: block;
        transform: rotate(74.5deg);
        transform-origin: top;
    }
    .check_box{
        width: auto;
        height: auto;
        max-width: 80%;
        max-height: 80%;
    }

</style>

<script type="text/JavaScript" src="/static/js/jquery-print.min.js"></script>
<link rel="stylesheet" href="/static/css/print/inventorytickets.css" media="print">

<script type="text/javascript">
    $(document).ready(function(){

        $('.btn-print').click(function(){
            $("#print-area").print({
        	    globalStyles: false,
        	    mediaPrint: true,
        	    stylesheet: null,
        	    noPrintSelector: ".no-print",
        	    iframe: true,
        	    append: null,
        	    prepend: null,
        	    manuallyCopyFormValues: true,
        	    deferred: $.Deferred(),
        	    timeout: 750,
        	    title: null,
        	    doctype: '<!doctype html>'
	        });
        });
    });
</script>

<ol class="breadcrumb">
    <li>会议活动申报</li>
    <li>品鉴酒核销表</li>
</ol>
<div id='pg-title' style="display:flex;">
    <span class='tt'></span>
    <span class='input-group-btn'>
        <a type="button" class='btn btn-primary btn-print'>
            <span class='glyphicon glyphicon-print' style='padding-right:5px;'>
        </span>打印</a>
    </span>
</div>

<div id='print-area' >


    <div class='div-tb'>
        <p class='tt' style="text-align: center;font-size:22px;font-weight: 600;">品鉴酒核销表</p>

            <table  class="table" style='border-collapse: collapse;text-align: center;'>
                <tbody>
                    <tr >
                        <td colspan="14"><span style="font-size:18px;float:right;padding-right:20px;">No:{{sn}}</span></td>
                    </tr>
                    <tr >
                        <td colspan="4">申请人或（单位）</td>
                        <td colspan="3">{{o.uer.last_name}}</td>
                        <td colspan="4">打印时间</td>
                        <td colspan="3">{{time}}</td>
                    </tr>
                    <tr>
                        <td colspan="4">总案流水号</td>
                        <td colspan="3"></td>
                        <td colspan="4">业务人员</td>
                        <td colspan="3"></td>
                    </tr>
                    <tr>
                        <td colspan="4">申请单流水号</td>
                        <td colspan="3"></td>
                        <td colspan="4">所属战区</td>
                        <td colspan="3">{{division|default_if_none:''}}</td>
                    </tr>
                    <tr>
                        <td colspan="4">用酒类型</td>
                        <td colspan="10" align="left" >    
                            
                            {% for c in cs %}<span>
                                <input type="checkbox" {% ifequal c.id o.category_id %}  checked="checked" {% endifequal %} /> {{c.name}}                                
                            </span>{% endfor %}

                            {% ifequal o.category_id 5 %}
                                <span style="margin-left:40%">品鉴会用酒度数:</span>
                            {% endifequal %}
                        </td>

                    </tr>
                    <tr>
                        <td colspan="4">会议（活动）主题</td>
                        <td colspan="10" align="left" >{{o.subject}}</td>
                    </tr>
                    <tr>
                        <td colspan="4">招待（活动）酒店（餐厅）</td>
                        <td colspan="3"></td>
                        <td colspan="4">用餐日期</td>
                        <td colspan="3"></td>
                    </tr>
                    <tr>
                        <td colspan="4">酒店(餐厅)地址</td>
                        <td colspan="3"></td>
                        <td colspan="4">联系电话</td>
                        <td colspan="3"></td>
                    </tr>
                    <tr>
                        <td colspan="4">招待（邀请）对象</td>
                        <td colspan="10"></td>
                    </tr>
                    <tr>
                        <td colspan="4">归属平台商</td>
                        <td colspan="3">{{parent|default_if_none:''}}</td>
                        <td colspan="4">用餐人数</td>
                        <td colspan="3"></td>
                    </tr>
                    <tr style="height:80px;">
                        <td colspan="4" valign="middle" align="center">备注</td>
                        <td colspan="10" ></td>
                    </tr>
                    <tr >
                        <td colspan="14" >用酒明细（汇总）</td>
                    </tr>
                    <tr>
                        <td colspan="1">序号</td>
                        <td colspan="4">品名</td>
                        <td colspan="1">数量</td>
                        <td colspan="8">备注</td>
                    </tr>
                    {% for s in summary %}<tr>                        
                        <td colspan="1">{{ forloop.counter }}</td>
                        <td colspan="4">{{s.product_name}}</td>
                        <td colspan="1">{{s.qty}}</td>
                        <td colspan="8"></td>
                    </tr>{% endfor %}
                     <tr>
                        <td colspan="1">序号</td>
                        <td colspan="4">品名</td>
                        <td colspan="1">单位</td>
                        <td colspan="2">条码</td>
                        <td colspan="6">扫码地址/时间</td>
                    </tr>
                    {% for p in products %}<tr>                    
                        <td colspan="1">{{ forloop.counter }}</td>
                        <td colspan="4">{{ p.name}}</td>
                        <td colspan="1">瓶</td>
                        <td colspan="2">{{p.label_code}}</td>
                        <td colspan="6">{{p.address}}</td>
                    </tr>{% endfor %}                 
                    
                    <tr rowspan="2">
                        <td colspan="14"><br/><br/></td>
                    </tr>
                </tbody>
            </table>


    </div>

</div>
