
<html>
    <head>

        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>GT4</title>
        <style type="text/css">
        </style>
        <style>
            @media print {
                @page {
                    size: 100mm 200mm landscape; /* landscape */
                    /* you can also specify margins here: */
                    margin: 0mm;
                    margin-right:0mm; /* for compatibility with both A4 and Letter */
                    /* size: 139mm 215mm;
  height: 215mm;
  width: 139mm; */
                }
                #printdiv{
                    margin-top:{$billsettingsData[82]->billsettingsvalue}mm; /* user margin */
                }
                .td td
                {
                    border:1px solid #000;
                    font-size: 14px;
                    text-align: center
                }
                .NEE
                {
                    font-size: 14px;
                }
                .newdesign
                {
                    font-size: 14px;
                }
                .copywrites
                {
                    font-size: 11px;
                }

                @media print{
                    .form-control-static{
                        font-size:17px;
                    }
                }
                table.bill td {
                    border:1px solid #000;
                    text-align: center
                }


            </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:1px solid #000;
                font-size: 14px;
            }
            .NEE
            {
                font-size: 14px;
            }
            .newdesign
            {
                font-size: 14px;
            }
            .copywrites
            {
                font-size: 11px;
            }
        </style>
        <style>
            .td td
            {
                border:1px solid #000;
                font-size: 14px;
                text-align:center
            }
            .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: 14px
            }

            table td{font-size:14px}
            .form-control-static{font-size:17px}
            table.bill td{border:1px solid #000}
            strong{
                font-size: 14px
            }

            .hidden{
                display: none;
            }
        </style>

        {/literal}
        <body onLoad="printDiv()">
            <div id="printdiv"  >
                {if {$billsettingsData[25]->billsettingsvalue} eq 0}
                {literal}
                <style>
                    .a4 .s1{background:#CCC;}
                    .a4 .s2{background:#EEE;}
                    .a4 table{text-align:center;}
                    .a4 td,.a4 th{padding:2px;}
                    .a4 td,.a4 th,.a4 tr{border:1px solid #333;}
                    .a4{ position:relative;}
                    .a4 .footer{}
                </style>


                {/literal}
                <div class="a4">

                    <table width="100%" class="table-black">
                        <tr {if $billsettingsData[72]->billsettingsvalue == 2}style="display:none;"{/if}>
                            <th scope="row" colspan="3" class="s1"><strong> بطاقة ضريبية : {$Programsettingdata->taxcard}</strong></th>
                            <td rowspan="2" colspan="2" align="center"><strong {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=""  style=" width: 150px; height: 57px;">
                                    {else}
                                    <img src="../views/default/images/branch_image/{$branchData->logo}" alt=""  style=" width: 150px; height: 57px;">
                                    {/if}
                                </strong></td>
                            <td class="s1"  colspan="3" style="direction: rtl"><strong style="font-size: 25px">{$Programsettingdata->companyname}</strong></td>
                        </tr>
                        <tr {if $billsettingsData[72]->billsettingsvalue == 2}style="display:none;"{/if}>
                            <th scope="row" colspan="3" class="s1"><strong>سجل تجارى : {$Programsettingdata->commercialregistration}</strong></th>
                            <td class="s1" colspan="3"><strong>{$Programsettingdata->specializtion}</strong></td>
                        </tr>

                        <tr>
                            <th colspan="2" class="s2" scope="row"><strong>{$returnsellbillData->returnsellbillid} </strong></th>
                            <td colspan="2" class="s1"><strong>تسلسل الفاتورة رقم </strong></td>


                            <td colspan="2"colspan="2" class="s1"><strong>{$returnsellbillData->returnsellbilldate}</td>
                            <td colspan="2" colspan="2" class="s2"><strong> التاريخ</strong></th>
                        </tr>
                        <tr>
                            <th colspan="2" scope="row" class="s2"><strong>{$clientdata->clientphone}</strong></th>
                            <td colspan="2" class="s1"><strong>تليفون العميل</strong></td>
                            <td colspan="2" class="s2"><strong>{$returnsellbillData->tempclientName}</strong></td>
                            <td colspan="2" class="s1"><strong>اسم العميل</strong></td>
                        </tr>
                        <tr {if $billsettingsData[35]->billsettingsvalue == 1} style="display:none"{/if}>
                            <th width="12.5%" class="s2" scope="row"><strong>{$returnsellbillData->carmotor}</strong></th>
                            <td width="12.5%" class="s1"><strong>موتور</strong></td>
                            <td width="12.5%" class="s2"><strong>{$returnsellbillData->carchase}</strong></td>
                            <td width="12.5%" class="s1"><strong>شاسيه</strong></td>
                            <td width="12.5%" class="s2"><strong>{$returnsellbillData->cartype}</strong></td>
                            <td width="12.5%" class="s1"><strong>نوعها</strong></td>
                            <td width="12.5%" class="s2"><strong>{$returnsellbillData->carnumber}</strong></td>
                            <td width="12.5%" class="s1"><strong>رقم السيارة </strong></td>
                        </tr>

                    </table>
                    <table width="100%" border="1" >
                        <tr>
                            <td colspan="9" align="center" bgcolor="#B4B4B4" class="style2 style1"><strong>المردودات</strong></td>
                        </tr>
                        <tr>
                            <td align="center" bgcolor="#B4B4B4" class="style4 {if $Usergroupdata->hideBillPrices == 1}hidden{/if}">الاجمالي</td>
                            <td align="center" bgcolor="#B4B4B4" class="style4 {if $Usergroupdata->hideBillPrices == 1}hidden{/if}"{if {$billsettingsData[23]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if} >الخصم</td>
                            <td align="center" bgcolor="#B4B4B4" class="style4 {if $Usergroupdata->hideBillPrices == 1}hidden{/if}">السعر</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[59]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>الباركود</td>
                            <td width="50%" align="center" bgcolor="#B4B4B4" class="style4">اسم المنتج</td>
                            <td align="right" bgcolor="#B4B4B4" class="style4">م </td>
                        </tr>
                        {foreach $returnsellbilldetailData as $myreturnsellbilldetailData}
                        <tr>
                            <td align="center" class="style2 style1 {if $Usergroupdata->hideBillPrices == 1}hidden{/if}">{$myreturnsellbilldetailData->returnsellbilldetailtotalprice} </td>
                            <td align="center" class="style2 style1 {if $Usergroupdata->hideBillPrices == 1}hidden{/if}" {if {$billsettingsData[23]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>

                                {$myreturnsellbilldetailData->discountvalue} </td>
                            <td align="center" class="style2 style1 {if $Usergroupdata->hideBillPrices == 1}hidden{/if}"> {$myreturnsellbilldetailData->returnsellbilldetailprice} </td>
                            <td align="center" class="style2 style1"> {$myreturnsellbilldetailData->returnsellbilldetailquantity} </td>
                            <td align="center" class="style2 style1"{if {$billsettingsData[21]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>

                                {$myreturnsellbilldetailData->unitName} </td>
                            <td align="center" class="style2 style1"{if {$billsettingsData[7]->billsettingsvalue} eq 0}  {else}  style="display:none !important"  {/if}>

                                {$myreturnsellbilldetailData->note} </td>
                            <td align="center" class="style2 style1" {if {$billSettingsData[59]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>{$myreturnsellbilldetailData->parcode} </td>
                            <td align="right" class="style2 style1"> {$myreturnsellbilldetailData->productName}/{$myreturnsellbilldetailData->productCatName}
                                {if {$billsettingsData[79]->billsettingsvalue} eq 0}
                                {if isset($myreturnsellbilldetailData->sizeName) && $myreturnsellbilldetailData->sizeName !=""}/{$myreturnsellbilldetailData->sizeName}{/if}
                                {if isset($myreturnsellbilldetailData->colorName) && $myreturnsellbilldetailData->colorName !=""}/{$myreturnsellbilldetailData->colorName}{/if}
                                {/if}
                            </td>
                            <td align="center" class="style2">{$myreturnsellbilldetailData@index+1}</td>
                        </tr>
                        {/foreach}
                    </table>
                    <hr />
                    <table width="100%" border="1" class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}">
                        <tr>


                            <!-----------الدين بعد ------------------->
                            {if {$billsettingsData[19]->billsettingsvalue} eq 0}
                            <td width="14%" align="center" bgcolor="#B4B4B4" >الدين بعد</td>
                            {/if}

                            <!-----------الدين قبل ------------------->
                            {if {$billsettingsData[18]->billsettingsvalue} eq 0}
                            <td width="14%" align="center" bgcolor="#B4B4B4" >الدين قبل</td>
                            {/if}

                            <!-----------الباقى ------------------->


                            {if {$billsettingsData[55]->billsettingsvalue} eq 0}
                            <td width="10%" align="center" bgcolor="#B4B4B4">الباقي</td>
                            {/if}


                            <!-----------المدفوع ------------------->
                            {if {$billsettingsData[54]->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 $billnameAddData->taxOfDiscountPrint eq 0}
                            <td width="8%" align="center" bgcolor="#B4B4B4">ضريبة خصم </td>
                            {/if}
                            <!-----------ضريبه المبيعات ------------------->
                            {if {$billsettingsData[31]->billsettingsvalue} eq 0}
                            <td width="8%" align="center" bgcolor="#B4B4B4" >
                                <table style="width:10px; !important " >
                                    <tr >
                                        <td  nowrap> قيمه الضريبه</td>
                                        <td   nowrap > % الضريبه</td>


                                    </tr>


                                </table></td>

                            {/if}

                            {if  $returnsellbillData->extraDiscountVal > 0 && $billsettingsData[90]->billsettingsvalue == 1 && $billnameAddData->extraDiscountPlace == 0}
                            <td width="8%" align="center" bgcolor="#B4B4B4">خصم اضافى </td>
                            {/if}
                            {if  {$returnsellbillData->returnsellbilldiscount} > 0}
                            <td width="8%" align="center" bgcolor="#B4B4B4" {if {$billsettingsData[47]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>قيمة الخصم</td>
                            <!--<td width="8%" align="center" bgcolor="#B4B4B4">نوع الخصم</td>-->
                            {/if}
                            {if  $returnsellbillData->extraDiscountVal > 0 && $billsettingsData[90]->billsettingsvalue == 1 && $billnameAddData->extraDiscountPlace == 1}
                            <td width="8%" align="center" bgcolor="#B4B4B4">خصم اضافى </td>
                            {/if}

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


                            <!-----------الدين بعد ------------------->
                            {if {$billsettingsData[19]->billsettingsvalue} eq 0}
                            <td align="center" class="style1" >{$returnsellbillData->returnsellbilltotaldeptafter}</td>
                            {/if}

                            <!-----------الدين قبل ------------------->
                            {if {$billsettingsData[18]->billsettingsvalue} eq 0}
                            <td align="center" class="style1" >{$returnsellbillData->returnsellbilltotaldeptbefor}</td>
                            {/if}
                            <!---------------------الباقي----------------->
                            {if {$billsettingsData[55]->billsettingsvalue} eq 0}
                            <td align="center" class="style1">{$returnsellbillData->returnsellbillfinalbill}</td>
                            {/if}

                            <!-----------المدفوع ------------------->
                            {if {$billsettingsData[54]->billsettingsvalue} eq 0}
                            <td align="center" class="style1">{$returnsellbillData->returnsellbilltotalpayed}</td>
                            {/if}

                            <!---------------------الصافي----------------->
                            {if {$billsettingsData[28]->billsettingsvalue} eq 0}
                            <td align="center" class="style1">{$returnsellbillData->returnsellbillaftertotalbill} </td>
                            {/if}
                            {if $billnameAddData->taxOfDiscountPrint eq 0}
                            <td align="center" class="style1">{$returnsellbillData->taxOfDiscountVal} </td>
                            {/if}

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

                            <td align="center" class="style1">

                                <table style="width:100%; !important ;" >

                                    <tr>
                                        <td  style="text-align:center; width:50% "> {$taxvalue}</td>

                                        <td style="text-align:center; width:50% ">% {$returnsellbillData->tax} </td>

                                    </tr>

                                </table>
                            </td>
                            {/if}
                            {if  $returnsellbillData->extraDiscountVal > 0 && $billsettingsData[90]->billsettingsvalue == 1 && $billnameAddData->extraDiscountPlace == 0}
                            <td align="center" class="style1">{$returnsellbillData->extraDiscountVal}</td>
                            {/if}
                            {if  {$returnsellbillData->returnsellbilldiscount} > 0}
                            <td align="center" class="style1" {if {$billsettingsData[47]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                {if $returnsellbillData->returnsellbilldiscounttype eq 2}(%{$returnsellbillData->returnsellbilldiscount}){/if} {$discountvalue}
                            </td>
                            <!--                            <td align="center" class="style1"> {if {$returnsellbillData->returnsellbilldiscounttype} eq 1}
                                                            مباشر
                                                            {else}
                                                            بنسبة
                                                            {/if} </td>-->
                            {/if}
                            {if  $returnsellbillData->extraDiscountVal > 0 && $billsettingsData[90]->billsettingsvalue == 1 && $billnameAddData->extraDiscountPlace == 1}
                            <td align="center" class="style1">{$returnsellbillData->extraDiscountVal}</td>
                            {/if}
                            <td align="center" class="style1">{$returnsellbillData->returnsellbilltotalbill}</td>
                            <td align="center" class="style1"> {if {$returnsellbillData->returnsellQuantity} <= 0}
                                {$quantity}
                                {else}
                                {$returnsellbillData->returnsellQuantity}
                                {/if} </td>
                        </tr>
                    </table>
                    <div class="footer">

                        <table width="100%">
                            <tr {if $billsettingsData[72]->billsettingsvalue == 2}style="display:none;"{/if}>
                                <td width="35%" class="s2" scope="row"><strong>
                                        {if $billsettingsData[72]->billsettingsvalue == 0 || $userData->branchId == 0 || $userData->branchId == -1}
                                        {$Programsettingdata->phone}
                                        {else}
                                        {$branchData->mobile}
                                        {/if}
                                    </strong></td>
                                <td width="15%" rowspan="2" class="s1"><strong>التليفونات</strong></td>
                                <td width="35%" rowspan="2" class="s2"><strong>
                                        {if $billsettingsData[72]->billsettingsvalue == 0 || $userData->branchId == 0 || $userData->branchId == -1}
                                        {$Programsettingdata->address}
                                        {else}
                                        {$branchData->branchAddress}
                                        {/if}


                                    </strong></td>
                                <td width="15%" rowspan="2" class="s1"><strong>العنوان</strong></td>
                            </tr>
                            <tr {if $billsettingsData[72]->billsettingsvalue == 2}style="display:none;"{/if}>
                                <th class="s2" scope="row"><strong>
                                        {if $billsettingsData[72]->billsettingsvalue == 0 || $userData->branchId == 0 || $userData->branchId == -1}
                                        {$Programsettingdata->phone2}
                                        {else}
                                        {$branchData->phone}
                                        {/if}
                                    </strong></th>
                            </tr>
                            <tr {if $billsettingsData[81]->billsettingsvalue == 1}style="display:none"{/if}>
                                <td colspan="5" style="text-align:center !important"><p><span class="copywrites1">تصميم شركة جي تي فور 01110070882</span></p></td>
                            </tr>
                        </table>

                    </div>
                    </table>




                    {else}
                    <table  width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table-black">
                        <tr {if $billsettingsData[72]->billsettingsvalue == 2}style="display:none;"{/if}>
                            <td width="148" height="115" align="left" valign="middle">&nbsp;</td>
                            <td width="142" colspan="2" align="right" valign="top"><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}
                                        {else}
                                        <img src="../views/default/images/branch_image/{$branchData->logo}" alt="" width="122" height="75">
                                        <br>
                                        {$branchData->mobile}
                                        {/if}
                                        <br>

                                        </td>

                                        </tr>
                                        <tr>
                                            <td></td>
                                            <td><h3 style="text-align: center">مردودات مبيعات</h3></td>

                                        </tr>

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

                                                    {if {$billsettingsData[18]->billsettingsvalue} eq 0}
                                                    <tr class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}">

                                                        <td align="right">
                                                            <span>الدين قبل:</span>
                                                            <span> {$returnsellbillData->returnsellbilltotaldeptbefor}  {$currency}</span>
                                                        </td>
                                                    </tr>
                                                    {/if}
                                                    {if {$billsettingsData[16]->billsettingsvalue} eq 0}
                                                    <tr >

                                                        <td align="right">
                                                            <span> اسم العميل :</span>
                                                            <span> {$returnsellbillData->tempclientName}</span>
                                                        </td>
                                                    </tr>
                                                    {/if}
                                                    <tr  {if {$billsettingsData[15]->billsettingsvalue} eq 0 &&$Programsettingdata->clientserial == 1}  {else} style="display:none !important" {/if}>

                                                        <td align="right">
                                                            <span>رقم عمليه السداد:</span>
                                                            <span> {$returnsellbillData->returnsellbillid}</span>
                                                        </td>
                                                    </tr>
                                                    <tr>

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

                                                    {if {$billsettingsData[27]->billsettingsvalue} eq 0}
                                                    <tr>

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

                                                    <tr>

                                                        <td  align="right">
                                                            <span> المستخدم:</span>
                                                            <span> {$billUserData->employeename}</span>
                                                        </td>
                                                    </tr>
                                                    {if {$billsettingsData[22]->billsettingsvalue} eq 0}
                                                    <tr>

                                                        <td  align="right">
                                                            <span> التعليق:</span>
                                                            <span> {$returnsellbillData->comment}</span>
                                                        </td>
                                                    </tr>
                                                    {/if}
                                                    {if {$billsettingsData[101]->billsettingsvalue} eq 0}
                                                    <tr>

                                                        <td  align="right">
                                                            <span> عملية الفاتورة:</span>
                                                            <span> {$returnsellbillData->billoperationName}</span>
                                                        </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>م</td>
                                                        <td align="center"{if {$billsettingsData[20]->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[21]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} >الوحدة</td>
                                                        <td align="center">العدد</td>
                                                        <td align="center" class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}">السعر</td>
                                                        <td align="center" class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}" {if {$billsettingsData[23]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if} >الخصم</td>
                                                        <td align="center"class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}"> الاجمالى</td>
                                                    </tr>



                                                    {foreach $returnsellbilldetailData as $myreturnsellbilldetailData}

                                                    <tr>
                                                        <td>{$myreturnsellbilldetailData@index+1}</td>
                                                        <td {if {$billsettingsData[20]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                                            {$myreturnsellbilldetailData->parcode}
                                                        </td>
                                                        <td>
                                                            {$myreturnsellbilldetailData->productName}/{$myreturnsellbilldetailData->productCatName}
                                                            {if {$billsettingsData[79]->billsettingsvalue} eq 0}
                                                            {if isset($myreturnsellbilldetailData->sizeName) && $myreturnsellbilldetailData->sizeName !=""}/{$myreturnsellbilldetailData->sizeName}{/if}
                                                            {if isset($myreturnsellbilldetailData->colorName) && $myreturnsellbilldetailData->colorName !=""}/{$myreturnsellbilldetailData->colorName}{/if}
                                                            {/if}
                                                        </td>
                                                        <td {if {$billsettingsData[7]->billsettingsvalue} eq 0}  {else}  style="display:none !important"  {/if}>
                                                            {$myreturnsellbilldetailData->note}
                                                        </td>
                                                        <td {if {$billsettingsData[21]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                                            {$myreturnsellbilldetailData->unitName}
                                                        </td>
                                                        <td>
                                                            {$myreturnsellbilldetailData->returnsellbilldetailquantity}
                                                        </td>
                                                        <td class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}">
                                                            {$myreturnsellbilldetailData->returnsellbilldetailprice} {$currency}
                                                        </td>
                                                        <td class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}" {if {$billsettingsData[23]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                                            {$myreturnsellbilldetailData->discountvalue}
                                                        </td>
                                                        <td class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}">
                                                            {$myreturnsellbilldetailData->returnsellbilldetailtotalprice}
                                                        </td>
                                                    </tr>

                                                    {/foreach}

                                                </table>
                                            </td>
                                        </tr>
                                        <tr class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}">
                                            <td height="54" colspan="3" align="right"><table width="50%" border="0" align="left" cellpadding="0" cellspacing="0"  dir="rtl" class="td">


                                                    <tr {if {$billsettingsData[58]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>
                                                        <td>عدد القطع</td>
                                                        <td>
                                                            {if {$returnsellbillData->returnsellQuantity} <= 0}
                                                            {$quantity}
                                                            {else}
                                                            {$returnsellbillData->returnsellQuantity}
                                                            {/if}
                                                        </td>
                                                    </tr>
                                                    {if  $returnsellbillData->extraDiscountVal > 0 && $billsettingsData[90]->billsettingsvalue == 1 && $billnameAddData->extraDiscountPlace == 1}
                                                    <tr>
                                                        <td>خصم اضافى</td>
                                                        <td>{$returnsellbillData->extraDiscountVal}</td>
                                                    </tr>
                                                    {/if}
                                                    {*if  {$returnsellbillData->returnsellbilldiscount} > 0*}
                                                    <!--                                                    <tr {if {$billsettingsData[23]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>
                                                                                                            <td>نوع الخصم</td>
                                                                                                            <td>
                                                                                                                {if {$returnsellbillData->returnsellbilldiscounttype} eq 1}
                                                                                                                مباشر
                                                                                                                {else}
                                                                                                                بنسبة
                                                                                                                {/if}
                                                                                                            </td>
                                                                                                        </tr>-->

                                                    <tr {if {$billsettingsData[47]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                                                        <td>قيمه الخصم</td>
                                                        <td>  {$discountvalue} {if $returnsellbillData->returnsellbilldiscounttype eq 2}(%{$returnsellbillData->returnsellbilldiscount}){/if}</td>
                                                    </tr>
                                                    {if  $returnsellbillData->extraDiscountVal > 0 && $billsettingsData[90]->billsettingsvalue == 1 && $billnameAddData->extraDiscountPlace == 0}
                                                    <tr>
                                                        <td>خصم اضافى</td>
                                                        <td>{$returnsellbillData->extraDiscountVal}</td>
                                                    </tr>
                                                    {/if}
                                                    {if {$billsettingsData[31]->billsettingsvalue} eq 0}

                                                    <tr>
                                                        <td>ضريبه القيمة المضافة</td>
                                                        <td>  {$taxvalue}{$Programsettingdata->currancy} ({$returnsellbillData->tax}%)</td>
                                                    </tr>
                                                    {/if}
                                                    {if $billnameAddData->taxOfDiscountPrint eq 0}
                                                    <tr>
                                                        <td> ضريبه الخصم </td>
                                                        <td>{$returnsellbillData->taxOfDiscountVal}</td>
                                                    </tr>
                                                    {/if}
                                                    <tr>
                                                        <td>المبلغ بعد الخصم</td>
                                                        <td>{$returnsellbillData->returnsellbillaftertotalbill} {$currency}</td>
                                                    </tr>
                                                    <!-- {*/if*}-->

                                                    <!-----------الصافى   ------------------->
                                                    {if {$billsettingsData[28]->billsettingsvalue} eq 0}
                                                    <tr>
                                                        <td>الصافى</td>
                                                        <td> {$returnsellbillData->returnsellbillaftertotalbill} {$currency}</td>
                                                    </tr>
                                                    {/if}

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


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


                                                    {if {$billsettingsData[19]->billsettingsvalue} eq 0}
                                                    <tr >
                                                        <td>إجمالى المديونيه</td>
                                                        <td>{$returnsellbillData->returnsellbilltotaldeptafter}  {$currency}</td>
                                                    </tr>
                                                    {/if}
                                                    <tr>
                                                        <td>اجمالي الفاتوره</td>
                                                        <td>{$returnsellbillData->returnsellbilltotalbill}</td>
                                                    </tr>

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

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