
<?php $__env->startSection('content'); ?>
    <div class="page-content">
        <div class="container-fluid">
            <div class="box-typical box-typical-padding">
                <h3 class="page-header"><?php echo e(pageTitle()); ?></h3>
                
                <div class="row">
                    <div class="col-md-3">
                        <section class="widget widget-simple-sm">
                            <div class="widget-simple-sm-statistic">
                                <div class="number"><?php echo e(formatAmount($sales['total'])); ?></div>
                                <div class="caption color-blue">Total Sales</div>
                            </div>
                        </section><!--.widget-simple-sm-->
                    </div>
                    <div class="col-md-3">
                        <section class="widget widget-simple-sm">
                            <div class="widget-simple-sm-statistic">
                                <div class="number"><?php echo e(formatAmount($purchases['total'])); ?></div>
                                <div class="caption color-blue">Total Purchases</div>
                            </div>
                        </section><!--.widget-simple-sm-->
                    </div>
                    <div class="col-md-3">
                        <section class="widget widget-simple-sm">
                            <div class="widget-simple-sm-statistic">
                                <div class="number"><?php echo e(formatAmount($expenses['total'])); ?></div>
                                <div class="caption color-blue">Total Expenses</div>
                            </div>
                        </section><!--.widget-simple-sm-->
                    </div>
                    <div class="col-md-3">
                        <section class="widget widget-simple-sm">
                            <div class="widget-simple-sm-statistic">
                                <div class="number"><?php echo e(formatAmount($sales['total']-($purchases['total']+$expenses['total']))); ?></div>
                                <div class="caption color-blue">Total Profit/ Loss</div>
                            </div>
                        </section><!--.widget-simple-sm-->
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-3">
                        <section class="widget widget-simple-sm">
                            <div class="widget-simple-sm-statistic">
                                <div class="number"><?php echo e(formatAmount($sales['monthly'])); ?></div>
                                <div class="caption color-blue">Monthly Sales</div>
                            </div>
                        </section><!--.widget-simple-sm-->
                    </div>
                    <div class="col-md-3">
                        <section class="widget widget-simple-sm">
                            <div class="widget-simple-sm-statistic">
                                <div class="number"><?php echo e(formatAmount($purchases['monthly'])); ?></div>
                                <div class="caption color-blue">Monthly Purchases</div>
                            </div>
                        </section><!--.widget-simple-sm-->
                    </div>
                    <div class="col-md-3">
                        <section class="widget widget-simple-sm">
                            <div class="widget-simple-sm-statistic">
                                <div class="number"><?php echo e(formatAmount($expenses['monthly'])); ?></div>
                                <div class="caption color-blue">Monthly Expenses</div>
                            </div>
                        </section><!--.widget-simple-sm-->
                    </div>
                    <div class="col-md-3">
                        <section class="widget widget-simple-sm">
                            <div class="widget-simple-sm-statistic">
                                <div class="number"><?php echo e(formatAmount($sales['monthly']-($purchases['monthly']+$expenses['monthly']))); ?></div>
                                <div class="caption color-blue">Monthly Profit/ Loss</div>
                            </div>
                        </section><!--.widget-simple-sm-->
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-3">
                        <section class="widget widget-simple-sm">
                            <div class="widget-simple-sm-statistic">
                                <div class="number"><?php echo e(formatAmount($sales['daily'])); ?></div>
                                <div class="caption color-blue">Daily Sales</div>
                            </div>
                        </section><!--.widget-simple-sm-->
                    </div>
                    <div class="col-md-3">
                        <section class="widget widget-simple-sm">
                            <div class="widget-simple-sm-statistic">
                                <div class="number"><?php echo e(formatAmount($purchases['daily'])); ?></div>
                                <div class="caption color-blue">Daily Purchases</div>
                            </div>
                        </section><!--.widget-simple-sm-->
                    </div>
                    <div class="col-md-3">
                        <section class="widget widget-simple-sm">
                            <div class="widget-simple-sm-statistic">
                                <div class="number"><?php echo e(formatAmount($expenses['daily'])); ?></div>
                                <div class="caption color-blue">Daily Expenses</div>
                            </div>
                        </section><!--.widget-simple-sm-->
                    </div>
                    <div class="col-md-3">
                        <section class="widget widget-simple-sm">
                            <div class="widget-simple-sm-statistic">
                                <div class="number"><?php echo e(formatAmount($sales['daily']-($purchases['daily']+$expenses['daily']))); ?></div>
                                <div class="caption color-blue">Daily Profit/ Loss</div>
                            </div>
                        </section><!--.widget-simple-sm-->
                    </div>
                </div>
                
                <div class="row">
                    <div class="col-md-12">
                        <table class="table table-bordered table-striped">
                            <thead>
                                <tr>
                                    <th>#</th>
                                    <th>Date/Time</th>
                                    <th>Branch</th>
                                    <th>Invoice</th>
                                    <th>Payment Type</th>
                                    <th>Sub Total</th>
                                    <th>Discount</th>
                                    <th>Grand Total</th>
                                    <th>Invoice</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $__currentLoopData = $lastTenSales; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $sale): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td><?php echo e($loop->iteration); ?></td>
                                        <td><?php echo e($sale->dated); ?></td>
                                        <td><?php echo e($sale->branch->branch_name); ?></td>
                                        <td><?php echo e($sale->invoice); ?></td>
                                        <td><?php echo e($sale->payment_type); ?></td>
                                        <td><?php echo e(formatAmount($sale->sub_total)); ?></td>
                                        <td><?php echo e(formatAmount($sale->discount)); ?></td>
                                        <td><?php echo e(formatAmount($sale->grand_total)); ?></td>
                                        <td><a href="<?php echo e(route('sales.invoice',['id'=>$sale->invoice])); ?>" target="_blank" class="text-primary"><i class="fa fa-print"></i></a></td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>

                        </table>
                    </div>
                </div>
            </div>
        </div><!--.container-fluid-->
    </div><!--.page-content-->
<?php $__env->stopSection(); ?>
<?php $__env->startSection('customjs'); ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.template.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\Freelance\BigWishes\work\resources\views/admin/dashboard.blade.php ENDPATH**/ ?>