
<?php $__env->startSection('content'); ?>
<form action="<?php echo e(route('report.purchases')); ?>" method="POST">
    <div class="row">
        <div class="col-sm-6">
            <?php echo csrf_field(); ?>
            <div class="row">
                <div class="form-group col-md-4">
                    <label><?php echo e(__('messages.start_date')); ?></label>
                    <input type="text" class="form-control datepickr" name="sdate"
                        value="<?php echo e($sdate); ?>">
                </div>
                <div class="form-group col-md-4 ">
                    <label><?php echo e(__('messages.end_date')); ?></label>
                    <input type="text" class="form-control datepickr" name="edate"
                        value="<?php echo e($edate); ?>">
                </div>
                <div class="col-md-4">
                    <button class="btn btn-primary mt-20" type="submit"> <?php echo e(__('messages.submit')); ?></button>
                </div>
            </div>
        </div>
    </div>
</form>
<div class="row">
    <div class="col-12">
        <hr><br>
    </div>
</div>
<div class="row">
    <div class="col-md-12">
        <table class="table MyTable">
            <thead>
                <tr>
                    <th class="text-center"> # </th>
                    <th class="text-center"> <?php echo e(__('messages.date/time')); ?> </th>
                    <th class="text-center"> <?php echo e(__('messages.invoice')); ?> </th>
                    <th> <?php echo e(__('messages.total')); ?> </th>
                </tr>
            </thead>
            <tbody>
                <?php
                    $total = 0;
                ?>
                <?php $__currentLoopData = $purchases; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pur): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td class="text-center"><?php echo e($loop->iteration); ?></td>
                        <td class="text-center"><?php echo e($pur->dated); ?></td>
                        <td class="text-center"><a href="#" id="<?php echo e($pur->invoice); ?>" data-toggle="modal" data-target="#pinvoice-details"><?php echo e($pur->invoice); ?></a></td>
                        <td><?php echo e($pur->sub_total); ?></td>
                    </tr>
                    <?php
                        $total += $pur->sub_total;
                    ?>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

            </tbody>
            <tfoot>
                <tr>
                    <th>&nbsp;</th>
                    <th>&nbsp;</th>
                    <th>&nbsp;</th>
                    <th><?php echo e(formatAmount($total)); ?></th>
                </tr>
            </tfoot>
        </table>
    </div>
</div>

<div id="pinvoice-details" class="modal fade" role="dialog">
    <div class="modal-dialog modal-lg">
        <!-- Modal content-->
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="modal-close" data-dismiss="modal">
                    <i class="font-icon-close-2"></i>
                </button>
                <h4 class="modal-title"><?php echo e(__('messages.invoice')); ?> : <span id="invoice_number"></span></h4>
            </div>
            <div class="modal-body" id="sinvoice-mbody">

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo e(__('messages.close')); ?></button>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('customjs'); ?>
<script src="<?php echo e(asset('custom_js/reports.js')); ?>"></script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.template.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/craftada/iftikhar.appssoul.com/resources/views/admin/report_purchases.blade.php ENDPATH**/ ?>