<!-- -->
<html dir='rtl'>
    <head>

        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>GT4</title>
        <link href="{$path}/assets/css/bootstrap.min.css" rel="stylesheet" media='all'>

        <style type="text/css">
            .serial {
                background-color: #C8C8C8;
                height: 20px;
                width: 150px;
                padding: 5px;
                margin: 5px;
                border: medium double #000000;
                text-align: center;
            }
            .style1 {
                font-size: 12px
            }
            .hidden{
                display: none;
            }
        </style>
    </head>
    <script src="../views/default/assets/js/jquery.js"></script>


    {literal}
    <script language="javascript" type="text/javascript">
        /*$(document).ready(function() {
         //window.print();
         printDiv();
         });*/
        function printDiv() {
            var divId = document.getElementById('printdiv');
            divId.setAttribute("className", "print_section print");
            divId.setAttribute("class", "print_section print");
            window.print();
            // setTimeout(window.close, 0);
            // window.close();
        }
    </script>
    <style>
        .td td
        {
            border-right-widtd: 1px;
            border-bottom-widtd: 1px;
            border-left-widtd: 0px;
            border-top-style: none;
            border-right-style: dotted;
            border-bottom-style: solid;
            border-left-style: none;
            border-bottom-color: #999;
            font-size: 15px;
            border-right-color: #999;
        }
        .NEE
        {
            font-size: 14px;
        }
        .newdesign
        {
            font-size: 14px;
        }
        .copywrites
        {
            font-size: 11px;
        }
        .style2 {
            font-family: tahoma
        }
        .style4 {font-family: tahoma; font-size: 12px; font-weight: bold; }

    </style>
    {/literal}
    <body onLoad="printDiv()">
<div class="row"id="printdiv" >
    <div class="container">
        
        <form class="form-horizontal" role="form" action="buyBillController.php?do=saveserail" method="post" id="billform">

            <!-- =========================== START BUY BILL SETTINGS ================================== -->
       

            <!-- ==========================  END BUY BILL SETTINGS ============================ -->

            <!-- =========================== START GENERAL INFO PANEL =====================-->
            <div class="row">
                <div class="col-lg-8">
                    <div class="form-group" {if {$billsettingsData[61]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                        <label class="col-lg-4 control-label">رقم  الفاتورة</label>
                        <div class="col-lg-4">
                            {$buybill.buybillSerial}
                        </div>
                    </div>
                    <!-- end of form-group-->

                    <div class="form-group"  {if $billsettingsData[5]->billsettingsvalue eq 0} style="display:block !important;" {else} style="display:none !important;" {/if}>
                        <label class="col-lg-4 control-label">تاريخ الفاتورة</label>
                        <div class="col-lg-4">
                            {$buybill.buybilldate}
                        </div>
                    </div>
                    <!-- end of form-group-->
                </div>
                <!-- end of bill no-->
                <div class="col-lg-4">
                    <div class="form-group mg-bt5">
                        <label class="col-lg-4 control-label">اسم المورد</label>
                        <div class="col-lg-8">
                            <div id="supplierIdDiv">   {$supplier.suppliername}
                                <input type="hidden" name="buybillid" id="buybillid" value="{$buyBillData->buybillid}"/> </div>
                        </div>
                    </div>
                    <!-- end of form-group-->
                    <div class="form-group mg-bt5" >
                        <label class="col-lg-4 control-label">رصيد الدين</label>
                        <div class="col-lg-8">
                            <div id="debt" class="form-control-static"> </div>
                            {$buybill.buybilltotaldeptbefor}</div>
                    </div>
                    <!-- end of form-group-->
                    <hr class="mg-bt5 mg-tp5"/>
                    <div class="form-group mg-bt5"   {if $billsettingsData[2]->billsettingsvalue eq 0} style="display:block !important;" {else} style="display:none !important;" {/if}>
                        <label class="col-lg-4 control-label">المخزن</label>
                        <div class="col-lg-8">
                            {$store.storeName}
                        </div>
                    </div>
                    <!-- end of form-group-->

                    <!-- end of form-group-->
                </div>
                <!-- end of client info-->

            </div>
            <!-- =========================== END GENERAL INFO PANEL ====================== -->
            <input name="countmyusedserial"  value="{$countmyusedserial}" type="hidden" />
            <!-- =========================== START BUY BILL PANEL ======================= -->
            <div class="row">
                <div class="row">
                    <hr/>
                    <div class="col-lg-6">
                        <h4>المشتريات</h4>
                    </div>
                    <div class="col-lg-6">
                    </div>
                </div>
                <!-- end of title row-->
                <div class="table-responsive">
                    <table class="table billtable table-bordered table-black" id="containerpros">
                        <thead>


                          
                             <tr>
                                <th>  اسم المنتج: </th>
                                <th>الوحده</th>
                                <th>الكميه</th>
                                <th>الوزن</th>
                                <th>المنشأ</th>
                                <th>رمز النطام</th>
                                <th>المتبفى </th>
                             </tr>


                        </thead>
                        <tbody>
                            {assign var=x value=1}
                            {foreach $buybilldetails as $detail}
                        
                            <tr>
                                <td>{$detail.productName}</td>
                                <td>{$detail.unitName}</td>
                                <td>{$detail.buybilldetailquantity}
                                    <input id="detailquantity{$detail.buybilldetailid}" type="hidden" value="{$detail.buybilldetailquantity}"></td>
                                <td>{$detail.weight}</td>
                                <td>{$detail.origin}</td>
                                <td>{$detail.hscode}</td>
                                <td id="stayquantity{$detail.buybilldetailid}">{$detail.buybilldetailquantity - $detail.stayquantity}</td>



                            </tr>
                             {if $detail.buybilldetailpls}
                            <tr  >
                                <td colspan="3">العدد</td>
                                <td colspan="2">الصندوق</td>
                                <td colspan="2">ملاخظه</td>
                            </tr>
                            
                             {assign var=x2 value=1}
                             {foreach $detail.buybilldetailpls as $pl}
                            <tr  style="background: #ccc" id="rpl{$pl.id}">
                                
                                <td colspan="3">{$pl.text2}</td>
                                <td colspan="2">{$pl.text1}</td>
                                <td colspan="2">{$pl.text3}</td>
                               
                            </tr>
                            
                            {capture assign=x2}{$x2+1}{/capture}
                            {/foreach}                           
                             {/if}
                                

                            


                        {capture assign=x}{$x+1}{/capture}
                        {/foreach}



                        <input name="itr" type="hidden" value="{$countBillDetails}">
                        </tbody>
                    </table>
                </div>
            </div>
            <!-- end of second row-->
            <!-- =========================== END BUY BILL PANEL ==================== -->





          

            <!-- =========================== END TOTAL VALUESPANEL ====================== -->
        </form>


    </div>
</div>
</body>