<html>
    <head>

        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>GT4</title>
        <style type="text/css">
        </style>
        <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;
            }
        </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();

            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;
        }
    </style>
    <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; }
        .serial {
            background-color: #C8C8C8;
            height: 20px;
            width: 150px;
            padding: 5px;
            margin: 5px;
            border: medium double #000000;
            text-align: center;
        }
        .style1 {
            font-size: 12px
        }
        .page-breakx{
            page-break-after: always;
        }
    </style>
    {/literal}
    <body onLoad="printDiv()">
        <div align="center" id="printdiv" >
            <b>

                {if {$billsettingsData[25]->billsettingsvalue} eq 0}



                {assign var=i value=1}
                {foreach $allstor as $myallstor}


                <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" class="table-black" {if {$i} < {$storitr}} class="page-breakx" {/if}>
                    <tr>
                        <td colspan="2"><div {if {$billsettingsData[15]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} class="serial">{$sellbillData->sellbillid}</div></td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td colspan="2" align="right" class="style1"><img src="../views/default/images/upload/{$Programsettingdata->logo}" alt="" width="134" height="49"><br>
                            {$Programsettingdata->phone}</td>
                    </tr>

                    <tr>

                        <td></td>
                        <td></td>
                        <td colspan="2" align="center" class="style1">
                            <h1  style="float:right; text-align:center">اذن صرف</h1>
                        </td>

                    </tr>
                    <tr>

                        <td width="5%" height="26" align="right">&nbsp;</td>
                        <td width="4%" align="right">&nbsp;</td>
                        <td width="23%" align="right">&nbsp;</td>
                        <td width="23%" align="right">&nbsp;</td>

                        <td width="8%" colspan="2" align="right"><span class="style1 style2">التاريخ :{$sellbillData->sellbillsysdate}</span></td>
                    </tr>


                    <!-----------الدين بعد ------------------->

                    <tr>
                        <td align="right">&nbsp;</td>
                        <td align="right" nowrap>    المخزن : {$myallstor->storeName} </td>
                        <td align="right">&nbsp;</td>


                        <td colspan="2" align="right" {if {$billsettingsData[16]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} > السيد :{$sellbillData->tempclientName}</td>
                    </tr>
                    <tr>
                        <td colspan="6">
                            <table width="100%" border="0" cellpadding="2" cellspacing="7" class="table-black">
                                <tr>


                                    <td align="center" bgcolor="#B4B4B4" class="style4">الكمية</td>
                                    <!--<td align="center" bgcolor="#B4B4B4" class="style4">الوحدة</td>

                                    <td align="center" bgcolor="#B4B4B4" class="style4">الباركود</td>-->
                                    <!--td align="center" bgcolor="#B4B4B4" class="style4">المخزن</td-->
                                    <td width="50%" align="center" bgcolor="#B4B4B4" class="style4">اسم المنتج</td>
                                    <td align="right" bgcolor="#B4B4B4" class="style4">م </td>
                                </tr>

                                {assign var=x value=1}
                                {foreach $sellbilldetailData{$i} as $mysellbilldetailData{$i}}
                                <tr>



                                    <td align="center" class="style2 style1"> {$mysellbilldetailData{$i}->sellbilldetailquantity} </td>
                                    <!--   <td align="center" class="style2 style1">{$mysellbilldetailData{$i}->unitName} </td>

                                       <td align="center" class="style2 style1">{$mysellbilldetailData{$i}->parcode}</td>-->
                                    <!--td align="right" class="style2 style1">{$mysellbilldetailData{$i}->storeName} </td-->
                                    <td align="right" class="style2 style1">{$mysellbilldetailData{$i}->productName}/{$mysellbilldetailData{$i}->productCatName} </td>
                                    <td align="center" class="style2">{$x}
                                    </td>
                                </tr>
                                {capture assign=x}{$x+1}{/capture}
                                {/foreach}
                            </table></td>
                    </tr>
                    <tr>

                        <td colspan="6"><hr /></td>
                    </tr>
                    <tr>
                        <td colspan="2"><table width="100%" border="0" cellpadding="2" cellspacing="7" class="table-black">

                                <tr>
                                    <!-----------الدين بعد ------------------->







                                    <td width="9%" align="center" bgcolor="#B4B4B4" class="style1">عدد الوحدات</td>

                                </tr>
                                <tr>

                                    <!-----------الدين بعد ------------------->








                                    <td align="center" class="style1">
                                        {if {$mysellbilldetailDat{$i}->sellQuantity} <= 0}
                                        {$quantity{$i}}
                                        {else}
                                        {$mysellbilldetailDat{$i}->sellQuantity}
                                        {/if} </td>

                            </table></td>
                    </tr>
                    <tr>
                        <td height="130" colspan="6" align="right" valign="bottom"><span class="style1" style="direction:rtl"><strong>{$Programsettingdata->address}</strong></span></td>
                    </tr>
                    <tr>
                        <td colspan="6"><p><span class="copywrites1">تصميم شركة جي تي فور 01110070882</span></p></td>
                    </tr>
                </table>

                <br><br>
                <div class="page-break"></div>
                {capture assign=i}{$i+1}{/capture}
                {/foreach}




                {else}

                {assign var=i value=1}
                {foreach $allstor as $myallstor}

                <table width="97%" border="0" align="center" cellpadding="0" class="table-black"{if {$i} < {$storitr}} class="page-breakx" {/if}cellspacing="0">
                    <tr>
                        <td width="148" height="115" align="left" valign="middle">&nbsp;</td>
                        <td width="142" colspan="2" align="right" valign="top">
                            <p><strong><img src="../views/default/images/upload/{$Programsettingdata->logo}" alt="" width="122" height="75" /></strong></p> <br>
                            {$Programsettingdata->phone}<br>
                        </td>
                    </tr>

                    <tr><td></td><td>
                            <table align="right" class="table-black">
                                <tr>
                                    <td   colspan="3" align="right" class="style1" dir="rtl">
                                        <h1  style="float:right; text-align:right">اذن صرف</h1>    </td>
                                </tr>



                                <tr {if {$billsettingsData[16]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                    <td align="right">  {$sellbillData->tempclientName}</td>
                                    <td align="right"> / السيد  </td>

                                </tr>

                                <tr>
                                    <td align="right">  {$sellbillData->sellbillsysdate}</td>
                                    <td align="right"> : تاريخ البيان</td>
                                    <td>  </td>

                                </tr>

                                {*if {$Programsettingdata->saveprinting} eq 1*}

                                <!-----------المخزن ------------------->
                                -
                                <tr>
                                    <td align="right">  {$myallstor->storeName}</td>
                                    <td align="right" > : اسم المخزن</td>
                                    <td>  </td>
                                </tr>

                            </table>
                        </td></tr>
                    <tr>


                        <td colspan="3" class="td"align="right">
                            <table width="100%" border="0" cellpadding="0" cellspacing="0" dir="rtl" class="table-black">

                                <tr>
                                    <td align="center" bgcolor="#E8E8E8">م</td>

                                    <!--  <td align="center" bgcolor="#E8E8E8" class="wdt120">الباركود</td>-->

                                    <td align="center" bgcolor="#E8E8E8" c>اسم المنتج</td>
                                    <!--td align="center" bgcolor="#E8E8E8" c>المخزن </td-->



                                    <!--    <td align="center" bgcolor="#E8E8E8"  >الوحدة</td>-->
                                    <td align="center" bgcolor="#E8E8E8">العدد</td>





                                </tr>



                                {foreach $sellbilldetailData{$i} as $mysellbilldetailData}
                                <tr>
                                    <td align="center" >{$mysellbilldetailData@index+1}</td>
                                    <!--td align="center" {if {$billsettingsData[20]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>

                                     {$mysellbilldetailData->parcode}

                                    </td-->


                                    <td align="center">

                                        {$mysellbilldetailData->productName}/ {$mysellbilldetailData->productCatName}

                                    </td>

                                    <!--td align="center">{$mysellbilldetailData->storeName} </td-->


                                    <!--  <td align="center" >

                                        {$mysellbilldetailData->unitName}

                                      </td>-->

                                    <td align="center">

                                        {$mysellbilldetailData->sellbilldetailquantity}

                                    </td>












                                </tr>

                                {/foreach}

                            </table>
                        </td>
                    </tr>


                    <tr>
                        <td height="54" colspan="3" align="right">
                            <table width="50%" border="0" align="left" cellpadding="0" cellspacing="0"  dir="rtl" class="td table-black">


                                <tr>
                                    <td>اجمالي  القطع</td>
                                    <td>
                                        {if {$mysellbilldetailData->sellQuantity} <= 0}
                                        {$quantity{$i}}
                                        {else}
                                        {$mysellbilldetailData->sellQuantity}
                                        {/if}
                                    </td>
                                </tr>








                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" align="right"><p class="NEE"><strong>{$Programsettingdata->address}</strong></p></td>
                    </tr>
                    <tr>
                        <td colspan="3" align="right"><p>&nbsp;</p>

                            <p><span class="copywrites"><span class="copywrites">تصميم شركة جي تي فور 01110070882...</span></span></p></td>
                    </tr>
                </table>


        </div>
        {capture assign=i}{$i+1}{/capture}


        {/foreach}

        {/if}
    </b>
</div>
</body>