<html>
    <head>

        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>GT4</title>
        <style type="text/css">
        </style>
    </head>
    <script src="../views/default/assets/js/jquery.js"></script>


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

         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;
        }
    </style>
    {/literal}
    <body onLoad="printDiv()">
        <div id="printdiv">
            <!--start title -->
            <div {if $billsettingsData[69]->billsettingsvalue == 0}{else}  style="display:none"{/if}>
                <h2  style="  text-align:center">{$billnameAddData->name}</h2>
            </div>
            <!-- end title -->
            <table width="{if {$billsettingsData[25]->billsettingsvalue} eq 0}420  {else} 250{/if}" border="0" align="center" cellpadding="0" cellspacing="0" class='table-black'>
                <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"><br>

                                {$Programsettingdata->phone}<br>
                                </td>
                                </tr>



                                <tr {if {$billsettingsData[16]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                    <td dir="rtl">{$buyBillData->suppliername}</td>
                                    <td dir="rtl">اسم المورد : </td>

                                </tr>
                                <tr {if {$billsettingsData[18]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                    <td dir="rtl">{$buyBillData->buybilltotaldeptbefor}</td>
                                    <td dir="rtl">الدين قبل : </td>

                                </tr>
                                <tr  {if {$billsettingsData[15]->billsettingsvalue} eq 0&& $Programsettingdata->clientserial == 1}  {else} style="display:none !important" {/if}>
                                    <td dir="rtl"> {$buyBillData->buybillid}</td>
                                    <td dir="rtl">رقم تسلسل الفاتورة : </td>

                                </tr>
                                <tr  {if {$billsettingsData[61]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                    <td dir="rtl"> {$buyBillData->buybillSerial}</td>
                                    <td dir="rtl">رقم  الفاتورة : </td>

                                </tr>
                                <tr>
                                    <td dir="rtl">{$buyBillData->buybilldate}</td>
                                    <td dir="rtl">تاريخ البيان : </td>

                                </tr>
                                {if {$Programsettingdata->saveprinting} eq 1}
                                <tr>
                                    <td dir="rtl">{$buyBillData->storeName}</td>
                                    <td dir="rtl">اسم المخزن : </td>

                                </tr>
                                {/if}


                                <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">م</td>

                                                <td align="center"{if {$billsettingsData[59]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} class="wdt120">الباركود</td>

                                                <td align="center" c>اسم المنتج</td>

                                                <td  align="center"{if {$billsettingsData[22]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} >ملاحظات</td>

                                                <td align="center" {if {$billsettingsData[53]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} >الوحدة</td>
                                                <td align="center" >العدد</td>
                                                <td align="center"  {if {$Programsettingdata->scunitname} eq '0'}  hidden {/if} >{$Programsettingdata->scunitname}</td>

                                                <td align="center">السعر</td>

                                                <td align="center" {if {$billsettingsData[57]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} >الخصم</td>
                                                <td align="center"> الاجمالى</td>


                                            </tr>



                                            {foreach $buyBillDetails as $detail}
                                            {if $detail->billtype eq 0}
                                            <tr>
                                                <td >{$detail@index+1}</td>
                                                <td {if {$billsettingsData[59]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>

                                                    {$detail->parcode}

                                                </td>


                                                <td>

                                                    {$detail->productName} {if {$billsettingsData[60]->billsettingsvalue} eq 0}/ {$detail->productCatName}{/if}
                                                    {if {$billsettingsData[79]->billsettingsvalue} eq 0}
                                                    {if isset($detail->sizeName) && $detail->sizeName !=""}/{$detail->sizeName}{/if}
                                                    {if isset($detail->colorName) && $detail->colorName !=""}/{$detail->colorName}{/if}
                                                    {/if}
                                                </td>


                                                <td {if {$billsettingsData[22]->billsettingsvalue} eq 0}  {else}  style="display:none !important"  {/if}>

                                                    {$detail->note}

                                                </td>


                                                <td {if {$billsettingsData[53]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>

                                                    {$detail->unitName}

                                                </td>

                                                <td {if {$billSettingsData[64]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>

                                                    {$detail->buybilldetailquantity}

                                                </td>

                                                <td  {if {$Programsettingdata->scunitname} eq '0'}  hidden {/if}>
                                                    {$detail->otherdetailquantity}
                                                </td>
                                                <td>

                                                    {$detail->buybilldetailprice} {$currency}

                                                </td>



                                                <td {if {$billsettingsData[57]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>

                                                    {$detail->discountvalue}

                                                </td>


                                                <td>

                                                    {$detail->buybilldetailtotalprice}

                                                </td>





                                            </tr>
                                            {/if}
                                            {/foreach}

                                        </table>
                                    </td>
                                </tr>
                                <!---------------------------------------------------------------->

                                <tr > <td colspan="3"  align="center"  style="background:#CCCCCC ;"> مردودات المبيعات</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">م</td>
                                                <td align="center"{if {$billsettingsData[59]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} class="wdt120">الباركود </td>

                                                <td align="center" c>اسم المنتج</td>

                                                <td  align="center"{if {$billsettingsData[7]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} >ملاحظات</td>

                                                <td align="center" {if {$billsettingsData[53]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} >الوحدة</td>
                                                <td align="center" {if {$billSettingsData[64]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>العدد</td>
                                                <td align="center"  {if {$Programsettingdata->scunitname} eq '0'}  hidden {/if} >{$Programsettingdata->scunitname}</td>

                                                <td align="center">السعر</td>

                                                <td align="center" {if {$billsettingsData[57]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} >الخصم</td>
                                                <td align="center"> الاجمالى</td>


                                            </tr>



                                            {foreach $buyBillDetails as $detail}
                                            {if $detail->billtype eq 1}
                                            <tr>
                                                <td colspan="2" align="center">{$detail@index+1}</td>
                                                <td {if {$billsettingsData[59]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>

                                                    {$detail->parcode}


                                                </td>


                                                <td>

                                                    {$detail->productName} {if {$billsettingsData[60]->billsettingsvalue} eq 0}/ {$detail->productCatName}{/if}
                                                    {if {$billsettingsData[79]->billsettingsvalue} eq 0}
                                                    {if isset($detail->sizeName) && $detail->sizeName !=""}/{$detail->sizeName}{/if}
                                                    {if isset($detail->colorName) && $detail->colorName !=""}/{$detail->colorName}{/if}
                                                    {/if}
                                                </td>




                                                <td {if {$billsettingsData[53]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>

                                                    {$detail->unitName}

                                                </td>




                                                <td >

                                                    {$detail->buybilldetailquantity}

                                                </td>


                                                <td {if {$Programsettingdata->scunitname} eq '0'}  hidden {/if}>
                                                    {$detail->otherdetailquantity}
                                                </td>
                                                <td>

                                                    {$detail->buybilldetailprice} {$currency}

                                                </td>


                                                <td {if {$billsettingsData[57]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>

                                                    {$detail->discountvalue}

                                                </td>


                                                <td>

                                                    {$detail->buybilldetailtotalprice}

                                                </td>





                                            </tr>
                                            {/if}
                                            {/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">


                                            <tr>
                                            <tr>
                                                <td>اجمالي الفاتوره</td>
                                                <td>{$buyBillData->buybilltotalbill}</td>
                                            </tr {if {$billsettingsData[46]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>

                                            <tr {if {$billsettingsData[58]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                                <td>اجمالي عدد القطع </td>
                                                <td>{$countBillDetails}</td>
                                            </tr>
                                            {if $billsettingsData[0]->billsettingsvalue eq 0}
                                            <tr {if {$billsettingsData[46]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                                <td>عدد القطع المرتجعة</td>
                                                <td>{$countBillDetails_return}</td>
                                            </tr>
                                            {/if}



                                            {if  {$buyBillData->returnbuybilldiscount} > 0}
                                            <tr {if {$billsettingsData[57]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                                <td>نوع الخصم</td>
                                                <td>
                                                    {if {$buyBillData->buybilldiscountrype} eq 0}
                                                    مباشر
                                                    {else}
                                                    بنسبة
                                                    {/if}
                                                </td>
                                            </tr>

                                            <tr {if {$billsettingsData[57]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                                <td>قيمه الخصم</td>
                                                <td>  {$buyBillData->returnbuybilldiscount} </td>
                                            </tr>
                                            {/if}

                                            <!---------------------ضريبه المبيعات----------------->
                                            {if {$billsettingsData[36]->billsettingsvalue} eq "0"}
                                            <tr>
                                                <td>ضريبه القيمة المضافة</td>
                                                <!--<td> {$buyBillData->payedtax}%</td>-->
                                                <td>{$taxvalue}{$currency} ({$buyBillData->payedtax}%)</td>
                                            </tr>
                                            {/if}

                                            <tr {if {$billsettingsData[51]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                                <td>المبلغ بعد الخصم</td>
                                                <td>{$buyBillData->buybillaftertotalbill} {$currency}</td>
                                            </tr>

                                            <tr {if {$billsettingsData[54]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                                <td>المدفوع</td>
                                                <td> {$buyBillData->buybilltotalpayed}{$currency}</td>
                                            </tr>

                                            <tr {if {$billsettingsData[55]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                                <td>المتبقى</td>
                                                <td>{$buyBillData->buybillfinalbill} {$currency}</td>
                                            </tr>
                                            {if {$buyBillData->buybilltotaldeptafter} <> 0}
                                            <tr {if {$billsettingsData[19]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                                <td>إجمالى المديونيه</td>
                                                <td>{$buyBillData->buybilltotaldeptafter}{$currency}</td>
                                            </tr>
                                            {/if}
                                            <tr>
                                                <td colspan="2" valign="bottom">&nbsp;</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>&nbsp;</p>
                                        <p><span class="copywrites"><span class="copywrites">تصميم شركة جي تي فور 01110070882...</span></span></p></td>
                                </tr>
            </table>
        </div>
    </body>