<?php $__env->startSection('content'); ?>
<?php $__env->startSection('title','تقرير ملخص'); ?>
<section class="content-header">
	<h1>
        تقرير ملخص
        <small></small>
        <a class="btn print-window pull-right" href="javascript:void(0)" onclick="window.print()" role="button">
            <i class="fa fa-print" aria-hidden="true"></i>
        </a>
	</h1>
</section>
<section class="content">
	<div class="box box-primary">
		<?php echo $__env->make('layouts.partial.printHeader',['showCompanyData'=>true], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
        <div class="row">
            <div class="col-md-12">
                <div class="box">
                    <!-- /.box-header -->
                    <div class="box-body">
                        <div class="row">
                            <div class="col-md-8">
                                <p class="text-center">
                                    <strong><?php echo app('translator')->getFromJson('front.Summary Report'); ?></strong>
                                </p>
                                <table class="table table-bordered">
                                    <thead>
                                    <tr>
                                        <th><?php echo app('translator')->getFromJson('front.title'); ?></th>
                                        <th><?php echo app('translator')->getFromJson('front.total'); ?></th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr>
                                        <td><?php echo app('translator')->getFromJson('front.Total Purchases'); ?></td>
                                        <td>
                                            <div class="bg-yellow" style="padding: 5px;" >
                                                <?php echo e(currency($totalPurchases,currency()->config('default'), currency()->getUserCurrency(), $format = true)); ?>

                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td><?php echo app('translator')->getFromJson('front.totalorders'); ?></td>
                                        <td>
                                            <?php $__currentLoopData = $totalOrders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <div class="bg-green" style="<?php echo e(count($totalOrders)>1?'width: 48%;display: inline-block;':''); ?>padding: 5px;" ><?php echo e(currency($item['total']-$discountSum,$item['currency'], $item['currency'], $format = true)); ?></div>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td><?php echo app('translator')->getFromJson('front.Suppliersdebts'); ?></td>
                                        <td>
                                            <?php echo e(currency($supplierdue,currency()->config('default'), currency()->getUserCurrency(), $format = true)); ?>

                                        </td>
                                    </tr>
                                    <tr>
                                        <td><?php echo app('translator')->getFromJson('front.clients debts'); ?></td>
                                        <td>
                                            <?php echo e(currency($clientdue,currency()->config('default'), currency()->getUserCurrency(), $format = true)); ?>

                                        </td>
                                    </tr>
                                    <tr>
                                        <td><?php echo app('translator')->getFromJson('front.Inventory'); ?></td>
                                        <td>
                                            <?php echo e(currency(round($gard->totalCost,2), currency()->config('default'), currency()->getUserCurrency(),true)); ?>

                                        </td>
                                    </tr>
                                    <tr>
                                        <td><?php echo app('translator')->getFromJson('front.Cash'); ?></td>
                                        <td>
                                            <div style="padding: 5px;" class="bg-aqua">
                                            <?php echo e(currency(round($treasury,2), currency()->config('default'), currency()->getUserCurrency(),true)); ?>

                                            </div>
                                        </td>
                                    </tr>
                                    
                                    <tr>
                                        <td><?php echo app('translator')->getFromJson('front.Total budget'); ?></td>
                                        <td>
                                            <div style="padding: 5px;"  class=" bg-red">
                                                <?php echo e(currency($treasury + $clientdue  + $gard->totalCost - $supplierdue, currency()->config('default'), currency()->getUserCurrency(), $format = true)); ?>

                                            </div>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                            <!-- /.col -->
                            <div class="col-md-4">
                                <p class="text-center">
                                    <strong><?php echo app('translator')->getFromJson('front.bestseller'); ?></strong>
                                </p>
                                <table class="table table-bordered text-center">
                                    <thead>
                                    <tr>
                                        <th>#</th>
                                        <th><?php echo app('translator')->getFromJson('front.productsname'); ?></th>
                                        <th>الكمية</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <?php $__currentLoopData = $bestSeller; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <tr>
                                            <td><?php echo e($loop->iteration); ?></td>
                                            <td><?php echo e($item->name); ?></td>
                                            <td><?php echo e($item->total_qty); ?></td>
                                        </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </tbody>
                                </table>
                            </div>
                            <!-- /.col -->
                        </div>
                        <!-- /.row -->
                    </div>
                    <!-- ./box-body -->
                </div>
                <!-- /.box -->
            </div>
            <!-- /.col -->
        </div>
	</div>
</section>
<?php $__env->stopSection(); ?>
<?php $__env->startPush('css'); ?>
	<style>
	.progress-bar,.badge{
		width: 100%;
	}
	.badge {
		width: 100%;
		padding: 5px;
	}
	table,.badge,td {
		font-size: 14px !important;
		font-weight: bold !important;
	}
	@media  print {
		table,.badge,td,.bg-green,.bg-yellow,.bg-aqua,.bg-red {
			font-size: 18px !important;
			color: #0c0c0c!important;
		}

	}
	</style>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>