
<html>
    <head>

        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>GT4</title>
        <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 */
                }
            }
            table.info tr{
                width:100%;
            }



            .body{
                direction: rtl;
            }
            td{
                margin: 0
            }

            .table-black1 tbody>tr>td {
                padding: 3px;
                vertical-align: middle;
                text-align: center;
                border: 1px solid #656565;
            }

            .result,.result tr,.result tr td{
                border:1px solid #656565
            }
            .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: 17px;
                border-right-color: #999;
            }
            .NEE
            {
                font-size: 14px;
            }
            .newdesign
            {
                font-size: 14px;
            }
            .copywrites
            {
                font-size: 15px;
            }
            td{
                margin: 0!important
            }
            .hidden{
                display: none;
            }

        </style>

    </head>
    <script src="../views/default/assets/js/jquery.js"></script>
    {literal}
    <script language="javascript" type="text/javascript">
        /*$(document).ready(function() {
         //window.print();
         printDiv();
         });*/
        function printDiv() {
            var divId = document.getElementById('printdiv');
            divId.setAttribute("className", "print_section print");
            divId.setAttribute("class", "print_section print");
            window.print();
            setTimeout(window.close, 0);
            // window.close();

        }
    </script>
    <style>
        td{font-size:15px;
           font-weight: 200;


        }
        .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: 17px;
            border-right-color: #999;
        }
        .NEE
        {
            font-size: 14px;
        }
        .newdesign
        {
            font-size: 14px;
        }
        .copywrites
        {
            font-size: 14px;
        }
    </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: 18px;
            border-right-color: #999;
        }
        .NEE
        {
            font-size: 14px;
        }
        .newdesign
        {
            font-size: 14px;
        }
        .copywrites
        {
            font-size: 15px;
        }
        .style2 {
            font-family: tahoma
        }
        .style4 {font-family: tahoma; font-size: 14px; font-weight: bold;
                 border: 1px solid  #999  !important;
        }
        .serial {
            background-color: #C8C8C8;
            height: 20px;
            width: 150px;
            padding: 5px;
            margin: 5px;
            border: medium double #000000;
            text-align: center;
        }
        .style1 {
            font-size: 15px
        }
        .style-num {
            font-size: 12px
        }
        table.data td{border:1px solid #000;text-align: center}
        tfoot td {
            border: 1px solid #636161;
            background-color: #f5f5f5;
            text-align: center;
            font-weight: bold
        }
    </style>
    {/literal}
    <body onLoad="printDiv()">
        <div id="printdiv"  >
            {if {$billsettingsData[25]->billsettingsvalue} eq 0}

            <table width="100%" 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">{$sellbillData->sellbillid}</div></td-->
                    <td>&nbsp;</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>
            </table>
            <div style="clear:both"></div>

            <!--start title -->
            <div {if $billsettingsData[70]->billsettingsvalue == 0}{else}  style="display:none"{/if}>
                <h2  style="  text-align:center;margin: 5px ">{$billnameAddData->name}</h2>
            </div>
            <!-- end title -->

            <table width="60%"  align="right" cellpadding="0" cellspacing="0" class="table-black" style="margin-bottom: 10px;font-size:10px;direction: rtl" >

                <tr >
                    {if $Programsettingdata->clientserial eq 1}
                    <td    style="padding: 2px" align="right"><span class="">
                            <span> رقم  تسلسل الفاتورة   :</span>
                            <span> {$returnsellbillData->returnsellbillid}</span>
                        </span></td>
                    {/if}

                </tr>
                <tr >
                    <td   style="padding: 2px" align="right"  nowrap width="" >
                        <span class="">التاريخ :</span>
                        <span class=""> {$returnsellbillData->returnsellbilldate}</span></td>
                </tr>
                <tr >
                    <td   style="padding: 2px" align="right"  nowrap width="" >
                        <span class="">المستخدم :</span>
                        <span class=""> {$billUserData->employeename}</span></td>
                </tr>
                <tr>
                    <td    style="padding: 2px" align="right" nowrap><span class="" style="direction:rtl; {if $billsettingsData[72]-> billsettingsvalue == 2}display:none;{/if}"> العنوان :
                            {if $billsettingsData[72]->billsettingsvalue == 0 || $userData->branchId == 0 || $userData->branchId == -1}
                            {$Programsettingdata->address}
                            {else}
                            {$branchData->branchAddress}
                            {/if}
                        </span></td>
                </tr>

            </table>

            <table width="40%"  align="right" cellpadding="0" cellspacing="0" class="table-black" style="margin-bottom: 10px;direction: rtl">
                <tr >
                    <td  align="right" >
                        <span class="style1 style2" {if {$billsettingsData[3]->billsettingsvalue} eq 0} style="display:inline-block" {else} style="display:none" {/if}>
                            <span> {if $Programsettingdata->delegate_seller eq 0} بائع {elseif $Programsettingdata->delegate_seller == 1}مندوب {elseif $Programsettingdata->delegate_seller == 2}طبيب {/if} {$returnsellbillData->employeename}</span>
                    </td>

                </tr>
                <tr>
                    <td align="right"  ><span class="style1 style2">{if {$billsettingsData[18]->billsettingsvalue} eq 0}{$returnsellbillData->returnsellbilltotaldeptbefor} (ح/س){/if}</span></td>
                </tr>
                <tr>
                    <td align="right">  {if {$billsettingsData[27]->billsettingsvalue} eq 0}  {$returnsellbillData->storeName}{/if} </td>
                </tr>
                <tr>
                    <td colspan="2" align="right" {if {$billsettingsData[16]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} >
                        <span> السيد :</span>
                        <span>{$returnsellbillData->tempclientName}</span>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="right" {if {$billsettingsData[101]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} >
                        <span> عملية الفاتورة :</span>
                        <span>{$returnsellbillData->billoperationName}</span>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="right" {if {$billsettingsData[22]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} >
                        <span> التعليق :</span>
                        <span>{$returnsellbillData->comment}</span>
                    </td>
                </tr>
            </table>
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table-black1">
                <thead>
                    <tr>
                        <td align="center"  class="style4 {if $Usergroupdata->hideBillPrices == 1}hidden{/if}">اجمالى التصنيفات</td>
                        <td align="center"  class="style4 {if $Usergroupdata->hideBillPrices == 1}hidden{/if}" {if {$billsettingsData[23]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} >الخصم</td>
                        <td align="center" class="style4 {if $Usergroupdata->hideBillPrices == 1}hidden{/if}">السعر</td>
                        <td align="center"  class="style4"  {if {$Programsettingdata->scunitname} eq '0'}  hidden {/if} >{$Programsettingdata->scunitname}</td>
                        <td align="center" class="style4">الكمية</td>
                        <td align="center"  class="style4"{if {$billsettingsData[21]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} >الوحدة</td>
                        <td align="center"  class="style4"{if {$billsettingsData[22]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} >ملاحظات</td>
                        <td align="center" class="style4" {if {$billsettingsData[20]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>الباركود</td>
                        <td width="50%" align="center"  class="style4">اسم المنتج</td>
                        <td align="right"  class="style4">م </td>
                    </tr>
                </thead>

                <tbody>
                    {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 !important" {/if}>

                            {if {$billsettingsData[34]->billsettingsvalue} eq 0}{$myreturnsellbilldetailData->discountvalue} {else}  {$myreturnsellbilldetailData->discounttype} {/if}

                        </td>
                        <td align="center" class="style2 style1 {if $Usergroupdata->hideBillPrices == 1}hidden{/if}"> {$myreturnsellbilldetailData->returnsellbilldetailprice} </td>
                        <td align="center" class="style2 style1" {if {$Programsettingdata->scunitname} eq '0'}  hidden {/if}>
                            {$myreturnsellbilldetailData->otherdetailquantity}
                        </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[20]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/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}
                <tfoot class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}">
                    <tr>
                        <td>{$returnsellbillData->returnsellbilltotalbill}</td>
                        <td align="center" class="style2 style1"{if {$billsettingsData[23]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}> </td>
                        <td></td>
                        <td {if {$Programsettingdata->scunitname} eq '0'}  hidden {/if}></td>

                        <td>{if {$returnsellbillData->returnsellQuantity} <= 0}
                            {$quantity}
                            {else}
                            {$returnsellbillData->returnsellQuantity}
                            {/if} </td>
                        <td align="center" class="style2 style1"{if {$billsettingsData[21]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}> </td>
                        <td align="center" class="style2 style1"{if {$billsettingsData[22]->billsettingsvalue} eq 0}  {else}  style="display:none !important"  {/if}> </td>
                        <td align="center" class="style2 style1"{if {$billsettingsData[20]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}> </td>
                        <td colspan="2">الاجمالى العام</td>
                    </tr>
                </tfoot>
                </tbody>

            </table>
            <table class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}" width="50%" border="0" cellpadding="0" cellspacing="0" class="result" style="margin-top:5px">
                <tr>



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

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

                    <!---------------------المدفوع----------------->
                    {if {$billsettingsData[29]->billsettingsvalue} eq 0}
                    <td width="8%" align="center" >المدفوع</td>
                    {/if}

                    <!---------------------الصافي----------------->
                    {if {$billsettingsData[28]->billsettingsvalue} eq 0}
                    <td width="9%" align="center" >الصافي</td>
                    {/if}

                    {if $billnameAddData->taxOfDiscountPrint eq 0}
                    <td width="9%" align="center">ضريبه الخصم</td>
                    {/if}
                    {if {$billsettingsData[31]->billsettingsvalue} eq 0}
                    <td width="9%" align="center">ضريبه القيمة المضافة</td>
                    {/if}



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

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


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

                    <!-----------المدفوع ------------------->
                    {if {$billsettingsData[29]->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">{$taxvalue} ({$returnsellbillData->tax}%)</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><table width="100%" style="text-align: center;margin-top: 20px">
                {if {$billsettingsData[43]->billsettingsvalue} eq 0}

                <tr>

                    <td >توقيع العميل </td> <td >توقيع ال{if $Programsettingdata->delegate_seller eq 0} بائع {elseif $Programsettingdata->delegate_seller == 1}مندوب {elseif $Programsettingdata->delegate_seller == 2}طبيب {/if} </td><td>{$billnameAddData->goodsReceiptApproval}</td>
                </tr>

                {/if}

                <tr>
                    <td ><!--span class="style1" style="direction:rtl"><strong>{$returnsellbillData->useremployeename}</strong></span--></td>
                    <!-- <td  nowrap {if $billsettingsData[72]->billsettingsvalue == 2}style="display:none;"{/if}><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 {if $billsettingsData[81]->billsettingsvalue == 1}style="display:none"{/if}>
                    <td colspan="6"  style="text-align:center !important"><p><span class="copywrites1">تصميم شركة جي تي فور 01110070882</span></p></td>
                </tr>
            </table>
            {else}
            <table width="97%" align="center" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="148"  align="left" valign="middle">&nbsp;</td>
                    <td width="142"  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="50"><br>
                                <span style="font-size:14px">{$Programsettingdata->phone}</span>
                                {else}
                                <img src="../views/default/images/branch_image/{$branchData->logo}" alt="" width="122" height="50"><br>
                                <span style="font-size:14px"> {$branchData->mobile}</span>
                                {/if}
                    </td>
                </tr>
            </table>
            <table  style="width:63%;float:right;margin-top: 7px;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}
                {if {$billsettingsData[101]->billsettingsvalue} eq 0}
                <tr>
                    <td align="right">
                        <span> عملية الفاتورة :</span>
                        <span>{$returnsellbillData->billoperationName}</span>
                    </td>
                </tr>
                {/if}
                {if {$billsettingsData[22]->billsettingsvalue} eq 0}
                <tr>
                    <td align="right">
                        <span> التعليق :</span>
                        <span>{$returnsellbillData->comment}</span>
                    </td>
                </tr>
                {/if}
                <tr {if {$billsettingsData[39]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>

                    <td dir="rtl">
                        <span> عنوان العميل:</span>
                        <span> {$clientdata->clientaddress}</span>
                    </td>

                </tr>
                <!-- <tr {if {$billsettingsData[3]->billsettingsvalue} eq 0}  {else} style="display:none" {/if}>
                    <td align="right">  ال{if $Programsettingdata->delegate_seller eq 0} بائع {elseif $Programsettingdata->delegate_seller == 1}مندوب {elseif $Programsettingdata->delegate_seller == 2}طبيب {/if}</td>

                </tr> -->
                <tr>
                    <td align="right">
                        <span>تاريخ البيان:</span>
                        <span>{$returnsellbillData->returnsellbilldate}</span>
                    </td>
                </tr>
            </table>
            <table style="width:35%;float:left;direction: rtl">

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

                    <td dir="rtl">
                        <span>تليفون العميل:</span>
                        <span>{$clientdata->clientphone}</span>
                </tr>

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

                    <td dir="rtl">
                        <span> كود العميل :</span>
                        <span> {$clientdata->clientcode}</span>
                    </td>

                </tr>

                {if $Programsettingdata->clientserial eq 1}
                <tr >

                    <td align="right">
                        <span> رقم  تسلسل الفاتورة :</span>
                        <span> {$returnsellbillData->returnsellbillid}</span>
                    </td>
                    <td>  </td>
                </tr>
                {/if}




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

                <!--المخزن -->
                {if {$billsettingsData[27]->billsettingsvalue} eq 0}

                <tr>
                    <td align="right" >
                        <span> اسم المخزن: </span>
                        <span> {$returnsellbillData->storeName}</span>
                    </td>
                </tr>
                {/if}
                <tr >
                    <td align="right">
                        <span class="">المستخدم :</span>
                        <span class=""> {$billUserData->employeename}</span></td>
                </tr>
            </table>
            <div style="clear:both"></div>

            <h4 style="text-align: center;margin: 5px">مردودات مبيعات</h4>

            <table class="data" width="100%"  cellpadding="0" cellspacing="0" dir="rtl">

                <tr>
                    <td align="center" class="style2">م</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"  {if {$Programsettingdata->scunitname} eq '0'}  hidden {/if} >{$Programsettingdata->scunitname}</th>

                    <td class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}" align="center">السعر</td>
                    <td class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}" align="center" {if {$billsettingsData[23]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} >الخصم</td>
                    <td class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}" align="center"> الاجمالى</td>
                </tr>



                {foreach $returnsellbilldetailData as $myreturnsellbilldetailData}

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

                        {$myreturnsellbilldetailData->parcode}

                    </td>

                    <td>

                        {$myreturnsellbilldetailData->productName}
                        {if {$billsettingsData[60]->billsettingsvalue} eq 0}/
                        {$myreturnsellbilldetailData->productCatName}{/if}
                        <!-- /{$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  {if {$Programsettingdata->scunitname} eq '0'}  hidden {/if}>
                        {$myreturnsellbilldetailData->otherdetailquantity}
                    </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}>



                        {if {$billsettingsData[34]->billsettingsvalue} eq 0}{$myreturnsellbilldetailData->discountvalue} {else}  {$myreturnsellbilldetailData->discounttype} {/if}
                    </td>


                    <td class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}">

                        {$myreturnsellbilldetailData->returnsellbilldetailtotalprice}

                    </td>

                </tr>

                {/foreach}
                <!--                <tfoot>
                                    <tr>
                                        <td colspan="2">الاجمالى</td>

                <td></td>
                                        <td> {if {$returnsellbillData->returnsellQuantity} <= 0}
                                            {$quantity}
                                            {else}
                                            {$returnsellbillData->returnsellQuantity}
                                            {/if}</td>
                                        <td></td>
                                        <td>{$returnsellbillData->returnsellbilltotalbill}</td>

                                    </tr>
                                </tfoot>-->

            </table>
            <table class="data {if $Usergroupdata->hideBillPrices == 1}hidden{/if}" width="50%"  align="left" cellpadding="0" cellspacing="0" style="margin-top: 5px" dir="rtl">


                <tr>
                    <td {if {$billsettingsData[46]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>عدد القطع</td>
                    <td>
                        {if {$returnsellbillData->returnsellQuantity} <= 0}
                        {$quantity}
                        {else}
                        {$returnsellbillData->returnsellQuantity}
                        {/if}
                    </td>
                </tr>
                <tr>
                    <td>الاجمالى العام</td>
                    <td>{$returnsellbillData->returnsellbilltotalbill}</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[47]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/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[29]->billsettingsvalue} eq 0}
                <tr>
                    <td>المدفوع</td>
                    <td> {$returnsellbillData->returnsellbilltotalpayed} {$currency}</td>
                </tr>
                {/if}




                <!--الباقى -->
                {if {$billsettingsData[30]->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}




            </table>
            <div style="clear:both"></div>
            <table width="100%">

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


                <td >توقيع العميل </td> <td >توقيع ال{if $Programsettingdata->delegate_seller eq 0} بائع {elseif $Programsettingdata->delegate_seller == 1}مندوب {elseif $Programsettingdata->delegate_seller == 2}طبيب {/if} </td><td>{$billnameAddData->goodsReceiptApproval}</td>
                </tr>
                <tr>
                    <td colspan="3" align="right">
                        <br/> <br/> <br/>
                    </td>
                </tr>
                {/if}

                <tr>
                    <td colspan="3" align="right" nowrap {if $billsettingsData[72]->billsettingsvalue == 2}style="display:none;"{/if}><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 {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>