<!DOCTYPE html>
<html >

    <head>
        <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
        <title>GT4</title>
        <!--<title >طباعة الفاتوره</title>-->

        <style>
            @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 */
                }
            }

            html {
                font-size: 10px;
                -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            }

            body {
                font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
                font-size: 12px;
                line-height: 1.42857143;
                color: #333;
                background-color: #fff;
            }



            @media print {
                #items th {
                    background: #fff!important;
                }
            }

            * { margin: 0; padding: 0; }
            #page-wrap { width:98%; margin: 0 auto; }

            table { border-collapse: collapse; }
            table td, table th {
                padding: 3px 11px 3px;
                vertical-align: middle;
                text-align: center;}

            .info-table{ width:30%;float: left;margin-top:2px}
            .info-table{ clear:both;margin-top: 0!important}
            .info-table .foot{ background-color:#fff}
            .info-table {
                border:1px solid #008bd2;
                -webkit-print-color-adjust: exact;
                -moz-print-color-adjust: exact;
                print-color-adjust: exact;
                margin-top: 10px
            }
            .info-table .head{ border-bottom:1px solid #008bd2}
            .info-table .head h3{
                display: inline-block;
                border-left:1px solid #008bd2;
                width:30%;
                background-color: #fff;
                padding-right: 5px}

            .info-table .head h3{
                background-color: transparent;
                width:40%
            }

            .border{ border:1px solid #008bd2}
            table{ width:100%}
            #items { clear: both; width: 100%; margin:0; border:1px solid #9c9999;
                     -webkit-print-color-adjust: exact;
                     -moz-print-color-adjust: exact;
                     print-color-adjust: exact;
            }

            .red{
                background-color:#fff!important;
                color:#000!important;
                -webkit-print-color-adjust: exact;
                -moz-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            .red th{ font-size: 13px}
            /*@media print,(max-width: 991px){
                table.info{ width:100%!important;margin-bottom: 10px}
            }*/
            table td, table th {
                border:1px solid #9c9999;
                -webkit-print-color-adjust: exact;
                -moz-print-color-adjust: exact;
                print-color-adjust: exact;
                padding: 1px;
            }

            .bill-head{
                background-color: #008bd2!important;
                border:1px solid #008bd2!important;
                -webkit-print-color-adjust: exact;
                -moz-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            .bg-grey{
                background-color:#e0e0e0!important;
                -webkit-print-color-adjust: exact;
                -moz-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            .foot-color{
                color: #008ed3;
                font-weight: bold;
                -webkit-print-color-adjust: exact;
                -moz-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            table span{
                color:#444;
                -webkit-print-color-adjust: exact;
                -moz-print-color-adjust: exact;
                print-color-adjust: exact;
            }


        </style>
        <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>
        {/literal}
    </head>

    <body  dir='rtl' onLoad="printDiv()">
        <div id="printdiv">
            <strong>
                <div id="page-wrap" style="margin-top: 30px">
                    <table width='100%'>
                        <tr {if $billsettingsData[70]->billsettingsvalue == 0}{else}  style="display:none"{/if}>

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

                        </tr>

                    </table>
                    <!-- <div {if $billsettingsData[70]->billsettingsvalue == 0}{else}  style="display:none"{/if} id="header" class="bill-head" style="height: 10px;width: 100%;border: 1px solid #008bd2;text-align: center;color: white;font: bold 15px ;text-decoration: uppercase;padding:5px 0px 10px; margin-bottom: 5px"> {$billnameAddData->name} </div> -->


                    <div style="{if $Programsettingdata->clientserial eq 1}display:none{/if}border:1px solid #ddd;border-radius:30px;padding:5px;background-color:#f5f5f5;-webkit-print-color-adjust: exact; -moz-print-color-adjust: exact; print-color-adjust: exact;">
                        <div style="width:50%;text-align:center;display:inline-block;font-weight:bold">
                            رقم الفاتورة:
                        </div>
                        <span style="font-weight:bold">{$sellbillandruternData->sellbillid}</span>
                    </div>


                    <div class="info info-bill" style="direction:rtl;-webkit-print-color-adjust: exact; -moz-print-color-adjust: exact; print-color-adjust: exact;margin-top: 10px;margin-bottom:10px">
                        <!--div class="head" >
                            <h3 style="width:20%; display: inline-block;text-align: center;">رقم الفاتورة:</h3>
                            <span>{$sellbillandruternData->sellbillid}</span>
                        </div-->
                        <div class="head" >
                            <h3 style="width:20%; display: inline-block;text-align: center;">التاريخ:</h3>
                            <span>{$sellbillandruternData->sellbilldate}</span>
                        </div>
                        <!--div class="head" >
                            <h3 style="width:20%; display: inline-block;text-align: center;">كاشير:</h3>
                            <span> صهيب</span>
                        </div-->
                        <div class="head" {if {$billsettingsData[16]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                            <h3 style="width:20%; display: inline-block;text-align: center;">العميل:</h3>
                            <span>{$sellbillandruternData->tempclientName}</span>
                        </div>
                        <div class="head" style="width:50%;float:right;{if $billsettingsData[72]->billsettingsvalue == 2}display:none;"{/if}">
                            <h3 style="width:41%; display: inline-block;text-align: center;">تليفون:</h3>
                            <span>
                                {if $billsettingsData[72]->billsettingsvalue == 0 || $userData->branchId == 0 || $userData->branchId == -1}
                                {$Programsettingdata->phone}
                                {else}
                                {$branchData->mobile}
                                {/if}
                            </span>
                        </div>
                        <!--div class="head" style="width:49%;float:right">
                            <h3 style="width:41%; display: inline-block;text-align: center;"> ت2 </h3>
                            <span> 2032698</span>
                        </div-->
                        <div class="head" {if $billsettingsData[72]->billsettingsvalue == 2}style="display:none;"{/if}>
                            <h3 style="width:20%; display: inline-block;text-align: center;{if $billsettingsData[72]->billsettingsvalue == 2}display:none;{/if}">اسم الشركة:</h3>
                            <span> {$Programsettingdata->companyname}</span>
                        </div>
                        <div class="head" {if $billsettingsData[72]->billsettingsvalue == 2}style="display:none;"{/if}>
                            <h3 style="width:20%; display: inline-block;text-align: center;">العنوان:</h3>
                            <span>
                                {if $billsettingsData[72]->billsettingsvalue == 0 || $userData->branchId == 0 || $userData->branchId == -1}
                                {$Programsettingdata->address}
                                {else}
                                {$branchData->branchAddress}
                                {/if}
                            </span>
                        </div>

                        <div class="head" {if {$billsettingsData[3]->billsettingsvalue} eq 0}{else}style="display:none"{/if}>
                            <h3 style="width:20%; display: inline-block;text-align: center;">  ال{if $Programsettingdata->delegate_seller eq 0} بائع {elseif $Programsettingdata->delegate_seller == 1}مندوب {elseif $Programsettingdata->delegate_seller == 2}طبيب {/if}:</h3>
                            <span>{$sellbillandruternData->employeename}</span>
                        </div>



                    </div>

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

                    <div class="">
                        <h3 style="text-align:center">المبيعات</h3>
                        <table id="items" style="">

                            <thead class="red">
                                <tr>
                                    <th style="width:40%">اسم الصنف </th>
                                    <th {if {$billsettingsData[64]->billsettingsvalue} eq 0} {else} style="display:none" {/if}>العدد</th>
                                    <th>السعر</th>
                                    <th>الاجمالى</th>
                                <tr>
                            </thead>
                            <tbody>
                                {foreach $sellbilldetailData as $sellbilldetail}
                                <tr class="item-row">
                                    <td><span>{$sellbilldetail->productName}/ {$sellbilldetail->productCatName}
                                            {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}
                                        </span></td>
                                    <td {if {$billsettingsData[64]->billsettingsvalue} eq 0} {else} style="display:none" {/if}><span>{$sellbilldetail->sellbilldetailquantity}</span></td>
                                    <td><span>{$sellbilldetail->sellbilldetailprice}</span></td>
                                    <td><span >{$sellbilldetail->sellbilldetailtotalprice}</span></td>
                                </tr>
                                {/foreach}
                            </tbody>
                            <tfoot>
                                <tr class="item-row">
                                    <th><span>الاجمالى</span></th>
                                    <td {if {$billsettingsData[64]->billsettingsvalue} eq 0} {else} style="display:none" {/if}><span>
                                            {$sellQuantity}
                                        </span></td>
                                    <td></td>
                                    <td><span >{$sellbillandruternData->sellbillprice} {$currency}</span></td>
                                </tr>
                                <!--tr class="item-row">
                                    <td  style="border-right:1px solid transparent!important;border-left:1px solid transparent!important;border-bottom:1px solid transparent!important"></td>
                                    <td  style="border-right:1px solid transparent!important;border-bottom:1px solid transparent!important"></td>
                                    <th><span>الصافى</span></th>
                                    <td><span >{$sellbillData->sellbillaftertotalbill} {$currency}</span></td>
                                </tr-->
                            </tfoot>
                        </table>
                        <h3 style="text-align:center">المردودات</h3>
                        <table id="items" style="">

                            <thead class="red">
                                <tr>
                                    <th style="width:40%">اسم الصنف </th>
                                    <th {if {$billsettingsData[64]->billsettingsvalue} eq 0} {else} style="display:none" {/if}>العدد</th>
                                    <th>السعر</th>
                                    <th>الاجمالى</th>
                                <tr>
                            </thead>
                            <tbody>
                                {foreach $ruternbilldetailData as $sellbilldetail}
                                <tr class="item-row">
                                    <td><span>{$sellbilldetail->productName}/ {$sellbilldetail->productCatName}
                                            {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}
                                        </span></td>
                                    <td {if {$billsettingsData[64]->billsettingsvalue} eq 0} {else} style="display:none" {/if}><span>{$sellbilldetail->sellbilldetailquantity}</span></td>
                                    <td><span>{$sellbilldetail->sellbilldetailprice}</span></td>
                                    <td><span >{$sellbilldetail->sellbilldetailtotalprice}</span></td>
                                </tr>
                                {/foreach}
                            </tbody>
                            <tfoot>
                                <tr class="item-row">
                                    <th><span>الاجمالى</span></th>
                                    <td {if {$billsettingsData[64]->billsettingsvalue} eq 0} {else} style="display:none" {/if}><span>
                                            {$returnQuantity}
                                        </span></td>
                                    <td></td>
                                    <td><span >{$sellbillandruternData->returnsellbillprice} {$currency}</span></td>
                                </tr>
                                <!--tr class="item-row">
                                    <td  style="border-right:1px solid transparent!important;border-left:1px solid transparent!important;border-bottom:1px solid transparent!important"></td>
                                    <td  style="border-right:1px solid transparent!important;border-bottom:1px solid transparent!important"></td>
                                    <th><span>الصافى</span></th>
                                    <td><span >{$sellbillData->sellbillaftertotalbill} {$currency}</span></td>
                                </tr-->
                            </tfoot>
                        </table>

                        <table id="items" style="border-top:1px solid #444;margin-top:20px;margin-bottom:10px">

                            <tbody>
                                <tr class="item-row">
                                    {if {$billsettingsData[18]->billsettingsvalue} eq 0}
                                    <td style="border:1px solid transparent!important"><span>الرصيد قبل :{$sellbillandruternData->sellbilltotaldeptbefor} {$currency}</span></td>
                                    <td style="border:1px solid transparent!important"><span> </span></td>
                                    {/if}
                                    {if {$billsettingsData[19]->billsettingsvalue} eq 0}
                                    <td style="border:1px solid transparent!important"><span>الرصيد بعد :{$sellbillandruternData->sellbilltotaldeptafter} {$currency}</span></td>
                                    <td style="border:1px solid transparent!important"><span ></span></td>
                                    {/if}
                                </tr>


                            </tbody>

                        </table>




                    </div>



                    <div id="terms" style="
                         text-align: center;
                         color: #444;
                         {if $billsettingsData[81]->billsettingsvalue == 1}display:none{/if}">
                        <h5>تصميم شركة جى تى فور   01110070882 </h5>
                    </div>

                </div>
            </strong>
        </div>
    </body>

</html>