<link href="<?php echo THEME_PATH; ?>css/style.css" rel="stylesheet" type="text/css"/>
<link href="<?php echo THEME_PATH; ?>css/style-responsive.css" rel="stylesheet"> 
<!--
< ?php
if (empty($ReturnItem['Main']["Return_ID"])) { ?>
<div class="alert alert-danger" role="alert">
<button class="close" data-dismiss="alert"></button>
<strong>Danger: </strong>you can not edit this view retrun! 
<br>
This return is not available.
</div>
< ?php die(); }  ?>
-->
<style type="text/css">
    .ValSpan{
        opacity:0;
    }
    .inv-info{
        font-size: 15px;
        font-weight: bold;
    }
    .border-div{
        border: 2px solid #000;
        border-style: dotted;
        padding: 10px;
        border-right:0;
        border-left:0;
        border-top:0;
    }
    .border-tr{
        border: 2px solid #000;
        border-style: dotted;
        padding: 12px;
        border-bottom:0;
        border-left:0;
        border-top:0;
    }
    .border-td{
        border: 2px solid #000;
        border-style: dotted;
        padding: 10px;
        border-bottom:0;
        border-top:0;
    }
    .border-table{
        border: 2px solid #000;
        border-style: dotted;
        border-right:0;
        border-left:0;
        margin-top:15px;
    }
    .table tbody tr td{
        /*line-height:12px;*/
    }
    .table thead tr th{
        background: #ddd;
    }
    h5{
        font-size:17px !important;
    }
    .phone-l{
        margin-left:1px !important;
    }
    .font-type-1{
        font-size:medium !important;
    }
    .font-type{
        font-size:large !important;
    }
    h5{
        line-height: 15px !important;
    }
    h4{
        line-height: 18px !important;
    }
    @media print {
        .table thead tr th{
            background: #ddd;
        }
        h5{
            font-size:17px !important;
        }
        img{
            max-width: 50% !important;
        }
        .table tbody tr td{
            /*line-height:20px;*/
            font-size:1.5em !important;
        }
        .phone-l{
            margin-left:1px !important;
        }.font-type-1{
            font-size:medium !important;
        }
        .font-type{
            font-size:x-large !important;
        }
        .footer{
            bottom:-90px;
            position:fixed;
        }	
    }
</style>
<div class="wrapper">
    <div class="panel invoice">
        <div class="panel-body">
            <div class="row">
                <div class="col-xs-4  m-b-10">
                    <h4 ><?php echo $org_details[0]["Organization_Legal_Name"] ?></h4>
                    <h4 class="phone-l"><?php echo $org_details[0]["Organization_Phone"] ?></h4>
                    <h5> <?php echo $org_details[0]["Name"] . '-' . $org_details[0]['Organization_Province'] ?></h5>
                    <h4 class="phone-l"><?php echo CommonLanguage::getMessage('reg_nb') ?>&nbsp;<?php echo $org_details[0]["Organization_Commercial_Registry"] ?></h4>
                    <h4 class="phone-l"><?php echo CommonLanguage::getMessage('Email') ?>:&nbsp;<?php echo $org_details[0]["Organization_Email"] ?></h4>
                </div>
                <div class="col-xs-4 text-center">
                    <img src="<?= upload_url;?>org_logo/invoice_logo.jpg" alt="" style="max-width:150px"/>
                </div>
                <div class="col-xs-4  m-b-10">
                    <h4 class="text-right"><?php echo $org_details[0]["Organization_Name"] ?></h4>
                    <h4 class="text-right"><?php echo $org_details[0]["Organization_Phone"] ?></h4>
                    <h5 class="text-right"><?php echo CommonLanguage::getMessage($org_details[0]["Name"], 'ar') . ' - ' . $org_details[0]["Organization_Street"] ?></h5>
                    <h4 class="text-right"> <?php echo CommonLanguage::getMessage('reg_nb', 'ar') ?>&nbsp;<?php echo $org_details[0]["Organization_Commercial_Registry"] ?></h4>
                </div>
            </div>
            <div class="col-xs-12 col-md-12 border-div">
                <div class="row">
                    <div class="col-xs-4 font-type m-t-70">
                        <?php print CommonLanguage::getMessage('Name'); ?>: <?php echo $From_Details[0][$IsVendor ? "Supplier_Name" : "Customer_Name"]; ?>
                        <br/><?php print CommonLanguage::getMessage('address'); ?>: <?php echo $From_Details[0][$IsVendor ? "Country_Name" : "Country_Name"] . '-' . $From_Details[0][$IsVendor ? "Name" : "Name"] . '-' . $From_Details[0][$IsVendor ? "Supplier_Address" : "Customer_Address"] ?>
                        <br/><?php print CommonLanguage::getMessage('Phone'); ?>: <?php echo $From_Details[0][$IsVendor ? "Supplier_Mobile" : "Customer_Mobile"] ?>
                    </div>
                    <div class="col-xs-4">
                        <h2 class="text-center"><?php echo CommonLanguage::getMessage('return_invoice') ?></h2>
                    </div>
                    <div class="col-xs-4 font-type m-t-70">
                        <div class="col-xs-4"><span> <?php echo CommonLanguage::getMessage('return_nb'); ?> </span></div><div class="col-xs-8"><span>&nbsp;<?php echo $ReturnItem['Main']['invoice_prefix'] . $ReturnItem['Main']["Return_ID"]; ?></span></div><br>
                        <div  class="col-xs-4"><span><?php print CommonLanguage::getMessage('Date'); ?>    </span></div><div class="col-xs-8"><span>&nbsp;<?php echo $ReturnItem['Main']['Date']; ?></span></div><br>
                        <div class="col-xs-4"> <span><?php print CommonLanguage::getMessage('Currency'); ?>        </span></div><div class="col-xs-8"><span>&nbsp;<?php echo $ReturnItem['Main']["Currency_Name"]; ?></span></div><br>
                    </div>
                </div>
                <br>
                <br>
                <table class="table  border-table">
                    <thead>
                        <tr class="border-div">
                            <th class="border-td text-center">No.</th>
                            <th  class="border-tr text-center"><?php print CommonLanguage::getMessage('Code'); ?></th>
                            <th class="border-tr text-center"><?php print CommonLanguage::getMessage('Item'); ?></th>
                            <th class="border-tr text-center"><?php print CommonLanguage::getMessage('qty'); ?></th>
                            <th class="border-tr text-center" ><?php print CommonLanguage::getMessage('Description'); ?></th>
                            <th class="border-tr print_delv text-center"><?php print CommonLanguage::getMessage('price'); ?></th>
                            <th class="border-tr print_delv text-center" ><?php print CommonLanguage::getMessage('disc'); ?></th>
                            <th class="border-tr print_delv text-center"><?php print CommonLanguage::getMessage('total'); ?></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php
                        for ($i = 0; $i < count($ReturnItem['Details']); $i++) {
                            $list = $ReturnItem['Details'][$i];
                        ?>
                        <tr>
                            <td class=" border-td text-center"><?php echo $i + 1; ?></td>
                            <td  class="border-tr text-center"><?php echo $list["Code"]; ?></td>
                            <td class="border-tr text-center"><?php echo $list["Name"]; ?></td>
                            <td class="border-tr text-center"><?php echo $list["Item_Quantity_Current"]; ?> </td>
                            <td class="border-tr text-center " ><?php echo $list["product_description"]; ?></td>
                            <td class="border-tr print_delv text-center"><span class='CurrencyIndicator'></span>&nbsp;<span class=""><?php echo Forms::DecimalNumber($list["Product_Net_Price"]); ?></span></td>
                            <td class="border-tr print_delv text-center"><span class='CurrencyIndicator'></span>&nbsp;<span class=""><?php echo Forms::DecimalNumber($list["Product_Discount"]); ?></span></td>
                            <td class="border-tr print_delv text-center"><span class='CurrencyIndicator'></span>&nbsp;<span class=""><?php echo Forms::DecimalNumber($list["Product_Total_Price"] + $list["vat_amount"]); ?></span> </td>
                        </tr>
                        <?php } ?>
                    </tbody>
                </table>
                <div class="row">
                    <div class="col-xs-4 font-type-1 col-md-offset-8">
                        <div class="col-xs-6"><span><?php echo CommonLanguage::getMessage('total') ?></span>:&nbsp;</div><?php echo Forms::DecimalNumber($ReturnItem['Main']["Net_Total"]); ?><br/>
                        <div class="col-xs-6"><span><?php echo CommonLanguage::getMessage('vat') . '(' . smc_session()['vat_percent'] . '%)' ?></span>:&nbsp;</div><?php echo Forms::DecimalNumber($ReturnItem['Main']["Invoice_VAT"]); ?><br/>
                        <div class="col-xs-6 "><span><?php echo CommonLanguage::getMessage('disc') ?></span>:&nbsp;</div><?php echo Forms::DecimalNumber($ReturnItem['Main']["Discount"]); ?><br/>
                        <div class="col-xs-6 "><span><strong><?php echo CommonLanguage::getMessage('net_total') ?></span>:</strong>&nbsp;</div><strong><?php echo Forms::DecimalNumber($ReturnItem['Main']["net"]); ?></strong>
                    </div>
                </div>
            </div>
            <br>
            <div class="col-xs-12">
                <div class="row">
                    <div class="col-xs-4">
                        <h4><strong><?php echo CommonLanguage::getMessage('receiver') ?>:</strong></h4>  &nbsp;
                    </div>
                    <div class="col-xs-4 pull-right">
                        <h4><strong><?php echo CommonLanguage::getMessage('signature') ?> :</strong></h4> &nbsp; 
                    </div>
                </div>
            </div>
            <div class="row no-print">
                <div class="col-md-12">
                    <div class="pull-right">
                        <a class="btn btn-danger" onclick="javascript:$('.print_delv').removeClass('no-print');javascript:window.print();"><i class="fa fa-print"></i> <?php print CommonLanguage::getMessage('print'); ?></a>
                        <a id="delivery_print_btn" class="btn btn-success-darker" onclick="javascript:$('.print_delv').addClass('no-print');window.print();"><i class="fa fa-print"></i> <?php print CommonLanguage::getMessage('print_delv'); ?></a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
