<!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: 0mm;
                    margin-right:0mm; /* for compatibility with both A4 and Letter */
                }
                #printdiv{
                    margin-top:{$billsettingsData[82]->billsettingsvalue}mm; /* user margin */
                }
            }
            html {
                -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            }

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



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

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

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

            .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;
                font-weight: bold;
                -webkit-print-color-adjust: exact;
                -moz-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            .bill-head{
                background-color: #fff!important;
                border:1px solid #fff!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;
                font-weight:700;
                -webkit-print-color-adjust: exact;
                -moz-print-color-adjust: exact;
                print-color-adjust: exact;

            }
            .hidden{
                display: none;
            }
        </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">
            <div id="page-wrap">

                <div {if $billsettingsData[69]->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">{$returnsellbillData->returnsellbillid}</span>
                </div>


                <div class="info info-bill" style="-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>{$sellbillData->sellbillid}</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> {$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" style="width:50%;display: inline-block;{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" >
                        <h3 style="width:20%; display: inline-block;text-align: center;">التاريخ:</h3>
                        <span>{$returnsellbillData->returnsellbilldate}</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>{$returnsellbillData->tempclientName}</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[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>{$returnsellbillData->employeename}</span>
                    </div>

                    <div class="head" {if {$billsettingsData[101]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                        <h3 style="width:20%; display: inline-block;text-align: center;">عملية الفاتورة:</h3>
                        <span>{$returnsellbillData->billoperationName}</span>
                    </div>
                    <div class="head">
                        <h3 style="width:20%; display: inline-block;text-align: center;">المستخدم:</h3>
                        <span>{$billUserData->employeename}</span>
                    </div>
                    <div class="head" {if {$billsettingsData[22]->billsettingsvalue} eq 0}  {else} style="display:none !important" {/if}>
                        <h3 style="width:20%; display: inline-block;text-align: center;">التعليق:</h3>
                        <span>{$returnsellbillData->comment}</span>
                    </div>



                </div>

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

                <div class="">
                    <h3>المردودات</h3>
                    <table id="items" style="">

                        <thead class="red">
                            <tr>
                                <td align="right" bgcolor="#B4B4B4" class="style4">م </td>
                                <th>اسم الصنف </th>
                                <th {if {$billsettingsData[64]->billsettingsvalue} eq 0} {else} style="display:none" {/if}>العدد</th>
                                <th class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}">السعر</th>
                                <th class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}">الاجمالى</th>
                            <tr>
                        </thead>
                        <tbody>
                            {foreach $returnsellbilldetailData as $myreturnsellbilldetailData}
                            <tr class="item-row">
                                <td align="center" class="style2">{$returnsellbilldetailData@index+1}</td>

                                <td><span>{$myreturnsellbilldetailData->productName}/ {$myreturnsellbilldetailData->productCatName}
                                        {if {$billsettingsData[79]->billsettingsvalue} eq 0}
                                        {if isset($myreturnsellbilldetailData->sizeName) && $myreturnsellbilldetailData->sizeName !=""}/{$myreturnsellbilldetailData->sizeName}{/if}
                                        {if isset($myreturnsellbilldetailData->colorName) && $myreturnsellbilldetailData->colorName !=""}/{$myreturnsellbilldetailData->colorName}{/if}
                                        {/if}
                                    </span></td>
                                <td {if {$billsettingsData[64]->billsettingsvalue} eq 0} {else} style="display:none" {/if}><span>{$myreturnsellbilldetailData->returnsellbilldetailquantity}</span></td>
                                <td class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}"><span>{$myreturnsellbilldetailData->returnsellbilldetailprice}</span></td>
                                <td class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}"><span >{$myreturnsellbilldetailData->returnsellbilldetailtotalprice}</span></td>
                            </tr>
                            {/foreach}
                        </tbody>
                        <tfoot class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}">
                            <tr class="item-row">

                                <td colspan="2"><span>الاجمالى</span></td>
                                <td><span>
                                        {$quantity}
                                    </span></td>
                                <td></td>
                                <td><span >{$returnsellbillData->returnsellbilltotalbill} {$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>
                                <td  style=""></td>
                                <th><span>الصافى</span></th>
                                <td><span >{$returnsellbillData->returnsellbillaftertotalbill} {$currency}</span></td>
                            </tr>
                        </tfoot>
                    </table>

                    <table id="items" class="{if $Usergroupdata->hideBillPrices == 1}hidden{/if}" 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>الرصيد قبل :{$returnsellbillData->returnsellbilltotaldeptbefor} {$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>الرصيد بعد :{$returnsellbillData->returnsellbilltotaldeptafter} {$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;{if $billsettingsData[81]->billsettingsvalue == 1}display:none{/if}">
                    <h5>تصميم شركة جى تى فور   01110070882 </h5>
                </div>

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

</html>