<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;
    }
   
    .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;">
            <span style='margin-left:7%;'>品鉴酒核销表</span>
            <span style='float:right;'>{{sn}}</span>
            </p>
           
            <span>申请单位:{{o.agent.name}}</span>
            <span style='margin-left:10%;'>申请人:{{o.user.last_name}}</span>
            <span style='float:right;'>打印时间:{{tm}}</span>

            <table  class="table" style='border-collapse: collapse;text-align: center;'>
                <tbody>                    
                    <tr>
                        <td colspan="1" style='width:16%;'>总案流水号</td>
                        <td colspan="6">{{o.schema_no}}</td>
                        <td colspan="4">业务人员</td>
                        <td colspan="3" style='width:30%;'></td>
                    </tr>
                    <tr>
                        <td colspan="1">申请单流水号</td>
                        <td colspan="6"></td>
                        <td colspan="4">所属战区</td>
                        <td colspan="3">{{o.division.name}}</td>
                    </tr>
                    <tr>
                        <td colspan="1">用酒类型</td>
                        <td colspan="13" align="left" >    
                            
                            {% for c in cs %}<span style='margin-right:5%;'>
                                <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:10%">品鉴会用酒度数:</span>
                            {% endifequal %}
                        </td>

                    </tr>
                    <tr>
                        <td colspan="1">会议（活动）主题</td>
                        <td colspan="13" align="left" >{{o.subject}}</td>
                    </tr>
                    <tr>
                        <td colspan="1">招待（活动）酒店（餐厅）</td>
                        <td colspan="6">{{o.hotel}}</td>
                        <td colspan="4">用餐日期</td>
                        <td colspan="3">{{o.dinner_dt}}</td>
                    </tr>
                    <tr>
                        <td colspan="1">酒店(餐厅)地址</td>
                        <td colspan="6">{{o.dinner_address}}</td>
                        <td colspan="4">联系电话</td>
                        <td colspan="3">{{o.cellphone}}</td>
                    </tr>
                    <tr>
                        <td colspan="1">招待（邀请）对象</td>
                        <td colspan="13">{{o.invitee}}</td>
                    </tr>
                    <tr>
                        <td colspan="1">归属平台商</td>
                        <td colspan="6">{{o.parent.name}}</td>
                        <td colspan="4">用餐人数</td>
                        <td colspan="3">{{o.dinner_headcount}}</td>
                    </tr>
                    <tr style="height:80px;">
                        <td colspan="1" valign="middle" align="center">备注</td>
                        <td colspan="13" ></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="14" >品鉴酒明细（条码）</td>
                    </tr>
                     <tr>
                        <td colspan="1">序号</td>
                        <td colspan="4">品名</td>
                        <td colspan="1">单位</td>
                        <td colspan="3">条码</td>
                        <td colspan="5">扫码地址/时间</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="3">{{p.label_code}}</td>
                        <td colspan="5">{{p.address}}</td>
                    </tr>{% endfor %}                 
                    
                    <tr rowspan="2">
                        <td colspan="14"><br/><br/></td>
                    </tr>
                </tbody>
            </table>


    </div>

</div>
