<style>
    .main-div{
        border: solid 1px black !important;
    }
    th,td{
        border: solid 1px black !important;
        color:black !important;
    }
</style>
<div class="container-fluid container-fixed-lg">
    <div class="panel panel-default">
        <div class="panel-body">
            <div class="row">


            <div style="width: 100%;display: flex;justify-content: space-between;">
                   <div style="width: 35%;">
                <div> <?php echo $org_details['organiaztion_name_en'] ?></div>
                <div><?php echo CommonLanguage::getMessage('C.R No.: ') ?> <?php echo $org_details['org_cr_en'] ?></div>
                <div><?php echo CommonLanguage::getMessage('VAT N.:') ?> <?php echo $org_details['org_vat_en'] ?></div>
                <div><?php echo CommonLanguage::getMessage('Phone :') ?> <?php echo $org_details['org_phone_en'] ?></div>
                <div><?php echo CommonLanguage::getMessage('Address :') ?> <?php echo $org_details['org_address_en'] ?></div>
                
                
                   </div>
                   <div style="width: 30%;">  <img src="[[smc__upload_path]]org_logo/invoice_logo.jpg" alt="" style="max-width:150px"/> </div>
                   <div style="width: 35%;direction: rtl;">

                   <div> <?php echo $org_details['Organization_Name'] ?></div>
                   <div><?php echo CommonLanguage::getMessage('السجل التجاري') ?> <?php echo $org_details['Organization_Commercial_Registry'] ?></div>
                   <div><?php echo CommonLanguage::getMessage('الرقم الضريبي') ?> <?php echo $org_details['Organization_vat_num'] ?></div>
                   <div><?php echo CommonLanguage::getMessage('الهاتف') ?> <?php echo $org_details['Organization_Phone'] ?></div>
                   <div><?php echo CommonLanguage::getMessage('العنوان') ?> <?php echo $org_details['org_address_ar'] ?></div>
                    
                 
                  </div>

                </div>



                <div class="col-md-4 col-xs-4 pull-right main-div">
                    <div class="col-md-12 col-xs-12">
                        <div class="col-md-6 col-xs-6 bold"><?php echo CommonLanguage::getMessage('invoice_nb') ?></div>
                        <div class="col-md-6 col-xs-6 "><?php echo $data['main']['invoice_prefix'] . $data['main']['invoice_nb'] ?></div>
                    </div>
                    <div class="col-md-12 col-xs-12">
                        <div class="col-md-6 col-xs-6  bold"><?php echo CommonLanguage::getMessage('Date') ?></div>
                        <div class="col-md-6 col-xs-6 "><?php echo $data['main']['invoice_date'] ?></div>
                    </div>
                    <div class="col-md-12 col-xs-12 ">
                        <div class="col-md-6 col-xs-6 bold"><?php echo CommonLanguage::getMessage('Customer') ?></div>
                        <div class="col-md-6 col-xs-6 "><?php echo $data['main']['Customer_Name'] ?></div>
                    </div>
                    <div class="col-md-12 col-xs-12 ">
                        <div class="col-md-6 col-xs-6 bold"><?php echo CommonLanguage::getMessage('Employee') ?></div>
                        <div class="col-md-6 col-xs-6 "><?php echo $data['main']['Employee_Name'] ?></div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <h3 class="bold title-color"><?php echo CommonLanguage::getMessage('pumps') ?></h3>
                </div>
                <div class="col-md-12">
                    <table class="table table-bordered mytable">
                        <thead>
                        <th><?php echo CommonLanguage::getMessage('pump') ?></th>
                        <th><?php echo CommonLanguage::getMessage('old_counter') ?></th>
                        <th><?php echo CommonLanguage::getMessage('new_counter') ?></th>
                        <th><?php echo CommonLanguage::getMessage('diff') ?></th>
                        <th><?php echo CommonLanguage::getMessage('unit_price') ?></th>
                        <th><?php echo CommonLanguage::getMessage('vat') ?></th>
                        <th><?php echo CommonLanguage::getMessage('total') ?></th>

                        </thead>
                        <?php foreach ($data['pump'] as $pump) { ?>
                            <tr>
                                <td><?php echo $pump['pump_name'] ?></td>
                                <td><?php echo CommonFunctions::formatNumber($pump['old_counter']) ?></td>
                                <td><?php echo CommonFunctions::formatNumber($pump['new_counter']) ?></td>
                                <td><?php echo CommonFunctions::formatNumber($pump['counter_diff']) ?></td>
                                <td><?php echo CommonFunctions::formatNumber($pump['unit_price']) ?></td>
                                <td><?php echo CommonFunctions::formatNumber($pump['vat_amount']) ?></td>
                                <td><?php echo CommonFunctions::formatNumber($pump['total_price']) ?></td>
                            </tr>
                        <?php } ?>
                    </table>
                </div>
            </div>
            <?php if(!empty($data['coupon'])){?>
            <div class="row">
                <div class="col-md-12">
                    <h3 class="bold title-color"><?php echo CommonLanguage::getMessage('bone') ?></h3>
                </div>
                <div class="col-md-12">
                    <table class="table table-bordered mytable">
                        <thead>
                        <th><?php echo CommonLanguage::getMessage('bone_type') ?></th>
                        <th><?php echo CommonLanguage::getMessage('product') ?></th>
                        <th><?php echo CommonLanguage::getMessage('liters') ?></th>
                        <th><?php echo CommonLanguage::getMessage('unit_price') ?></th>
                        <th><?php echo CommonLanguage::getMessage('vat') ?></th>
                        <th><?php echo CommonLanguage::getMessage('total') ?></th>

                        </thead>
                        <?php foreach ($data['coupon'] as $coupon) { ?>
                            <tr>
                                <td><?php echo $coupon['bone_type_name'] ?></td>
                                <td><?php echo $coupon['Product_Name'] ?></td>
                                <td><?php echo CommonFunctions::formatNumber($coupon['current_quantity']) ?></td>
                                <td><?php echo CommonFunctions::formatNumber($coupon['unit_price']) ?></td>
                                <td><?php echo CommonFunctions::formatNumber($coupon['vat_amount']) ?></td>
                                <td><?php echo CommonFunctions::formatNumber($coupon['total_price']) ?></td>
                            </tr>
                        <?php } ?>
                    </table>
                </div>
            </div>
            <?php } if(!empty($data['products'])){?>
            <div class="row">
                <div class="col-md-12">
                    <h3 class="bold title-color"><?php echo CommonLanguage::getMessage('products') ?></h3>
                </div>
                <div class="col-md-12">
                    <table class="table table-bordered mytable">
                        <thead>
                        <th><?php echo CommonLanguage::getMessage('Code') ?></th>
                        <th><?php echo CommonLanguage::getMessage('product') ?></th>
                        <th><?php echo CommonLanguage::getMessage('Quantity') ?></th>
                        <th><?php echo CommonLanguage::getMessage('disc') . ' %' ?></th>
                        <th><?php echo CommonLanguage::getMessage('vat') ?></th>
                        <th><?php echo CommonLanguage::getMessage('unit_price') ?></th>
                        <th><?php echo CommonLanguage::getMessage('total') ?></th>

                        </thead>
                        <?php foreach ($data['products'] as $prod) { ?>
                            <tr>
                                <td><?php echo $prod['Product_Code'] ?></td>
                                <td><?php echo $prod['Product_Name'] ?></td>
                                <td><?php echo CommonFunctions::formatNumber($prod['current_quantity']) . ' ' . $prod['UOM_Name'] ?></td>
                                <td><?php echo CommonFunctions::formatNumber($prod['discount_percent']) ?></td>
                                <td><?php echo CommonFunctions::formatNumber($prod['vat_amount']) ?></td>
                                <td><?php echo CommonFunctions::formatNumber($prod['unit_price']) ?></td>
                                <td><?php echo CommonFunctions::formatNumber($prod['total_price']) ?></td>
                            </tr>
                        <?php } ?>
                    </table>
                </div>
            </div>
            <?php } ?>
            <div class="row">
                <div class="col-md-4 col-xs-4 pull-right">
                    <table class="table table-bordered mytable">

                        <tr>
                            <th><?php echo CommonLanguage::getMessage('pump_total') ?></th>
                            <td><?php echo CommonFunctions::formatNumber($data['main']['total_pump']) . ' ' . $data['main']['Currency_Symbol'] ?></td>
                        </tr>
                        <tr>
                            <th><?php echo CommonLanguage::getMessage('coupon_total') ?></th>
                            <td><?php echo CommonFunctions::formatNumber($data['main']['total_coupon']) . ' ' . $data['main']['Currency_Symbol'] ?></td>
                        </tr>
                        <tr>
                            <th><?php echo CommonLanguage::getMessage('products_total') ?></th>
                            <td><?php echo CommonFunctions::formatNumber($data['main']['total_prod']) . ' ' . $data['main']['Currency_Symbol'] ?></td>
                        </tr>
                        <tr>
                            <th><?php echo CommonLanguage::getMessage('VAT') ?></th>
                            <td><?php echo CommonFunctions::formatNumber($data['main']['total_vat']) . ' ' . $data['main']['Currency_Symbol'] ?></td>
                        </tr>
                        <tr>
                            <th><?php echo CommonLanguage::getMessage('overall') ?></th>
                            <td><?php echo CommonFunctions::formatNumber($data['main']['overall_total']) . ' ' . $data['main']['Currency_Symbol'] ?></td>
                        </tr>
                        <tr>
                            <th><?php echo CommonLanguage::getMessage('total_cash') ?></th>
                            <td><?php echo CommonFunctions::formatNumber($data['main']['total_cash']) . ' ' . $data['main']['Currency_Symbol'] ?></td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="col-md-12 no-print">
                    <div class="pull-right">
                        <a id="invoice_print_btn" class="btn btn-danger" onclick="javascript:window.print();"><i class="fa fa-print"></i>Print</a>
                    </div>
             
                </div>
        </div>
    </div>
</div>