<!DOCTYPE html>
<html>
<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
    <!-- Optional theme -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css">

    
    
    

    <style>
        table.table {
            width:100%;
            margin:0;
            background-color: #ffffff;
        }

        table.order-bank {
            width:100%;
            margin:0;
        }
        table.order-bank th{
            padding:5px;
        }
        table.order-bank td {
            padding:5px;
            background-color: #ffffff;
        }
        tr.row-line th {
            border-bottom-width:1px;
            border-top-width:1px;
            border-right-width:1px;
            border-left-width:1px;
        }
        tr.row-line td {
            border-bottom:none;
            border-bottom-width:1px;
            font-size:8pt;
        }
        th.first-cell {
            text-align:left;
            border:1px solid red;
            color:blue;
        }
        div.order-field {
            width:100%;
            backgroundr: #ffdab9;
            border-bottom:1px dashed black;
            color:black;
        }
        div.blank-space {
            width:100%;
            height: 50%;
            margin-bottom: 100px;
            line-height: 10%;
        }
    </style>
</head>
<body>

<table border="0" cellpadding="0" class="table">

    <tr>
        
        <td width="100%"><h1 style="text-align: center; font-size:20pt; color: #bf6030"><strong><?php echo get_company_name(); ?></strong></h1></td>

    </tr>
    <tr>
        <td colspan="3"><span style="line-height: 100%; text-align:center; font-family:times;font-weight:bold;font-size:15pt;color:black;"><?php echo get_company_address(); ?></span></td>
    </tr>
    <hr style="height: 2px">


</table>

<div class="row"></div>
<div class="row"></div>

<div>
    <table style="width:100%" class="table">
        <tr>
            <td style="width:10%"></td>
            <td style="width:80%">
                <table style="width:100%" class="table order-bank">
                    <thead>
                    <tr>
                        <td style="width:100%; border-bottom-width:1px;" colspan="2"><span style="text-align:center; border: #000000; font-family:times;font-weight:bold;font-size:15pt;color:#000000; "><?php echo $item->name; ?> : From <?php echo \Carbon\Carbon::parse($fromdate)->format('d/m/Y'); ?> To <?php echo \Carbon\Carbon::parse($todate)->format('d/m/Y'); ?></span></td>
                    </tr>
                    </thead>
                </table>
            </td>
            <td style="width:10%"></td>
        </tr>
    </table>
</div>









<?php if(!empty($data)): ?>

    <div class="container">
        <table class="table order-bank" width="100%" cellpadding="2">

            <thead>
            <tr class="row-line">
                <th width="10%" style="text-align: left; font-size: 10px">Date</th>
                <th width="10%" style="text-align: left; font-size: 10px">Ref No</th>
                <th width="40%" style="text-align: left; font-size: 10px">Description</th>
                <th width="20%" style="text-align: right; font-size: 10px">In</th>
                <th width="20%" style="text-align: right; font-size: 10px">Out</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td colspan="3" style="font-weight: bold; font-size: 8px">Opening Balance</td>
                <td align="right" style="font-weight: bold; font-size: 8px "><?php echo number_format($openingqty,2); ?></td>
                <td style="font-weight: bold; font-size: 8px"><?php echo $item->unit_name; ?></td>
            </tr>

            <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr class="row-line" style="line-height: 200%">
                    <td width="10%"><?php echo \Carbon\Carbon::parse($row->tr_date)->format('d/m/Y'); ?></td>
                    <td width="10%"><?php echo $row->refno; ?></td>
                    <td width="40%"><?php echo $row->reftype; ?></td>
                    <td width="20%" align="right"><?php echo $row->received; ?></td>
                    <td width="20%" align="right"><?php echo $row->delevered; ?></td>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
            <tfoot>
            <tr>
                <td colspan="3" style="font-weight: bold; font-size: 8px">Periodic Total</td>
                <td align="right" style="font-weight: bold; font-size: 8px"><?php echo $periodsum->received; ?></td>
                <td align="right" style="font-weight: bold; font-size: 8px"><?php echo $periodsum->delevered; ?></td>
            </tr>
            <tr>
                <td colspan="4" style="font-weight: bold; font-size: 8px">Current Balance</td>
                <td align="right" style="font-weight: bold; font-size: 8px"><?php echo number_format($balance,2); ?><?php echo $item->unit_name; ?></td>
            </tr>
            </tfoot>

        </table>
    </div>

<?php endif; ?>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</body>
</html>
