

<?php $__env->startSection('content'); ?>
<!-- Content wrapper scroll start -->
<div class="content-wrapper-scroll">

<!-- Content wrapper start -->
<div class="content-wrapper">

<div>
    <h4><strong><?php echo e($branch); ?></strong> DAILY SALES REPORT</h4>
</div>

        <!-- Row start -->
        <div class="row gutters">
            <div class="col-xl-4 col-lg-4 col-md-4 col-sm-6 col-12">
                <div class="stats-tile">
                    <div class="sale-icon">
                        <i class="icon-shopping-bag1"></i>
                    </div>
                    <div class="sale-details">
                        <h2><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format((float)$branch_total_general - (float)$deliveries, 2); ?></h2>
                        <p><strong>Net Sales</strong></p>
                    </div>
                </div>
            </div>
            <div class="col-xl-4 col-lg-4 col-md-4 col-sm-6 col-12">
                <div class="stats-tile">
                    <div class="sale-icon">
                        <i class="icon-shopping-bag1"></i>
                    </div>
                    <div class="sale-details">
                        <h2><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format($branch_total_house, 2); ?></h2>
                        <p><a href="">No Charge</a></p>
                    </div>
                </div>
            </div>
            <div class="col-xl-4 col-lg-4 col-md-4 col-sm-12 col-12">
                <div class="stats-tile">
                    <div class="sale-icon">
                        <i class="icon-check-circle"></i>
                    </div>
                    <div class="sale-details">
                        <h2><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format($branch_total_reject, 2); ?></h2>
                        <p><a href="#">Rejected Order / Returned Item</a></p>
                    </div>
                </div>
            </div>
        </div>
    <!-- ROW END -->

<!-- Row start -->
<div class="row">
    <div class="col-sm-4">
        <div class="card">
            <div class="card-body">
                <h5 class="card-title">Summary</h5>
                <p class="mb-3 text-light">view summary report on product, by item or product category</p>
                <a href="<?php echo e(route('departmentSummaryBranch', $branch)); ?>" class="btn btn-primary">Category</a>
                <a href="<?php echo e(route('itemSummaryBranch', $branch)); ?>" class="btn btn-primary">Item</a>
            </div>
        </div>
    </div>
    <div class="col-sm-4">
        <div class="card">
            <div class="card-body">
                <div class="list-group m-0">
                    <a href="#" class="list-group-item list-group-item-action" aria-current="true">
                        Confirmed Amount <strong><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?> <?php echo number_format($branch_total_general, 2); ?></strong>
                    </a>

                    <a href="#" class="list-group-item list-group-item-action" aria-current="true">
                        Unconfirmed Amount: <strong><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?> <?php echo number_format((float)$orders - (float)$branch_total_general, 2); ?></strong>
                    </a>
                    <a href="#" class="list-group-item list-group-item-action" aria-current="true">
                        Expected Amount: <strong><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format($orders, 2); ?></strong>
                    </a>
                    <a href="#" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModalFullScreen">
                    Discounts of <?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format($discounts, 2); ?>
                    </a>
                </div>
            </div>
        </div>
    </div>
    <div class="col-sm-4">
        <div class="card text-end">
            <div class="card-body">
                <h5 class="card-title">Accumulated Delivery Amount</h5>
                <p>Delivery Income</p>
                <?php if(auth()->user()->sales_person_category == "Delivery"): ?>
                <p class="mb-3 text-light">Delivery Amount: <?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format($deliveries, 2); ?></p>
                <?php endif; ?>

                <p>
                Delivery[Branch]: <?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format($deliveries, 2); ?>
                </p>
                <a href="#" class="btn btn-primary">Transactions</a>
            </div>
        </div>
    </div>
</div>
<!-- Row end -->




    <!-- Row start -->
    <div class="row gutters">
        <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
            
            <div class="card">
                <div class="card-body">
                    
                    <div class="table-responsive">
                    <table id="copy-print-csv" class="table v-middle">
                                <thead>
                                    <tr>
                                        <th>Order No.</th>
                                        <th>Ordered Date</th>
                                        <th>Product</th>
                                        <th>Quantity</th>												
                                        <th> Unit Price</th>
                                        <th>Department</th>
                                        <th>Total Price</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php $__currentLoopData = $sales_today_branch; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $list): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td>#<?php echo e($list->invoice_number); ?></td>
                                        <td><?php echo e($list->created_at); ?></td>
                                        <td>
                                        <?php echo e(@strtoupper($list->invoice_product_name)); ?>

                                        </td>
                                        <td>
                                            <?php echo e($list->invoice_quantity); ?>

                                        </td>
                                        <td><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format($list->invoice_unit_price, 2); ?></td>
                                        <td><?php echo e(@strtoupper($list->invoice_category)); ?></td>
                                        <td><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format($list->invoice_total_price, 2); ?></td>
                                    </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tbody>
                            </table>
                    </div>

                </div>
            </div>

        </div>
    </div>
    <!-- Row end -->




    <!-- on the house sales and rejected orders -->

        <!-- Row start -->
        <div class="row gutters">
        <div class="col-xl-6 col-lg-6 col-md-6 col-sm-6 col-12">

            <!-- Card start -->
            <div class="card">
                <div class="card-header">
                    <div class="card-title">No Charge</div>
                </div>
                <div class="card-body">
                    
                    <!-- Row start -->
                    <div class="row gutters">
                        <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12"> 
                        <div class="table-responsive">       
                        <table id="apiCallbacks" class="table custom-table">

                                <thead>
                                    <tr>
                                        <th>Invoice No.</th>	
                                        <th>Product</th>
                                        <th>Quantity</th>												
                                        <th> Unit Price</th>
                                        <th>Total Price</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php $__currentLoopData = $branch_total_house_list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $list): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td>
                                        <?php echo e($list->invoice_number); ?>

                                        </td>
                                        <td>
                                        <?php echo e($list->invoice_product_name); ?>

                                        </td>
                                        <td>
                                            <?php echo e($list->invoice_quantity); ?>

                                        </td>
                                        <td><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format($list->invoice_unit_price, 2); ?></td>
                                        <td><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format($list->invoice_total_price, 2); ?></td>
                                    </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tbody>
                            </table>
`                           </div>
                        </div>
                    </div>
                    <!-- Row end -->

                </div>
            </div>
            <!-- Card end -->

        </div>
        <div class="col-xl-6 col-lg-6 col-md-6 col-sm-6 col-12">

            <!-- Card start -->
            <div class="card">
                <div class="card-header">
                    <div class="card-title">Rejected Items</div>
                </div>
                <div class="card-body">
                    
                    <!-- Row start -->
                    <div class="row gutters">
                        <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                        <div class="table-responsive">
                        <table class="table table-bordered table-striped m-0">
                                <thead>
                                    <tr>
                                        <th>Order No.</th>
                                        <th>Product</th>
                                        <th>Quantity</th>												
                                        <th> Unit Price</th>
                                        <th>Total Price</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php $__currentLoopData = $branch_total_reject_list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $list): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td>#55589</td>
                                        <td>
                                        <?php echo e($list->invoice_product_name); ?>

                                        </td>
                                        <td>
                                            <?php echo e($list->invoice_quantity); ?>

                                        </td>
                                        <td><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo e($list->invoice_unit_price); ?></td>
                                        <td><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo e($list->invoice_total_price); ?></td>
                                    </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tbody>
                            </table>
                           
                        </div>
                    </div>
                    <!-- Row end -->

                </div>
            </div>
            <!-- Card end -->

        </div>
    </div>
    <!-- Row end -->


     <!-- Row start -->
     <div class="row gutters">
        <div class="col-xl-6 col-lg-6 col-md-6 col-sm-6 col-12">

            <!-- Card start -->
            <div class="card">
                <div class="card-header">
                    <div class="card-title">Invoice List</div>
                </div>
                <div class="card-body">
                    
                    <!-- Row start -->
                    <div class="row gutters">
                        <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">        
                        <table id="scrollVertical" class="table custom-table">

                                <thead>
                                    <tr>
                                        <th>Invoice No.</th>
                                        <th>Sales Category</th>		
                                        <th>Total Cost</th>											
                                        <th>Action</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php $__currentLoopData = $ordersfromBranch; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $list): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td>
                                        <a href="<?php echo e(route('orderTransaction',$list->order_id)); ?>">#<?php echo e($list->order_id); ?></a>
                                        </td>
                                        <td>
                                            <?php echo e($list->category); ?>

                                        </td>
                                        <td>
                                        GH¢<?php echo e($list->total_cost_order); ?>

                                        </td>
                                        <td><a href="<?php echo e(route('orderTransaction',$list->order_id)); ?>" class="text-primary">
                                            <i class="icon-eye1" aria-hidden="true"></i>
                                        </a>
                                    </td>
                                    </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tbody>
                            </table>

                        </div>
                    </div>
                    <!-- Row end -->

                </div>
            </div>
            <!-- Card end -->

        </div>
        <div class="col-xl-6 col-lg-6 col-md-6 col-sm-6 col-12">

            <!-- Card start -->
            <div class="card">
                <div class="card-header">
                    <div class="card-title">Sales Type Report</div>
                </div>
                <div class="card-body">
                    
                    <!-- Row start -->
                    <div class="row gutters">
                        <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                        <div class="table-responsive">
                        <table class="table table-bordered table-striped m-0">
                            <thead>
                                <tr>
                                  <th>Sales Type</th>
                                  <th>Description</th>
                                  <th>Actions</th>
                                </tr>
                            </thead>
                            <tbody>
                               
                                <tr>												  
                                  <td>Counter [Walk in Customer] Transactions</td>
                                  <td> Walk in customers transactions and sales report</td>
                                  <td>
                                  <form action="<?php echo e(route('getDeliveryReportRoute')); ?>" method="get">
                                        <?php echo csrf_field(); ?>
                                        <input type="text" name="branch" hidden value="<?php echo e(request()->branch); ?>">
                                        <input type="text" name="category" hidden value="Counter">
                                        <input type="text" readonly hidden name="date" value="<?= date('m/d/Y', strtotime($dayClose->day_close)) . " - " . date('m/d/Y', strtotime($dayClose->day_close));?>">
                                        <button type="submit" class="btn btn-outline-primary btn-sm"> 
                                        <i class="icon-eye1"></i> View report
                                        </button>
                                    </form>
                                  </td>
                                </tr>
                                <?php if(request()->branch == "DAKODWOM BRANCH"): ?>
                                <tr>												  
                                  <td>Drive Thru</td>
                                  <td> Drive Thru Sales and Transaction Report</td>
                                  <td>
                                  <form action="<?php echo e(route('getDeliveryReportRoute')); ?>" method="get">
                                        <?php echo csrf_field(); ?>
                                        <input type="text" name="branch" hidden value="<?php echo e(request()->branch); ?>">
                                        <input type="text" name="category" hidden value="Drive Thru">
                                        <input type="text" readonly hidden name="date" value="<?= date('m/d/Y', strtotime($dayClose->day_close)) . " - " . date('m/d/Y', strtotime($dayClose->day_close));?>">
                                        <button type="submit" class="btn btn-outline-primary btn-sm"> 
                                        <i class="icon-eye1"></i> view Report
                                        </button>
                                    </form>
                                  </td>
                                </tr>
                                <?php else: ?>
                                <tr>												  
                                  <td>Delivery</td>
                                  <td>Call Center & delivery sales report and Transactions</td>
                                  <td>
                                  <form action="<?php echo e(route('getDeliveryReportRoute')); ?>" method="get">
                                        <?php echo csrf_field(); ?>
                                        <input type="text" name="branch" hidden value="<?php echo e(request()->branch); ?>">
                                        <input type="text" name="category" hidden value="Delivery">
                                        <input type="text" readonly hidden name="date" value="<?= date('m/d/Y', strtotime($dayClose->day_close)) . " - " . date('m/d/Y', strtotime($dayClose->day_close));?>">
                                        <button type="submit" class="btn btn-outline-primary btn-sm"> 
                                        <i class="icon-eye1"></i> view Report
                                        </button>
                                    </form>
                                  </td>
                                </tr>
                                <?php endif; ?>
                            </tbody>
                    </table>
                        </div>
                    </div>  
                    <!-- Row end -->

                </div>
            </div>
            <!-- Card end -->

        </div>
    </div>
    <!-- Row end -->

</div>
</div>

<!-- Modal for Discount Orders -->
<?php echo $__env->make('inc.discount-items', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

</div>
<!-- Content wrapper end -->




<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/morttsons/public_html/morttsonsposfiles/resources/views/sales/view-branch-sales.blade.php ENDPATH**/ ?>