
<html>
    <head>

        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>GT4</title>
        <style type="text/css">
            @media print {
                @page {
                    size: 100mm 200mm landscape; /* landscape */
                    /* you can also specify margins here: */
                    margin: 5mm;
                    margin-right:5mm; /* for compatibility with both A4 and Letter */
                }
                #printdiv{
                    margin-top:{$billsettingsData[82]->billsettingsvalue}mm; /* user margin */
                }
            }
        </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>
        strong {
            font-size: 12px;
        }
        .td td
        {
            border-right-widtd: 1px;
            border-bottom-widtd: 1px;

            font-size: 15px;
        }
        .NEE
        {
            font-size: 14px;
        }
        .newdesign
        {
            font-size: 14px;
        }
        .copywrites
        {
            font-size: 11px;
        }
        .data-border td{border:1px solid #000;text-align: center}
    </style>
    <style>
        .td td
        {
            border-right-widtd: 1px;
            border-bottom-widtd: 1px;

            font-size: 15px;
        }
        .NEE
        {
            font-size: 14px;
        }
        .newdesign
        {
            font-size: 14px;
        }
        .copywrites
        {
            font-size: 11px;
        }
        .style2 {
            font-family: tahoma
        }
        .style4 {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" >
            <table width='100%'>
                <tr {if $billsettingsData[70]->billsettingsvalue == 0}{else}  style="display:none"{/if}>

                    <td  colspan="6" align="center" style=" text-align:  center !important" class="style1">
                        <h2 style="margin: 0">{$billnameAddData->name}</h2>
                    </td>

                </tr>

            </table>
            {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;text-align: center;}
                .a4{ }
            </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="height: 45px;width: 60%;">
                                {else}
                                <img src="../views/default/images/branch_image/{$branchData->logo}" alt="" style="height: 45px;width: 60%;">
                                {/if}
                            </strong></td>
                        <td class="s1"  colspan="3" style="direction: rtl"><strong >{$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>{$sellbillandruternData->sellbillid} </strong></th>
                        <td colspan="2" class="s1"><strong>تسلسل الفاتورة رقم </strong></td>


                        <td width="18%" colspan="2" class="s1"><strong>{$sellbillandruternData->sellbilldate}</td>
                        <td width="17%" 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>{$sellbillandruternData->tempclientName}</strong></td>
                        <td colspan="2" class="s1"><strong>اسم العميل</strong></td>
                    </tr>
                    <tr>
                        <th width="12.5%" class="s2" scope="row"><strong>{$sellbillandruternData->carmotor}</strong></th>
                        <td width="12.5%" class="s1"><strong>موتور</strong></td>
                        <td width="12.5%" class="s2"><strong>{$sellbillandruternData->carchase}</strong></td>
                        <td width="12.5%" class="s1"><strong>شاسيه</strong></td>
                        <td width="12.5%" class="s2"><strong>{$sellbillandruternData->cartype}</strong></td>
                        <td width="12.5%" class="s1"><strong>نوعها</strong></td>
                        <td width="12.5%" class="s2"><strong>{$sellbillandruternData->carnumber}</strong></td>
                        <td width="12.5%" class="s1"><strong>رقم السيارة </strong></td>
                    </tr>
                </table>

                <table width="100%" border="0" cellpadding="" >
                    <tr>
                        <td colspan="9" align="center" bgcolor="#B4B4B4" class="style2 style1"><strong>المبيعات</strong></td>
                    </tr>
                    <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 {$billsettingsData[64]->billsettingsvalue} eq 0} {else} style="display:none" {/if}>الكمية</td>
                        <td align="center" bgcolor="#B4B4B4" class="style4" {if {$billsettingsData[53]->billsettingsvalue} eq 0} {else} style="display:none" {/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"    {/if}>الباركود</td>
                        <td width="50%" align="center" bgcolor="#B4B4B4" class="style4">اسم المنتج</td>
                        <td align="right" bgcolor="#B4B4B4" class="style4">م </td>
                    </tr>

                    {foreach $sellbilldetailData as $mysellbilldetailData}
                    <tr>
                        <td align="center" class="style2 style1"> {$mysellbilldetailData->sellbilldetailtotalprice} </td>
                        <td align="center" class="style2 style1"{if {$billsettingsData[23]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>{$mysellbilldetailData->discountvalue} </td>
                        <td align="center" class="style2 style1">{$mysellbilldetailData->sellbilldetailprice} </td>
                        <td align="center" class="style2 style1" {if {$billsettingsData[64]->billsettingsvalue} eq 0} {else} style="display:none" {/if}> {$mysellbilldetailData->sellbilldetailquantity} </td>
                        <td align="center" class="style2 style1"{if {$billsettingsData[53]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>{$mysellbilldetailData->unitName}</td>
                        <td align="center" class="style2 style1"{if {$billsettingsData[7]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>{$mysellbilldetailData->note}</td>
                        <td align="center" class="style2 style1"{if {$billsettingsData[20]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>{$mysellbilldetailData->parcode} </td>
                        <td align="right" class="style2 style1">{$mysellbilldetailData->productName}/{$mysellbilldetailData->productCatName}
                            {if {$billsettingsData[79]->billsettingsvalue} eq 0}
                            {if isset($mysellbilldetailData->sizeName) && $mysellbilldetailData->sizeName !=""}/{$mysellbilldetailData->sizeName}{/if}
                            {if isset($mysellbilldetailData->colorName) && $mysellbilldetailData->colorName !=""}/{$mysellbilldetailData->colorName}{/if}
                            {/if}
                        </td>
                        <td align="center" class="style2">{$mysellbilldetailData@index+1}</td>
                    </tr>
                    {/foreach}
                </table>
                <table width="100%" border="0" cellpadding="" >
                    <tr>
                        <td colspan="9" align="center" bgcolor="#B4B4B4" class="style2 style1"><strong>المردودات</strong></td>
                    </tr>
                    <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 {$billsettingsData[64]->billsettingsvalue} eq 0} {else} style="display:none" {/if}>الكمية</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"    {/if}>الباركود</td>
                        <td width="50%" align="center" bgcolor="#B4B4B4" class="style4">اسم المنتج</td>
                        <td align="right" bgcolor="#B4B4B4" class="style4">م </td>
                    </tr>
                    {foreach $ruternbilldetailData as $myruternbilldetailData}
                    <tr>
                        <td align="center" class="style2 style1"> {$myruternbilldetailData->sellbilldetailtotalprice} </td>
                        <td align="center" class="style2 style1"{if {$billsettingsData[23]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>

                            {$myruternbilldetailData->discountvalue} </td>
                        <td align="center" class="style2 style1">{$myruternbilldetailData->sellbilldetailprice}</td>
                        <td align="center" class="style2 style1" {if {$billsettingsData[64]->billsettingsvalue} eq 0} {else} style="display:none" {/if}> {$myruternbilldetailData->sellbilldetailquantity} </td>
                        <td align="center" class="style2 style1"{if {$billsettingsData[21]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>&nbsp;{$myruternbilldetailData->unitName} </td>
                        <td align="center" class="style2 style1"{if {$billsettingsData[7]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>&nbsp;{$myruternbilldetailData->note}</td>
                        <td align="center" class="style2 style1"{if {$billsettingsData[20]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>

                            {$myruternbilldetailData->parcode} </td>
                        <td align="right" class="style2 style1"> {$myruternbilldetailData->productName}/{$myruternbilldetailData->productCatName}
                            {if {$billsettingsData[79]->billsettingsvalue} eq 0}
                            {if isset($myruternbilldetailData->sizeName) && $myruternbilldetailData->sizeName !=""}/{$myruternbilldetailData->sizeName}{/if}
                            {if isset($myruternbilldetailData->colorName) && $myruternbilldetailData->colorName !=""}/{$myruternbilldetailData->colorName}{/if}
                            {/if}
                        </td>
                        <td align="center" class="style2">{$myruternbilldetailData@index+1}</td>
                    </tr>
                    {/foreach}
                </table>
                <hr style="margin: 2px">

                <table width="100%" border="0" cellpadding="2" >
                    <tr>


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

                        {if {$billsettingsData[19]->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="9%" align="center" bgcolor="#B4B4B4">ضريبة الخصم</td>
                        {/if}

                        {if {$billsettingsData[31]->billsettingsvalue} eq 0}
                        <td width="8%" align="center" bgcolor="#B4B4B4" >
                            <table style="width:10px!important " class="table-black" >
                                <tr >
                                    <td  nowrap> قيمه الضريبه</td>
                                    <td   nowrap > % الضريبه</td>


                                </tr>


                            </table></td>

                        {/if}
                        {if  $sellbillandruternData->extraDiscountVal > 0 && $billsettingsData[90]->billsettingsvalue == 1 && $billnameAddData->extraDiscountPlace == 0}
                        <td width="8%" align="center" bgcolor="#B4B4B4">خصم اضافى</td>
                        {/if}
                        {if  {$sellbillandruternData->sellbilldiscount} > 0}

                        <td width="8%" align="center" bgcolor="#B4B4B4" {if {$billsettingsData[47]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>قيمة الخصم</td>
                        <!--<td width="5%" align="center" bgcolor="#B4B4B4">نوع الخصم</td>-->
                        {/if}
                        {if  $sellbillandruternData->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="10%" align="center" bgcolor="#B4B4B4" class="style1">عدد البيع</td>
                        <td width="10%" align="center" bgcolor="#B4B4B4" class="style1">الاجمالي</td>
                        <td width="10%" align="center" bgcolor="#B4B4B4" class="style1">اجمالي مردود</td>
                        <td width="10%" align="center" bgcolor="#B4B4B4" class="style1">اجمالي بيع</td>
                    </tr>
                    <tr>


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

                        <!--الباقي-->
                        {if {$billsettingsData[55]->billsettingsvalue} eq 0}
                        <td align="center" class="style1">{$sellbillandruternData->sellbillfinalbill}</td>
                        {/if}

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


                        <!--الصافي-->
                        {if {$billsettingsData[28]->billsettingsvalue} eq 0}
                        <td align="center" class="style1">{$sellbillandruternData->sellbillaftertotalbill} </td>
                        {/if}
                        {if $billnameAddData->taxOfDiscountPrint eq 0}
                        <td align="center" class="style1">{$sellbillandruternData->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% "> {$totaltax}</td>

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

                                </tr>

                            </table>
                        </td>
                        {/if}

                        {if  $sellbillandruternData->extraDiscountVal > 0 && $billsettingsData[90]->billsettingsvalue == 1 && $billnameAddData->extraDiscountPlace == 0}
                        <td align="center" class="style1">
                            {$sellbillandruternData->extraDiscountVal}
                        </td>
                        {/if}
                        {if  {$sellbillandruternData->sellbilldiscount} > 0}
                        <td align="center" class="style1" {if {$billsettingsData[47]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>
                            {if $sellbillandruternData->sellbilldiscounttype eq 2}(%{$sellbillandruternData->sellbilldiscount}){/if} {$discountvalue}</td>
                        <!--                        <td align="center" class="style1"> {if {$sellbillandruternData->sellbilldiscounttype} eq 1}
                                                    مباشر
                                                    {else}
                                                    بنسبة
                                                    {/if} </td>-->
                        {/if}
                        {if  $sellbillandruternData->extraDiscountVal > 0 && $billsettingsData[90]->billsettingsvalue == 1 && $billnameAddData->extraDiscountPlace == 1}
                        <td align="center" class="style1">
                            {$sellbillandruternData->extraDiscountVal}
                        </td>
                        {/if}
                        <td align="center" class="style1"> {if {$sellbillandruternData->returnsellQuantity} <= 0}
                            {$returnQuantity}
                            {else}
                            {$sellbillandruternData->returnsellQuantity}
                            {/if} </td>
                        <td align="center" class="style1"> {if {$sellbillandruternData->sellQuantity} <= 0}
                            {$sellQuantity}
                            {else}
                            {$sellbillandruternData->sellQuantity}
                            {/if} </td>
                        <td align="center" class="style1">{$sellbillandruternData->sellbilltotalbill}</td>

                        <td align="center" class="style1">{$sellbillandruternData->returnsellbillprice}</td>
                        <td align="center" class="style1">{$sellbillandruternData->sellbillprice}</td>
                    </tr>
                </table>

                <table width="100%">
                    <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->phone}
                                {else}
                                {$branchData->mobile}
                                {/if}
                            </strong></th>
                        <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>

                {else}



                <table  width="97%" border="0" align="center" cellpadding="0" cellspacing="0" class="table-black" style="margin-bottom: 10px">
                    <tr {if $billsettingsData[72]->billsettingsvalue == 2}style="display:none;"{/if}>
                        <td width="851" height="" align="left" valign="middle">&nbsp;</td>
                        <td width="1614" colspan="2" align="right" valign="top">
                            {if $billsettingsData[72]->billsettingsvalue == 0 || $userData->branchId == 0 || $userData->branchId == -1}
                            <img src="../views/default/images/upload/{$Programsettingdata->logo}" alt="" width="122" height="65"><br>
                            {$Programsettingdata->phone}
                            {else}
                            <img src="../views/default/images/branch_image/{$branchData->logo}" alt="" width="122" height="65"><br>
                            {$branchData->mobile}
                            {/if}
                            <br>
                        </td>
                    </tr>
                </table>
                <table width="50%;float:right" align="right" style="direction: rtl">
                    <tr {if {$billsettingsData[15]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                        <td  align="right">
                            <span>رقم عمليه السداد:</span>
                            <span>{$sellbillandruternData->sellbillid}</span>
                        </td>
                    </tr>

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

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

                </table>
                <table width="45%;float:left" align="right" style="direction: rtl">


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

                    {if {$billsettingsData[27]->billsettingsvalue} eq 0}
                    <tr  >
                        <td  align="right">
                            <span> المخزن:</span>
                            <span> {$sellbillandruternData->storeName}</span>
                        </td>
                    </tr>
                    {/if}


                </table>

                <!-- <table width="100%" align="right">
                    <tr {if $billsettingsData[70]->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>
                </table> -->
                <table style="width:100%">
                    <td>
                        <h3 style="text-align:center;color:#333;margin: 0">المبيعات</h3>
                    </td>
                </table>

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

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


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

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

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


                        <td align="center" {if {$billsettingsData[64]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}> العدد</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 $sellbilldetailData as $mysellbilldetailData}
                    <tr>
                        <td >{$mysellbilldetailData@index+1}</td>
                        <td {if {$billsettingsData[20]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>

                            {$mysellbilldetailData->parcode}

                        </td>


                        <td>

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

                        </td>


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

                            {$mysellbilldetailData->note}

                        </td>


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

                            {$mysellbilldetailData->unitName}

                        </td>



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

                            {$mysellbilldetailData->sellbilldetailquantity}

                        </td>


                        <td>

                            {$mysellbilldetailData->sellbilldetailprice} {$currency}

                        </td>

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

                            {$mysellbilldetailData->discountvalue}

                        </td>


                        <td>

                            {$mysellbilldetailData->sellbilldetailtotalprice}

                        </td>





                    </tr>

                    {/foreach}

                </table>
                <table width="100%" >
                    <tr>  <td  align="center" colspan="8" style="background:#CCCCCC"> المردودات </td></tr>
                </table>

                <table width="100%" border="0" cellpadding="0" cellspacing="0" dir="rtl" class="table-black  data-border" style="margin-bottom: 10px">

                    <tr >
                        <td align="center">م</td>
                        <td align="center"{if {$billsettingsData[20]->billsettingsvalue} eq 0} {else}  style="display:none"    {/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[10]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if} >الوحدة</td>


                        <td align="center">العدد</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 $ruternbilldetailData as $myruternbilldetailData}
                    <tr>
                        <td >{$myruternbilldetailData@index+1}</td>
                        <td {if {$billsettingsData[20]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>

                            {$myruternbilldetailData->parcode}

                        </td>


                        <td>

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

                        </td>


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

                            {$myruternbilldetailData->note}

                        </td>


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

                            {$myruternbilldetailData->unitName}

                        </td>




                        <td>

                            {$myruternbilldetailData->sellbilldetailquantity}

                        </td>

                        <td>

                            {$myruternbilldetailData->sellbilldetailprice} {$currency}

                        </td>

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

                            {$myruternbilldetailData->discountvalue}

                        </td>


                        <td>

                            {$myruternbilldetailData->sellbilldetailtotalprice}

                        </td>





                    </tr>

                    {/foreach}

                </table>

                <table width="50%" border="0" align="left" cellpadding="0" cellspacing="0"  dir="rtl" class="td  data-border">
                    <tr {if {$billsettingsData[58]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>
                        <td>عدد القطع المباعه</td>
                        <td>
                            {if {$sellbillandruternData->sellQuantity} <= 0}
                            {$sellQuantity}
                            {else}
                            {$sellbillandruternData->sellQuantity}
                            {/if}
                        </td>
                    </tr>

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

                        </td>
                    </tr>

                    <tr>
                        <td>اجمالي فاتورة البيع</td>
                        <td>{$sellbillandruternData->sellbillprice}</td>
                    </tr>
                    <tr>
                        <td>اجمالي المرتجع</td>
                        <td>{$sellbillandruternData->returnsellbillprice}</td>
                    </tr>
                    <tr>
                    <tr>
                        <td>اجمالي الفاتوره</td>
                        <td>{$sellbillandruternData->sellbilltotalbill}</td>
                    </tr>

                    {if  {$sellbillandruternData->sellbilldiscount} > 0}
                    <!--                    <tr {if {$billsettingsData[23]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>
                                            <td>نوع الخصم</td>
                                            <td>
                                                {if {$sellbillandruternData->sellbilldiscounttype} eq 1}
                                                مباشر
                                                {else}
                                                بنسبة
                                                {/if}
                                            </td>
                                        </tr>-->




                    <tr {if {$billsettingsData[47]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>
                        <td>قيمه الخصم</td>
                        <td>   {$discountvalue} {if $sellbillandruternData->sellbilldiscounttype eq 2}(%{$sellbillandruternData->sellbilldiscount}){/if}</td>
                    </tr>

                    {/if}
                    {if  $sellbillandruternData->extraDiscountVal > 0 && $billsettingsData[90]->billsettingsvalue == 1 && $billnameAddData->extraDiscountPlace == 0}
                    <tr>
                        <td>خصم اضافى</td>
                        <td>{$sellbillandruternData->extraDiscountVal}</td>
                    </tr>
                    {/if}

                    {if {$billsettingsData[31]->billsettingsvalue} eq 0}
                    <tr>
                        <td> ضريبه القيمة المضافة</td>
                        <td> {$totaltax}{$Programsettingdata->currancy} ({$sellbillandruternData->tax}%) </td>
                    </tr>
                    {/if}
                    {if $billnameAddData->taxOfDiscountPrint eq 0}
                    <tr>
                        <td> ضريبه الخصم </td>
                        <td>{$sellbillandruternData->taxOfDiscountVal}</td>
                    </tr>
                    {/if}


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

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


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

                    {if {$billsettingsData[19]->billsettingsvalue} eq 0}
                    <tr >
                        <td>إجمالى المديونيه</td>
                        <td>{$sellbillandruternData->sellbilltotaldeptafter} {$currency}</td>
                    </tr>
                    {/if}

                </table>
                <div style="clear:both"></div>

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