
<html dir="rtl">
    <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 */
                }
            }
            .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 td
        {
            border-right-widtd: 1px;
            border-bottom-widtd: 1px;

            border-bottom-color: #999;
            font-size: 15px;
            border-right-color: #999;
        }
        .NEE
        {
            font-size: 14px;
        }
        .newdesign
        {
            font-size: 14px;
        }
        .copywrites
        {
            font-size: 11px;
        }
        table.border-data td{border:1px solid #000;text-align: center}
        td{font-size: 13px;}
        table.td td{
            text-align: center
        }

    </style>
    {/literal}
    <body onLoad="printDiv()">
        <div id="printdiv"  >
            <div width="{if {$billsettingsData[25]->billsettingsvalue} eq 0}420  {else} 250{/if}" >
                <table width="100%" dir="rtl" {if $billsettingsData[72]->billsettingsvalue == 2}style="display:none;"{/if}>
                    <tr>

                        <td width="142" colspan="2" align="right" valign="top"><p><strong><img src="../views/default/images/upload/{$Programsettingdata->logo}" alt="" width="122" height="75"><br>
                                    {$Programsettingdata->phone}<br>
                                </strong>
                            </p>
                        </td>
                    </tr>
                </table>
                <!--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="100%" dir="rtl">


                    <tr class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}" {if {$billsettingsData[18]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                        <td >
                            <span> الدين قبل :</span>
                            <span> {$returnsellbillData->returnsellbilltotaldeptbefor}  {$currency}</span>
                        </td>

                    </tr>


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

                    </tr>
                    <tr  {if {$billsettingsData[61]->billsettingsvalue} eq 0&&$Programsettingdata->clientserial == 1}  {else} style="display:none !important" {/if}>
                        <td >
                            <span> رقم  الفاتورة :</span>
                            <span> {$returnsellbillData->returnsellbillid}</span>
                        </td>

                    </tr>
                    <tr>
                        <td >
                            <span>تاريخ البيان : </span>
                            <span>{$returnsellbillData->returnsellbillsysdate}</span>
                        </td>

                    </tr>

                    {if {$Programsettingdata->saveprinting} eq 1}
                    <tr>
                        <td >
                            <span>اسم المخزن :</span>
                            <span>{$returnsellbillData->storeName} </span>
                        </td>

                    </tr>
                    {/if}
                    <tr>
                        <td >
                            <span>اسم المستخدم :</span>
                            <span>{$billUserData->employeename} </span>
                        </td>

                    </tr>
                    <tr {if {$billsettingsData[101]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                        <td >
                            <span>  عملية الفاتورة:</span>
                            <span>{$returnsellbillData->billoperationName} </span>
                        </td>

                    </tr>
                    <tr {if {$billsettingsData[22]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                        <td >
                            <span>التعليق :</span>
                            <span>{$returnsellbillData->comment} </span>
                        </td>

                    </tr>

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

                    <tr>
                        <td align="center" >رقم المسلسل </td>
                        <td align="center"{if {$billsettingsData[59]->billsettingsvalue} eq 0} {else}  style="display:none"    {/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" bgcolor="#E8E8E8"  {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"    {/if} >الخصم</td>
                        <td class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}" align="center"> الاجمالى</td>
                    </tr>
                    {foreach $returnsellbilldetailData as $myreturnsellbilldetailData}
                    <tr>
                        <td>1</td>
                        <td {if {$billsettingsData[59]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                            {$myreturnsellbilldetailData->parcode}
                        </td>
                        <td>
                            {$myreturnsellbilldetailData->productName}{if {$billsettingsData[60]->billsettingsvalue} eq 0}/{$myreturnsellbilldetailData->productCatName}{/if}
                            {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[53]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                            {$myreturnsellbilldetailData->unitName}
                        </td>
                        <td {if {$billsettingsData[64]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>
                            {$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}>
                            {$myreturnsellbilldetailData->discountvalue}
                        </td>
                        <td class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}">
                            {$myreturnsellbilldetailData->returnsellbilldetailtotalprice}
                        </td>
                    </tr>
                    {/foreach}
                    <tfoot class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}" style="background-color: #f5f5f5!important">
                        <tr class="item-row">
                            <td >الاجمالى</td>
                            <td {if {$billsettingsData[59]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                            </td>
                            <td></td>
                            <td {if {$billsettingsData[7]->billsettingsvalue} eq 0}  {else}  style="display:none !important"  {/if}>
                                {$myreturnsellbilldetailData->note}
                            </td>
                            <td {if {$billsettingsData[53]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                            </td>

                            <td><span {if {$billsettingsData[64]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>
                                    {if {$returnsellbillData->returnsellQuantity} <= 0}
                                    {$quantity}
                                    {else}
                                    {$returnsellbillData->returnsellQuantity}
                                    {/if}
                                </span></td>
                            <td  {if {$Programsettingdata->scunitname} eq '0'}  hidden {/if}>
                            </td>

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


                        </tr>
                    </tfoot>

                </table>

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

                    <!-- <tr>
                        <td>اجمالي الفاتوره</td>
                        <td>{$returnsellbillData->returnsellbilltotalbill}</td>
                    </tr>
                    <tr {if {$billsettingsData[23]->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"    {/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 {if {$billsettingsData[52]->billsettingsvalue} eq 0} {else} style="display:none" {/if}>
                        <td>الصافى</td>
                        <td>{$returnsellbillData->returnsellbillaftertotalbill} {$currency}</td>
                    </tr>
                    <!--{*/if*}-->

                    <tr {if {$billsettingsData[54]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>
                        <td>المدفوع</td>
                        <td> {$returnsellbillData->returnsellbilltotalpayed} {$currency}</td>
                    </tr>
                    <tr {if {$billsettingsData[55]->billsettingsvalue} eq 0} {else}  style="display:none"    {/if}>
                        <td>المتبقى</td>
                        <td>{$returnsellbillData->returnsellbillfinalbill}{$currency}</td>
                    </tr>
                    {if {$returnsellbillData->returnsellbilltotaldeptafter} <> 0}
                    <tr {if {$billsettingsData[19]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                        <td>إجمالى المديونيه</td>
                        <td>{$returnsellbillData->returnsellbilltotaldeptafter}  {$currency}</td>
                    </tr>
                    {/if}


                </table>
                <div style="clear:both"></div>
                <table style="width:50%;float:left">
                    {if {$billsettingsData[43]->billsettingsvalue} eq 0}

                    <tr>

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

                    </tr>
                    <tr>
                        <td><br></td>
                    </tr>

                    {/if}
                </table>
                <div style="clear:both"></div>
                <p style="text-align: center;margin: 0;font-size:14px;{if $billsettingsData[72]->billsettingsvalue == 2}display:none;{/if}"><strong>{$Programsettingdata->address}</strong></p>
                <p style="text-align: center;margin: 0;font-size: 14px;{if $billsettingsData[81]->billsettingsvalue == 1}display:none{/if}"><span >تصميم شركة جي تي فور 01110070882</span></p>

            </div>
    </body>