
<?php $__env->startSection('title'); ?> Branch Wise Report | Beauty Parlour <?php $__env->stopSection(); ?>
<?php $__env->startSection('branch-wise-report-list'); ?> active <?php $__env->stopSection(); ?>
<?php $__env->startSection('styles'); ?>
<style>
    .select2-container--default .select2-selection--single .select2-selection__rendered{
        line-height: 25px;
    }
</style>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('main_content_section'); ?>
<div class="row py-3 ps-2">
    <div class="heading d-flex justify-content-start align-items-center">
        <h3 class="mb-0"><span> Branch Wise Report List</span></h3>
    </div>
</div>

<div class="card">
    <div class="card-body">
        <form action="<?php echo e(route('selected-branch-wise-report-list')); ?>" method="post" enctype="multipart/form-data">
            <?php echo csrf_field(); ?>
            <div class="col-md-12">
                <div class="row">
                    <div class="col-md-4 mb-3">
                        <div>
                            <div class="form-group custom-select2-form 
                            <?php echo e($branchData->count() > 0 ? '' : 'custom-null-select2-body'); ?>

                            ">
                                <label for="branch_id">Service Branch <span class=" text-danger">*</span>
                                </label>
                                <select name="branch_id" id="branch_id" class="form-select select2" required>
                                    <?php $__currentLoopData = $branchData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $singleBD): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($singleBD->id); ?>" <?php echo e($singleBD->id == $singleBranchData->id ? "selected":""); ?>>
                                        <?php echo e($singleBD->branch_title); ?>

                                    </option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                            
                            <?php $__errorArgs = ['branch_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <span class=text-danger><?php echo e($message); ?></span>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>
                    </div>
                    
                    <div class="col-md-4 mb-3">
                        <div>
                            <div class="form-group">
                                <label for="start_date">Start Date<span class=" text-danger">*</span> </label>

                                <input type="text" class=" form-control flatpickr-basic custom-date-picker"
                                    name="start_date" id="start_date" placeholder="DD-MM-YYYY"
                                    value="<?php echo e(Carbon\Carbon::parse($startDate)->format('d-m-Y')); ?>" required>
                            </div>

                            <?php $__errorArgs = ['current_balance'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <span class=text-danger><?php echo e($message); ?></span>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>
                    </div>

                    <div class="col-md-4 mb-3">
                        <div>
                            <div class="form-group">
                                <label for="end_date">End Date<span class=" text-danger">*</span> </label>

                                <input type="text" class=" form-control flatpickr-basic custom-date-picker"
                                    name="end_date" id="end_date" placeholder="DD-MM-YYYY"
                                    value="<?php echo e(Carbon\Carbon::parse($endDate)->format('d-m-Y')); ?>" required>
                            </div>

                            <?php $__errorArgs = ['current_balance'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <span class=text-danger><?php echo e($message); ?></span>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>
                    </div>

                    <div class="col-md-12">
                        <button type="submit" class="btn btn btn-primary m-0 py-2 d-flex custom-float-right-side">
                            <i class="material-symbols-outlined custom-project-icon">
                                tune
                            </i>
                            <span>
                                Search
                            </span>
                        </button>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>

<div class="table_wrapper py-1 card mt-4">
    <div class="row my-2 aggregate-section-div">
        <div class="px-3 ">
            <div class=" d-flex justify-content-between align-items-center aggregate-section border">
                <div class="d-flex align-items-center">
                    <p class="mb-0"><a href="<?php echo e(route('yearly-report-list')); ?>"
                            class="text-primary py-2 px-3 active">All(<?php echo e($billPaymentData->count()); ?>)</a>
                    </p>
                </div>
                <div class="d-none d-sm-block">
                    <?php if(Auth::user()->can('billing-create')): ?>
                    <a href="#" class="btn btn-success rounded-0 d-flex align-items-center px-2 border-0">
                        <span class="">Report List</span>
                    </a>
                    <?php endif; ?>
                </div>
            </div>

            <?php if(Auth::user()->can('billing-create')): ?>
            <div class="mt-2 btn btn-success d-block rounded-0 d-sm-none">
                <a href="#" class="btn btn-success rounded-0 d-flex align-items-center px-2 border-0">
                    <span class="">Report List</span>
                </a>
            </div>
            <?php endif; ?>
        </div>
    </div>



    <div class="row px-3">
        <div class="table-container table-responsive">
            <table id="" class="table table-bordered">
                <thead class="text-uppercase">
                    <tr class="me-3">
                        <th class="text-center" scope="col"><span>Invoice ID</span></th>
                        <th class="text-center" scope="col"><span>Client</span></th>
                        <th class="text-center" scope="col"><span>QTY</span></th>
                        <th class="text-center" scope="col"><span>Net Amount</span></th>
                        <th class="text-center" scope="col"><span>Paid Amount</span></th>
                        <th class="text-center" scope="col"><span>Due Amount</span></th>
                        <th class="text-center" scope="col"><span>Change Amount</span></th>
                        <th class="text-center" scope="col"><span>Date</span></th>
                    </tr>
                </thead>
                <tbody class="text-center">

                    <?php $__currentLoopData = $billPaymentData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php if(isset($item) && $item != null): ?>
                    <tr class="">

                        <td>
                            <div class="row_title">
                                <b> #<?php echo e($item->billing_id); ?></b>
                            </div>
                            <div class="row-actions mt-2">
                            </div>
                        </td>

                        <td>
                            <a href="<?php echo e(route('client-profile', $item->client_id)); ?>"
                                class="text-primary"><?php echo e($item->clientData->client_name); ?></a>
                        </td>

                        <td>
                            <span class="fw-bolder"><?php echo e($item->billPaymentData->total_product); ?></span>
                        </td>
                        <td>
                            <span class=""><?php echo e($item->billPaymentData->net_amount); ?>tk</span>
                        </td>
                        <td>
                            <span class=""><?php echo e($item->billPaymentData->paid_amount); ?>tk</span>
                        </td>
                        <td>
                            <span class=""><?php echo e($item->billPaymentData->due_amount); ?>tk</span>
                        </td>
                        <td>
                            <span class=""><?php echo e($item->billPaymentData->change_amount); ?>tk</span>
                        </td>

                        <td>
                            <?php echo e(Carbon\Carbon::parse($item->billing_date)->format('d-m-Y')); ?>

                        </td>

                    </tr>

                    <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>


                </tbody>
                <tfoot class="">
                    <tr class="custom-invoice-table-footer text-center custom-report-table-footer">
                        <th>Total</th>
                        <th>=</th>
                        <th></th>
                        <th class="fw-bold text-secondary"><?php echo e($totalNetAmount); ?>tk</th>
                        <th class="fw-bold text-success"><?php echo e($totalPaidAmount); ?>tk</th>
                        <th class="fw-bold text-danger"><?php echo e($totalDueAmount); ?>tk</th>
                        <th class="fw-bold text-warning"><?php echo e($totalChangeAmount); ?>tk</th>
                        <th></th>
                    </tr>
                </tfoot>
            </table>
        </div>

        <?php if(isset($billPaymentData) && $billPaymentData->count() > 10): ?>
        <div class="clearfix d-flex">
            <div class="float-left">
                <p class="text-muted">
                    <?php echo e(__('Showing')); ?>

                    <span class="font-weight-bold"><?php echo e($billPaymentData->firstItem()); ?></span>
                    <?php echo e(__('to')); ?>

                    <span class="font-weight-bold"><?php echo e($billPaymentData->lastItem()); ?></span>
                    <?php echo e(__('of')); ?>

                    <span class="font-weight-bold"><?php echo e($billPaymentData->total()); ?></span>
                    <?php echo e(__('results')); ?>

                </p>
            </div>

            <div class="float-right custom-table-pagination">
                <?php echo $billPaymentData->links('pagination::bootstrap-4'); ?>

            </div>
        </div>
        <?php endif; ?>
    </div>
</div>

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

<?php $__env->startSection('scripts'); ?>
<script>
    $(document).ready(function(){
        $("#start_date").flatpickr({
            allowInput: true,
            dateFormat: "d-m-Y",
        });
        
        $("#end_date").flatpickr({
            allowInput: true,
            dateFormat: "d-m-Y",
        });

        $("#branch_id").select2();
    });
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH E:\Project\Personal-Project\Office-Project\update\skin-care\resources\views/admin/report/branchWiseReport.blade.php ENDPATH**/ ?>