<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>
    <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
        }
    </style>
    {/literal}
    <body onLoad="printDiv()">
        <div id="printdiv">
            {if {$billsettingsData[25]->billsettingsvalue} eq 0}

            <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" class="table-black">
                <tr>
                    <td colspan="2"><div {if {$billsettingsData[15]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} class="serial">{$buyBillData->buybillid}</div></td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td colspan="2" align="right" class="style1" {if $billsettingsData[72]->billsettingsvalue == 2}style="display:none;"{/if}>
                        {if $billsettingsData[72]->billsettingsvalue == 0 || $userData->branchId == 0 || $userData->branchId == -1}
                        <img src="../views/default/images/upload/{$Programsettingdata->logo}" alt="" width="134" height="49"><br>
                        {$Programsettingdata->phone}
                        {else}
                        <img src="../views/default/images/branch_image/{$branchData->logo}" alt="" width="134" height="49"><br>
                        {$branchData->mobile}
                        {/if}
                    </td>
                </tr>

                <tr {if $billsettingsData[69]->billsettingsvalue == 0}{else}  style="display:none"{/if}>

                    <td></td>
                    <td></td>
                    <td colspan="2" align="center" class="style1">
                        <h1  style="float:right; text-align:center">{$billnameAddData->name}</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="37%" align="right">{$buyBillData->buybilldate}</td>
                    <td width="8%" align="right"><span class="style1 style2">التاريخ</span></td>
                </tr>
                <tr>
                    <td align="right">&nbsp;</td>
                    <td align="right">

                        {if {$billsettingsData[27]->billsettingsvalue} eq 0}
                        {$buyBillData->storeName}
                        {/if}
                    </td>
                    <td align="right">&nbsp;</td>
                    <td align="right"><span class="style1 style2">{if {$billsettingsData[18]->billsettingsvalue} eq 0} دين قبل :{$buyBillData->buybilltotaldeptbefor} {/if}</span></td>
                    <td colspan="2" align="right" {if {$billsettingsData[16]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} >{$buyBillData->suppliername}</td>
                </tr>
                <tr>
                    <td colspan="6"><table width="100%" border="0" cellpadding="2" cellspacing="7">
                            <tr>
                                <td align="center" bgcolor="#B4B4B4" class="style4">الاجمالي</td>
                                <td align="center" bgcolor="#B4B4B4" class="style4"{if {$billsettingsData[23]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>الخصم</td>
                                <td align="center" bgcolor="#B4B4B4" class="style4">السعر</td>
                                <td align="center" bgcolor="#B4B4B4" class="style4" {if {$Programsettingdata->scunitname} eq '0'}  hidden {/if} >{$Programsettingdata->scunitname}</td>

                                <td align="center" bgcolor="#B4B4B4" class="style4">الكمية</td>
                                <td align="center" bgcolor="#B4B4B4" class="style4"{if {$billsettingsData[21]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>الوحدة</td>
                                <td align="center" bgcolor="#B4B4B4" class="style4"{if {$billsettingsData[22]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>الملاحظة</td>
                                <td align="center" bgcolor="#B4B4B4" class="style4" {if {$billsettingsData[20]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>الباركود</td>
                                <td width="50%" align="center" bgcolor="#B4B4B4" class="style4">اسم المنتج</td>
                                <td align="right" bgcolor="#B4B4B4" class="style4">م </td>
                            </tr>
                            {foreach $buyBillDetails as $detail}
                            {if $detail->billtype eq 0}
                            <tr>

                                <td align="center" class="style2 style1">{$detail->buybilldetailtotalprice} </td>
                                <td align="center" class="style2 style1"{if {$billsettingsData[23]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>{$detail->discountvalue} </td>
                                <td align="center" class="style2 style1">{$detail->buybilldetailprice} </td>


                                <td align="center" class="style2 style1"{if {$Programsettingdata->scunitname} eq '0'}  hidden {/if}>
                                    {$detail->otherdetailquantity}
                                </td>

                                <td align="center" class="style2 style1">{$detail->buybilldetailquantity}</td>
                                <td align="center" class="style2 style1"{if {$billsettingsData[21]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>{$detail->unitName}</td>
                                <td align="center" class="style2 style1"{if {$billsettingsData[22]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>{$detail->note}</td>
                                <td align="center" class="style2 style1"{if {$billsettingsData[20]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>{$detail->parcode}</td>
                                <td align="right" class="style2 style1">{$detail->productName}/{$detail->productCatName}
                                    {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 align="center" class="style2">{$detail@index+1}</td>
                            </tr>
                            {/if}
                            {/foreach}
                            <tr>
                                <td colspan="9" align="center" bgcolor="#B4B4B4" class="style2 style1"><strong>المرودات</strong></td>
                            </tr>
                            {foreach $buyBillDetails as $detail}
                            {if $detail->billtype eq 1}
                            <tr>

                                <td align="center" class="style2 style1">{$detail->buybilldetailtotalprice}</td>
                                <td align="center" class="style2 style1"{if {$billsettingsData[23]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>  {$detail->discountvalue}</td>
                                <td align="center" class="style2 style1">{$detail->buybilldetailprice} </td>
                                <td align="center" class="style2 style1"{if {$Programsettingdata->scunitname} eq '0'}  hidden {/if}>
                                    {$detail->otherdetailquantity}
                                </td>
                                <td align="center" class="style2 style1">{$detail->buybilldetailquantity}</td>
                                <td align="center" class="style2 style1"{if {$billsettingsData[21]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>&nbsp;{$detail->unitName} </td>
                                <td align="center" class="style2 style1"{if {$billsettingsData[22]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>&nbsp;{$detail->note}</td>
                                <td align="center" class="style2 style1"{if {$billsettingsData[20]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>&nbsp;{$detail->parcode}</td>
                                <td align="right" class="style2 style1">{$detail->productName}/{$detail->productCatName}
                                    {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 align="center" class="style2">{$detail@index+1}</td>
                            </tr>
                            {/if}
                            {/foreach}

                        </table>




                    </td>
                </tr>
                <tr>
                    <td colspan="6"><hr /></td>
                </tr>
                <tr>
                    <td colspan="2"><table width="100%" border="0" cellpadding="2" cellspacing="7">
                            <tr>
                                <td width="10%" align="center" bgcolor="#B4B4B4" class="style1">الاجمالي</td>
                                <td width="30%" align="center">&nbsp;</td>
                                {if {$billsettingsData[19]->billsettingsvalue} eq 0}
                                <td width="14%" align="center" bgcolor="#B4B4B4" >الدين بعد</td>
                                {/if}
                                <!-----------الباقى ------------------->
                                {if {$billsettingsData[30]->billsettingsvalue} eq 0}
                                <td width="10%" align="center" bgcolor="#B4B4B4">الباقي</td>
                                {/if}
                                <!-----------المدفوع ------------------->
                                {if {$billsettingsData[29]->billsettingsvalue} eq 0}
                                <td width="8%" align="center" bgcolor="#B4B4B4">المدفوع</td>
                                {/if}

                                <!-----------ضريبه المبيعات ------------------->
                                {if {$billsettingsData[36]->billsettingsvalue} eq "0"}
                                <td width="8%" align="center" bgcolor="#B4B4B4">ضريبه القيمة المضافة</td>
                                {/if}

                                <!---------------------الصافي----------------->
                                {if {$billsettingsData[28]->billsettingsvalue} eq 0}
                                <td width="9%" align="center" bgcolor="#B4B4B4">الصافي</td>
                                {/if}
                                {if  {$buyBillData->buybilldiscount} > 0}
                                <td width="8%" align="center" bgcolor="#B4B4B4">قيمة الخصم</td>
                                <td width="8%" align="center" bgcolor="#B4B4B4">نوع الخصم</td>
                                {/if}
                                <td width="4%" align="center" bgcolor="#B4B4B4" class="style1">عدد المرتجع</td>
                                <td width="5%" align="center" bgcolor="#B4B4B4" class="style1">عدد الشراء</td>
                            </tr>
                            <tr>
                                <td align="center" class="style1">{$buyBillData->buybilltotalbill}</td>
                                <td align="center" class="style1">&nbsp;</td>
                                {if {$buyBillData->buybilltotaldeptafter} <> 0}
                                <td align="center" class="style1" {if {$billsettingsData[19]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>{$buyBillData->buybilltotaldeptafter}</td>
                                {/if}

                                <!-----------الباقى ------------------->
                                {if {$billsettingsData[30]->billsettingsvalue} eq 0}
                                <td align="center" class="style1">{$buyBillData->buybillfinalbill}</td>
                                {/if}
                                <!-----------المدفوع ------------------->
                                {if {$billsettingsData[29]->billsettingsvalue} eq 0}
                                <td align="center" class="style1">{$buyBillData->buybilltotalpayed}</td>
                                {/if}
                                <!---------------------الصافي----------------->
                                {if {$billsettingsData[28]->billsettingsvalue} eq 0}
                                <td align="center" class="style1">{$buyBillData->returnbuybillaftertotalbill}</td>
                                {/if}
                                {if {$billsettingsData[36]->billsettingsvalue} eq "0"}
                                <td align="center" class="style1">{$buyBillData->payedtax} </td>
                                {/if}
                                {if  {$buyBillData->returnbuybilldiscount} > 0}
                                <td align="center" class="style1">{$buyBillData->returnbuybilldiscount} </td>
                                <td align="center" class="style1">{if $buyBillData->buybilldiscountrype eq 0}
                                    مباشر
                                    {else}
                                    بنسبة
                                    {/if} </td>
                                {/if}
                                <td align="center" class="style1">{$countBillDetails_return}</td>
                                <td align="center" class="style1">{$countBillDetails}</td>
                            </tr>
                        </table></td>
                </tr>
                <tr {if $billsettingsData[72]->billsettingsvalue == 2}style="display:none;"{/if}>
                    <td height="130" colspan="6" align="right" valign="bottom"><span class="style1" style="direction:rtl"><strong>
                                {if $billsettingsData[72]->billsettingsvalue == 0 || $userData->branchId == 0 || $userData->branchId == -1}
                                {$Programsettingdata->address}
                                {else}
                                {$branchData->branchAddress}
                                {/if}
                            </strong></span></td>
                </tr>
                <tr>
                    <td colspan="6"><p><span class="copywrites"><span class="copywrites">تصميم شركة جي تي فور 01110070882</span></span></p></td>
                </tr>
            </table>




            {else}
            <table  width="97%" border="0" align="center" cellpadding="0" cellspacing="0" class='table-black'>
                <tr>
                    <td width="576" height="115" align="left" valign="middle">&nbsp;</td>
                    <td width="810" colspan="2" align="right" valign="top" {if $billsettingsData[72]->billsettingsvalue == 2}style="display:none;"{/if}><p><strong>
                                {if $billsettingsData[72]->billsettingsvalue == 0||$userData->branchId == 0 || $userData->branchId == -1}
                                <img src="../views/default/images/upload/{$Programsettingdata->logo}" alt="" width="122" height="75"><br>
                                {$Programsettingdata->phone}<br>
                                {else}
                                <img src="../views/default/images/branch_image/{$branchData->logo}" alt="" width="122" height="75"><br>
                                {$branchData->mobile}<br>
                                {/if}
                                </td>
                                </tr>

                                <tr><td></td><td>
                                        <table align="right">
                                            <tr {if $billsettingsData[69]->billsettingsvalue == 0}{else}  style="display:none"{/if}>
                                                <td colspan="2"   align="right" class="style1" dir="rtl">
                                                    <h1  style="float:right; text-align:right">{$billnameAddData->name}</h1>    </td>
                                            </tr>

                                            <tr {if {$billsettingsData[16]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                                <td align="right">{$buyBillData->suppliername}</td>
                                                <td align="right"> : اسم المورد </td>
                                            </tr>
                                            <tr {if {$billsettingsData[18]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                                <td align="right">{$buyBillData->buybilltotaldeptbefor}</td>
                                                <td align="right"> : الدين قبل </td>
                                            </tr>
                                            <tr  >
                                                <td align="right"> {$buyBillData->buybillid}</td>
                                                <td align="right"> : رقم الفاتورة</td>
                                            </tr>
                                            <tr  {if {$billsettingsData[15]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                                <td align="right"> {$buyBillData->buybillSerial}</td>
                                                <td align="right"> : رقم عمليه السداد</td>
                                            </tr>
                                            <tr>
                                                <td align="right">{$buyBillData->buybilldate}</td>
                                                <td  align="right" > : تاريخ البيان</td>
                                            </tr>
                                            {if {$billsettingsData[27]->billsettingsvalue} eq 0}
                                            <tr>
                                                <td align="right" >{$buyBillData->storeName}</td>
                                                <td  align="right" > : اسم المخزن</td>
                                            </tr>
                                            {/if}
                                        </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">م</td>

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

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

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

                                                <td align="center" {if {$billsettingsData[21]->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[23]->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[20]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>

                                                    {$detail->parcode}

                                                </td>


                                                <td>

                                                    {$detail->productName} / {$detail->productCatName}
                                                    {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[21]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>

                                                    {$detail->unitName}

                                                </td>

                                                <td>

                                                    {$detail->buybilldetailquantity}

                                                </td>
                                                <td align="center" class="style2 style1" {if {$Programsettingdata->scunitname} eq '0'}  hidden {/if}>
                                                    {$detail->otherdetailquantity}
                                                </td>


                                                <td>

                                                    {$detail->buybilldetailprice} {$currency}

                                                </td>



                                                <td {if {$billsettingsData[23]->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[4]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} class="wdt120">الباركود </td>

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

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

                                                <td align="center" {if {$billsettingsData[10]->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[8]->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>{$detail@index+1}</td>
                                                <td {if {$billsettingsData[4]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>

                                                    {$detail->parcode}


                                                </td>


                                                <td>

                                                    {$detail->productName} / {$detail->productCatName}
                                                    {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[7]->billsettingsvalue} eq 0}  {else}  style="display:none !important"  {/if}>

                                                    {$detail->note}

                                                </td>


                                                <td {if {$billsettingsData[10]->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[8]->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>
                                                <td>اجمالي الفاتوره</td>
                                                <td>{$buyBillData->buybilltotalbill}</td>
                                            </tr>

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

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

                                            <!---------------------الصافى  ----------------->
                                            {if {$billsettingsData[29]->billsettingsvalue} eq 0}
                                            <tr>
                                                <td>الصافى</td>
                                                <td> {$buyBillData->returnbuybillaftertotalbill}{$currency}</td>
                                            </tr>
                                            {/if}

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

                                            <!---------------------المدفوع----------------->
                                            {if {$billsettingsData[29]->billsettingsvalue} eq 0}
                                            <tr>
                                                <td>المدفوع</td>
                                                <td> {$buyBillData->buybilltotalpayed}{$currency}</td>
                                            </tr>
                                            {/if}


                                            <!-----------الباقى ------------------->
                                            {if {$billsettingsData[30]->billsettingsvalue} eq 0}
                                            <tr>
                                                <td>المتبقى</td>
                                                <td>{$buyBillData->buybillfinalbill} {$currency}</td>
                                            </tr>
                                            {/if}


                                            {if {$billsettingsData[19]->billsettingsvalue} eq 0}
                                            <tr >
                                                <td>إجمالى المديونيه</td>
                                                <td>{$buyBillData->buybilltotaldeptafter}{$currency}</td>
                                            </tr>
                                            {/if}
                                            <tr>
                                                <td colspan="2" valign="bottom">&nbsp;</td>
                                            </tr>

                                        </table>
                                    </td>
                                </tr>
                                <tr {if $billsettingsData[72]->billsettingsvalue == 2}style="display:none;"{/if}>
                                    <td colspan="3" align="right"><p class="NEE"><strong>
                                                {if $billsettingsData[72]->billsettingsvalue == 0 || $userData->branchId == 0 || $userData->branchId == -1}
                                                {$Programsettingdata->address}
                                                {else}
                                                {$branchData->branchAddress}
                                                {/if}
                                            </strong></p></td>
                                </tr>
                                <tr>
                                    <td colspan="3" align="right">

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