<!DOCTYPE html>
<html>

    <head>
        <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />

        <!--<title >طباعة الفاتوره</title>-->

        <style>
            html {
                font-size: 10px;
                -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: #333;
                background-color: #fff;
            }

            tfoot tr td {
                border: 0;
                padding: 6px;
            }

            @media print {
                #items th {
                    background: #c8e3f5 !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-bill {
                width: 40%;

            }

            .info-table {
                width: 30%;
                float: left;
                margin-top: 2px
            }

            .info-table {
                clear: both;
                margin-top: 0 !important
            }

            .info-table .foot {
                background-color: #c8e3f5
            }

            .info-table {

                -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: #c8e3f5;
                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: #c8e3f5 !important;
                color: #000 !important;
                -webkit-print-color-adjust: exact;
                -moz-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            .red th {
                font-size: 13px
            }

            table td,
            table th {
                border: 1px solid #9c9999;
                -webkit-print-color-adjust: exact;
                -moz-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            .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;
            }

            .head table td {
                text-align: right;
                border: 0
            }

            .head {
                display: block;
                border: 1px solid #000;
                border-radius: 20px;
                margin: 29px 0 0;
                padding: 5px;
                position: relative;

            }

            .head h2 {
                position: absolute;
                top: -20px;
                background-color: #fff;
                padding: 5px 10px;
                color: #000;
                z-index: 99999999;
                font-size: 16px;
                right: 50px;
            }
        </style>

        {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 class="clear:both">
                    <table style="width: 30%;float:right">
                        <tr style="background-color: #d4d4d4;">
                            <td>
                                <h3 style="height:24px;line-height:21px;padding-right: 5px;font-size:17px;">
                                    مرتجع مبيعات</h3>
                            </td>
                        </tr>

                    </table>
                    <table style="width: 30%;float:left">
                        <tr>
                            <td>
                                <h3
                                    style="height:24px;line-height:21px;display: inline-block;padding-right: 5px;font-size:17px">
                                    مؤسسة رفعت علام للحديد والبويات</h3>
                            </td>
                        </tr>

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

                <div class="head" style="margin-bottom: 10px;">
                    <h2>رقم {$returnsellbillData->returnsellbillid}</h2>
                    <table style="width: 50%;float:right;text-align: start;border: 0;">
                        <tr>
                            <td>
                                <h3 style="height:24px;line-height:27px;display: inline-block;padding-right: 5px">
                                    رقم العميل: <span>{$returnsellbillData->returnsellbillclientid}</span></h3>

                            </td>

                        </tr>
                        <tr>
                            <td>
                                <h3 style="height:24px;line-height:27px;display: inline-block;padding-right: 5px">
                                    اسم العميل: <span> {$returnsellbillData->tempclientName}</span></h3>
                            </td>

                        </tr>
                        <tr></tr>
                        <td>
                            <h3 style="height:24px;line-height:27px;display: inline-block;padding-right: 5px">
                                ملاحظات: <span>{$returnsellbillData->comment} </span></h3>
                        </td>

                        </tr>
                    </table>
                    <table style="width: 50%;float:right">
                        <tr>
                            <td>
                                <h3 style="height:24px;line-height:27px;display: inline-block;padding-right: 5px">
                                    التاريخ: <span> {$returnsellbillData->returnsellbillsysdate}</span></h3>
                        </tr>
                        <tr>
                            <td>
                                <h3 style="height:24px;line-height:27px;display: inline-block;padding-right: 5px">
                                    ت: <span> </span></h3>
                            </td>
                        </tr>
                    </table>
                    <div style="clear:both"></div>


                </div>



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

                <div class="">
                    <table id="items" style="margin-bottom:5px;margin-top: 20px;">
                        <thead class="red">
                            <tr>
                                <th>م </th>
                                <th>كود الصنف</th>
                                <th>اسم الصنف</th>
                                <th>الكمية</th>
                                <th>السعر</th>
                                <th>الإجمالى</th>
                            <tr>
                        </thead>
                        {assign var=i value=1}
                        {foreach $returnsellbilldetailData as $myreturnsellbilldetailData}
                        <tbody>
                            <tr class="item-row">
                                <td class=""><span>{$i}</span></td>
                                <td class=""><span>{$myreturnsellbilldetailData->parcode}</span></td>
                                <td><span>{$myreturnsellbilldetailData->productName}/{$myreturnsellbilldetailData->productCatName}</span></td>
                                <td><span>{$myreturnsellbilldetailData->returnsellbilldetailquantity}</span></td>
                                <td><span>{$myreturnsellbilldetailData->returnsellbilldetailprice}</span></td>
                                <td><span>{$myreturnsellbilldetailData->returnsellbilldetailtotalprice}</span></td>
                            </tr>
                        </tbody>
                        {/foreach}
                        <tfoot>
                            <tr class="item-row">
                                <td colspan="3"><span></span></td>
                                <td>
                                    <span style="border:1px solid #000;display: block;
                                          padding: 5px 0;">{if {$returnsellbillData->returnsellQuantity} <= 0}
                                        {$quantity}
                                        {else}
                                        {$returnsellbillData->returnsellQuantity}
                                        {/if}</span>
                                </td>
                                <td colspan="1"><span> المجموع </span></td>
                                <td><span style="border:1px solid #000;display: block;
                                          padding: 5px 0;">{$returnsellbillData->returnsellbilltotalbill}</span></td>
                            </tr>

                        </tfoot>

                    </table>

                    <div class="tfoot" style="border-radius: 10px;border:1px solid #000;
                         padding: 5px">
                        <div style="width: 10%;float: right;margin-right: 70%;">قيمة المرتجع</div>
                        <div style="width: 16.5%;float: left;">
                            <span style="border:1px solid #000;display: block;
                                  padding: 5px 0;text-align: center;">{$returnsellbillData->returnsellbillaftertotalbill}</span>
                        </div>
                        <div style="clear:both"></div>
                    </div>
                </div>
                <!-- style="background-color:#f5f5f5;-webkit-print-color-adjust: exact; -moz-print-color-adjust: exact; print-color-adjust: exact;" -->


                <div style="margin-top: 30px;">

                    <div class="" style="width: 100%;text-align: center;float: right;">
                        <h2>{$totalWritten}</h2>
                    </div>


                </div>

            </div>
        </div>


    </div>



    <div id="terms" style="position: fixed;
         bottom: 0px;
         margin-top: 30px;
         margin-left: 10px;
         width: 97%;
         text-align: center;
         color: #444;
         font-size: 12px;
         text-decoration: uppercase;
         padding: 4px 0px 17px;
         margin-bottom: 0;
         display: flex;
         justify-content: space-between;">
        <div></div>
        <h4 class="display:inline-block">1/1</h4>
        <h4 style="text-align: left;color:#676767"> وقت الطباعة <br><span>{$todayTime}</span> </h4>
    </div>

</div>

</body>

</html>