<html dir="rtl">
    <head>

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

            }
            table.info tr{
                width:100%;
            }



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

            .table-black1 tbody>tr>td {

                vertical-align: middle;
                text-align: center;
                border: 1px solid #000;
            }

            .result,.result tr,.result tr td{
                border:1px solid #000
            }
            .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: 11px;
            }
            td{
                margin: 0!important
            }


        </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;
           padding: 0 2px

        }
        .td td
        {
            border-right-width: 1px;
            border-bottom-width: 1px;
            border-left-width: 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;
            padding: 0 2px
        }
        .NEE
        {
            font-size: 14px;
        }
        .newdesign
        {
            font-size: 14px;
        }
        .copywrites
        {
            font-size: 11px;
        }
    </style>
    <style>
        .td td
        {
            border-right-width: 1px;
            border-bottom-width: 1px;
            border-left-width: 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;
            padding: 0 2px
        }
        .NEE
        {
            font-size: 14px;
        }
        .newdesign
        {
            font-size: 14px;
        }
        .copywrites
        {
            font-size: 11px;
        }
        .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}
        td{font-size:13px; padding: 0 2px}
        .table-last td{border:1px solid #444;text-align: center}
    </style>
    {/literal}
    <body onLoad="printDiv()">
        <div  id="printdiv" >

            <b>
                {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 && $Programsettingdata->clientserial == 1} 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="center" 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" class="style1">{$billnameAddData->name}</h2>
                </div>
                <!-- end title -->
                <div style="clear:both"></div>

                <table width="100%"  align="right" cellpadding="0" cellspacing="0" class="table-black" style="margin-bottom: 10px;font-size:10px" >
                    <!--                    <tr >
                                              <td  align="right"  dir="rtl"><!--span class="style1 style2">{if $Programsettingdata->delegate_seller eq 0} بائع {elseif $Programsettingdata->delegate_seller == 1}مندوب {elseif $Programsettingdata->delegate_seller == 2}طبيب {/if} :{$sellbillData->employeename}</span</td>

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

                                        </tr>-->

                    <tr >
                        <td   style="padding: 2px" align="right"  nowrap width="" >
                            <span class="">التاريخ :</span>
                            <span>{$sellbillData->sellbilldate}</span>
                        </td>
                        <td   style="padding: 2px" align="right"  nowrap width="" >
                            <span>اسم المستخدم:</span>
                            <span> {$userData->employeename}</span>
                        </td>
                    </tr>

                </table>
                <!--                <table width="50%"  align="right" cellpadding="0" cellspacing="0" class="table-black" style="margin-bottom: 10px">

                                    <tr>
                                        <td colspan="2" align="right" style="padding: 3px;{if {$billsettingsData[16]->billsettingsvalue} eq 0}  {else} display:none !important; {/if}" nowrap >
                                            <span>السيد :</span>
                                            <span> {$sellbillData->tempclientName}</span>

                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" >
                                            <span>اسم المستخدم:</span>
                                            <span> {$billUserData->employeename}</span>
                                        </td>
                                    </tr>
                                </table>-->
                <div style="clear:both"></div>
                <!--<h4 style="text-align: center;margin: 0">فاتورة مبيعات</h4>-->
                <table width="100%" border="0" cellpadding="" cellspacing="" class="table-black1" style="direction: ltr">
                    <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"    {/if} >الخصم</td>
                        <td align="center" bgcolor="#B4B4B4" class="style4">السعر</td>
                        <td align="center" bgcolor="#B4B4B4" class="style4"  {if {$Programsettingdata->scunitname} eq '0'||$billsettingsData[67]->billsettingsvalue}  hidden {/if} >{$Programsettingdata->scunitname}</td>

                        <td align="center" bgcolor="#B4B4B4" class="style4" {if {$billsettingsData[46]->billsettingsvalue} eq 0} {else} style="display:none" {/if}>وقت اللعب</td><!--الكمية -->
                        <td align="center" bgcolor="#B4B4B4" class="style4" {if {$billsettingsData[46]->billsettingsvalue} eq 0} {else} style="display:none" {/if}>وقت النهاية</td><!--الكمية -->
                        <td align="center" bgcolor="#B4B4B4" class="style4" {if {$billsettingsData[46]->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" {/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 $sellbilldetail}
                    <tr>
                        <td align="center" class="style2 style-num"> {$sellbilldetail->sellbilldetailtotalprice} </td>
                        <td align="center" class="style2 style1"{if {$billsettingsData[23]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                            {if {$billsettingsData[34]->billsettingsvalue} eq 0}{$sellbilldetail->discountvalue} {else}  {$sellbilldetail->discounttype} {/if}
                        </td>
                        <td align="center" class="style2 style1">{$sellbilldetail->sellbilldetailprice} </td>
                        <td align="center" class="style2 style1" {if {$Programsettingdata->scunitname} eq '0'||$billsettingsData[67]->billsettingsvalue}  hidden {/if}>
                            {$sellbilldetail->otherdetailquantity}
                        </td>

                        <td align="center" class="style2 style1" {if {$billsettingsData[46]->billsettingsvalue} eq 0} {else} style="display:none" {/if}> {$sellbilldetail->duration} </td><!--الكمية -->
                        <td align="center" class="style2 style1" {if {$billsettingsData[46]->billsettingsvalue} eq 0} {else} style="display:none" {/if}> {$sellbilldetail->endTime} </td><!--الكمية -->
                        <td align="center" class="style2 style1" {if {$billsettingsData[46]->billsettingsvalue} eq 0} {else} style="display:none" {/if}> {$sellbilldetail->startTime} </td><!--الكمية -->

                        <td align="center" class="style2 style1"  {if {$billsettingsData[21]->billsettingsvalue} eq 0} {else} style="display:none" {/if}>{$sellbilldetail->unitName} </td>
                        <td align="center" class="style2 style1"{if {$billsettingsData[22]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>{$sellbilldetail->note} </td>
                        <td align="center" class="style2 style1"{if {$billsettingsData[20]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>{$sellbilldetail->parcode}</td>
                        <td align="right" class="style2 style1">{$sellbilldetail->productName}{if {$billsettingsData[60]->billsettingsvalue} eq 0}/{$sellbilldetail->productCatName} {/if}
                            {if {$billsettingsData[79]->billsettingsvalue} eq 0}
                            {if isset($sellbilldetail->sizeName) && $sellbilldetail->sizeName !=""}/{$sellbilldetail->sizeName}{/if}
                            {if isset($sellbilldetail->colorName) && $sellbilldetail->colorName !=""}/{$sellbilldetail->colorName}{/if}
                            {/if}
                            -
                            {if $sellbilldetail->priceIs == 0} فردى {else} زوجى {/if}
                        </td>
                        <td align="center" class="style2 style-num">{$sellbilldetail@index+1}</td>
                    </tr>
                    {/foreach}

                </table>
                <hr style="background-color: #000">
                {if isset($restaurantOrder->id) && $restaurantOrder->id > 0}
                <b>

                    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table-black">
                        {if $clientFlag == 1}
                        <tr>
                            <td width="5%" align="right">&nbsp;</td>
                            <td colspan="4" style="text-align: center;">

                                {if $delivery->clientmobile == 1}
                                {$client->clientmobile}
                                {/if}
                                {if $delivery->clientphone == 1}
                                {if $delivery->clientmobile == 1}
                                <br/>
                                {/if}
                                {$client->clientphone}
                                {/if}
                                <br/>
                                {$client->clientname}
                            </td>
                            <td width="5%" align="right">&nbsp;</td>
                        </tr>
                        <tr>
                            <td width="5%" align="right">&nbsp;</td>
                            <td class="rtl" colspan="4" nowrap style="text-align: center;">
                                {if $delivery->clientaddress == 1}
                                {$client->clientaddress}
                                {/if}
                                {if $delivery->clientdetails == 1}
                                {$client->clientdetails}
                                {/if}
                            </td>
                            <td width="5%" align="right">&nbsp;</td>
                        </tr>
                        {/if}
                        {if $restaurantOrder->billComment!=""}
                        <tr>
                            <td width="5%" align="right">&nbsp;</td>
                            <td class="rtl" colspan="4" nowrap style="text-align: center;">
                                {$restaurantOrder->billComment}
                            </td>
                            <td width="5%" align="right">&nbsp;</td>
                        </tr>
                        {/if}

                        <!--                        {if $restaurantOrder->tableId >0}
                                                <tr>


                                                    <td width="5%" align="right">&nbsp;</td>
                                                    <td  ><span class="style1 style2 rtl"></span></td>
                                                    <td width="10%" align="right">&nbsp;</td>

                                                    <td width="10%" align="right"></td>
                                                    <td class="rtl"   colspan="2" nowrap width="8%" align="right"><span class="style1 style2">طاولة :{$restaurantOrder->tableName}</span></td>
                                                </tr>
                                                {/if}
                                                <tr>


                                                    <td width="5%" align="right">&nbsp;</td>
                                                    <td  ><span class="style1 style2 rtl">سيريال :{$restaurantOrder->id}</span></td>
                                                    <td width="10%" align="right">&nbsp;</td>

                                                    <td width="10%" align="right"></td>
                                                    <td class="rtl"   colspan="2" nowrap width="8%" align="right"><span class="style1 style2">رقم الطلب:{$restaurantOrder->daySreial}</span></td>
                                                </tr>


                                                ---------الدين بعد -----------------

                                                <tr>
                                                    <td width="5%" align="right">&nbsp;</td>
                                                    <td  ><span class="style1 style2 rtl">{$restaurantOrder->sysdate}</span></td>
                                                    <td width="10%" align="right">&nbsp;</td>

                                                    <td width="10%" align="right"></td>
                                                    <td class="rtl"   colspan="2" nowrap width="8%" align="right"><span class="style1 style2">المستخدم :{$userData->employeename}</span></td>
                                                </tr>-->
                        <!-----------الدين بعد ------------------->
                        <tr>
                            <td colspan="6">
                                <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table-black1" dir="ltr">
                                    <tr>
                                        <td width="15%" align="center" bgcolor="#B4B4B4" class="style4">اجمالى</td>
                                        <td width="10%" align="center" bgcolor="#B4B4B4" class="style4">السعر</td>
                                        <td width="10%" align="center" bgcolor="#B4B4B4" class="style4">الكميه</td>
                                        <td width="50%" align="center" bgcolor="#B4B4B4" class="style4">الصــــــــنف</td>
                                        <td width="5%" align="right" bgcolor="#B4B4B4" class="style4"># </td>
                                    </tr>
                                    {assign var=i value=1}
                                    {assign var=total value=0}
                                    {foreach $restaurantOrderDetails as $product}
                                    <tr>
                                        {assign var=proTotal value=$product->quantity*$product->price}
                                        <td align="right" class="style2 style1">{$proTotal}</td>{*$product->total*}
                                        <td align="right" class="style2 style1">{$product->price}</td>
                                        <td align="right" class="style2 style1">{$product->quantity}</td>
                                        <td align="right" class="style2 style1">{$product->productName}</td>
                                        <td align="center" class="style2">{$i}</td>
                                    </tr>
                                    {assign var=total value=$total+$proTotal}
                                    {assign var=i value=$i+1}
                                    {/foreach}
                                </table></td>
                        </tr>
                        <tr>

                            <td colspan="6"><hr /></td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <table width="100%" border="0" cellpadding="2" cellspacing="7">
                                    <tr>
                                        {if $restaurantOrder->tax !=0||$restaurantOrder->discount !=0}
                                        <td width="8%" align="center" bgcolor="#B4B4B4">الصافى</td>
                                        {/if}
                                        {if $restaurantOrder->tax !=0}
                                        <td width="8%" align="center" bgcolor="#B4B4B4">{if $Programsettingdata->taxNameFlag == 1}خدمة{else}الضريبة{/if}</td>
                                        {/if}
                                        {if $restaurantOrder->discount !=0}
                                        <td width="8%" align="center" bgcolor="#B4B4B4">الخصم</td>
                                        {/if}
                                        <td width="10%" align="center" bgcolor="#B4B4B4" class="style1">الاجمالي</td>
                                    </tr>
                                    <tr>
                                        {if $restaurantOrder->tax !=0||$restaurantOrder->discount !=0}
                                        <td align="center" class="style1">{$total+$restaurantOrder->tax-$restaurantOrder->discount}{*$restaurantOrder->netBill*}</td>
                                        {/if}
                                        {if $restaurantOrder->tax !=0}
                                        <td align="center" class="style1">{$restaurantOrder->tax}</td>
                                        {/if}
                                        {if $restaurantOrder->discount !=0}
                                        <td align="center" class="style1">{$restaurantOrder->discount}</td>
                                        {/if}
                                        {if $restaurantOrder->discount !=0}

                                        {/if}
                                        <td align="center" class="style1">{$total}{*$restaurantOrder->totalBill*}</td>
                                    </tr>
                                    <tr {if $restaurantOrder->restaurantplaystationplayid > 0}{else} style="display:none"{/if}>

                                        <td colspan="4" align="center" bgcolor="#B4B4B4" class="style1" style="text-align: center;font-weight: bold">
                                            الاجمالى العام :
                                            {$total+$restaurantOrder->tax-$restaurantOrder->discount + $playstation->netPrice - $playstation->cardPayed}{*$restaurantOrder->netBill*}
                                        </td>
                                    </tr>
                                </table></td>
                        </tr>
                    </table>
                    <hr/>
                </b>
                {/if}
                <!-- footer -->
                <div style="text-align: center;{if $billsettingsData[81]->billsettingsvalue == 1}display:none{/if}">
                    <p><span class="copywrites">تصميم شركة جي تي فور 01110070882</span></p>
                </div>

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