<?php $__env->startSection('title', 'Journal Vouchers Dashboard'); ?>


<?php $__env->startSection('internal-js'); ?>
    <script>
        $(document).ready(function () {
            $('#insurers1').DataTable({
                dom: 'lBfrtip',
                buttons: [
                    { extend: 'excel', className: 'download-buttons'},
                ]
            });
            $('#jv-types').select2();
            $('#jv-statuses').select2();

            $('#date-from').on('change', function (){
                $('#date-to').attr('required', true);
            });
            $('#date-to').on('change', function (){
                $('#date-from').attr('required', true);
            });
        });
    </script>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('internal-css'); ?>
    <style>
        #insurers1 tr:nth-child(even) {
            background-color: #f2f2f2;
        }
        #insurers1 th, td {
            text-align: left;
            padding: 5px;
        }
        #insurers1 tr:hover {background-color: #d8d9e1;}
    </style>

<?php $__env->stopSection(); ?>


<?php $__env->startSection('headers'); ?>
    <?php echo $__env->make('headers.finance-header', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('heading', 'Journal Vouchers Dashboard'); ?>
<?php $__env->startSection('done-by', ''); ?>


<?php $__env->startSection('content'); ?>
    <div class="inputDivider" style="margin-top: 10px; text-align: left; background-color: lightcyan">
        <?php echo Form::open(['action'=>['Finance\JvsController@viewJvs'], 'method'=>'POST', 'id'=>'filter-report', 'class'=>'fields-small']); ?>

        <div class="guestDetails_input_right">
            <div class="guestDetails_inputLabel">
                &nbsp;
            </div>
            <div class="guestDetails_input_right">
                <button type="submit" name="search" style="cursor: pointer"><i class="fa fa-search" aria-hidden="true"></i></button>
            </div>
        </div>
        <div class="guestDetails_input_right">
            <div class="guestDetails_inputLabel">
                Jv Date To:<span class="error">*</span>
            </div>
            <div class="guestDetails_input_right">
                <?php echo Form::date('to', $search['to'] ?? null, ['id'=>'date-to','style'=>'cursor:pointer', 'class'=>'input-text-height']); ?>

            </div>
        </div>
        <div class="guestDetails_input_right">
            <div class="guestDetails_inputLabel">
                Jv Date From:<span class="error">*</span>
            </div>
            <div class="guestDetails_input_right">
                <?php echo Form::date('from',  $search['from'] ?? null, ['id'=>'date-from','style'=>'cursor:pointer', 'class'=>'input-text-height', 'required'=>true]); ?>

            </div>
        </div>
        <div class="guestDetails_input_right">
            <div class="guestDetails_inputLabel">
                Journal Voucher Status:<span class="error">*</span>
            </div>
            <div class="guestDetails_input_right">
                <select name="jv-status" id="jv-statuses" style="width: 130px">
                    <option value="all">ALL</option>
                    <option value="approved">Approved</option>
                    <option value="pending first approval">Pending First Approval</option>
                    <option value="pending second approval">Pending Second Approval</option>
                    <option value="declined">Declined</option>
                </select>
            </div>
        </div>
        <div class="guestDetails_input_right">
            <div class="guestDetails_inputLabel">
               Journal Voucher Type:<span class="error">*</span>
            </div>
            <div class="guestDetails_input_right">
                <select name="jv-type" id="jv-types" style="width: 150px">
                    <option value="all">ALL</option>
                    <option value="gl-gl">GL to GL JVs</option>
                    <option value="client-client">Client to Client JVs</option>
                    <option value="client-gl">Clients to GL JVs</option>
                </select>
            </div>
        </div>
        <div class="guestDetails_inputDividerNone" style="height: 0"></div>
        <?php echo Form::close(); ?>

    </div>

    <div class="guestDetails_inputDivider"></div>
    <!--View and Setup your Insurers-->
    <div>
        <!--Export Links/Buttons-->
        <table id="insurers1" style="width: 100%; border-collapse: collapse; ">
            <thead>
            <tr style="background-color: #a1b5d3">
                <th>No</th>
                <th>Entry No.</th>
                <th>Jv Type</th>
                <th>Dr Account</th>
                <th>Cr Account</th>
                <th>Amount</th>
                <th>Narration</th>
                <th>Entry Date</th>
                <th>Current Status</th>
                <th>Created By</th>
                <th>View</th>
            </tr>
            </thead>
            <tbody>
            <?php $__currentLoopData = $list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr>
                    <td class="ar"></td>
                    <td><b class="error">JV<?php echo e($row->id); ?></b></td>
                    <td><b><?php echo $row->jv_type; ?></b></td>
                    <td><?php echo e($row->acc_dr); ?></td>
                    <td><?php echo e($row->acc_cr); ?></td>
                    <td><?php echo number_format($row->amount,2); ?></td>
                    <td><?php echo $row->nar; ?></td>
                    <td><?php echo date('d/m/Y', strtotime($row->jv_date)); ?></td>
                    <td><b class="error"><?php echo strtoupper($row->jv_status); ?></b></td>
                    <td>
                        <?php if($row->user != null): ?>
                            <b><?php echo e($row->user->firstName." ".$row->user->lastName); ?></b>
                        <?php endif; ?>
                    </td>
                    <td><a href="<?php echo e(url('journal-voucher/'.$row->id)); ?>" class="inner"><i class="fa fa-eye error" style="font-size: 16px"></i></a></td>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
            <tfoot>
            <tr style="background-color: #a1b5d3">
                <th>No</th>
                <th>Entry No.</th>
                <th>Jv Type</th>
                <th>Dr Account</th>
                <th>Cr Account</th>
                <th>Amount</th>
                <th>Narration</th>
                <th>Entry Date</th>
                <th>Current Status</th>
                <th>Created By</th>
                <th>View</th>
            </tr>
            </tfoot>
        </table>
    </div>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('modal_heading'); ?>
    <h1>Journal Vouchers Dashboard</h1>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('modal_title'); ?>
    <h3><u>Dashboard Functionalities</u></h3>
    <b>
        <ol>
            <li>View all Journal Vouchers Items</li>
            <li>Filter through available Journal Vouchers to Generate Reports</li>
            <li>Export Journal Vouchers Report</li>
        </ol>
    </b>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\finewood\resources\views/finance/jvs/journal-vouchers.blade.php ENDPATH**/ ?>