
<?php $__env->startSection('title'); ?> Bill Generate | SHOP <?php $__env->stopSection(); ?>
<?php $__env->startSection('bill-generate'); ?> active <?php $__env->stopSection(); ?>
<?php $__env->startSection('bill-generate.index'); ?> active <?php $__env->stopSection(); ?>
<?php $__env->startSection('styles'); ?>
<?php $__env->stopSection(); ?>

<!-- BEGIN: Content-->
<?php $__env->startSection('main_content_section'); ?>
<div class="row py-3 ps-2">
  <div class="heading d-flex justify-content-start heading-margin-bottom-minus">
    <h3 class="mb-0"><span>Bill Generate List</span></h3>
  </div>
</div>


<div class="table_wrapper py-1 card">
  <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 py-1">
          <p class="mb-0"><a href="<?php echo e(route('bill-generate.index')); ?>" class="text-primary  py-2 px-3 active">All
              (<?php echo e($allBillGenerateCount); ?>)</a>
          </p>
        </div>
        <div class="d-none d-sm-block">
          <?php if(Auth::user()->can('bill-generate-create')): ?>
          <a href="javascript:void(0)" class="btn btn-success rounded-0 d-flex align-items-center px-2 border-0"
            data-bs-toggle="modal" data-bs-target="#addBillGenerate"><span class="">New Bill</span></a>
          <?php endif; ?>
        </div>
      </div>

      <?php if(Auth::user()->can('bill-generate-create')): ?>
      <div class="mt-2 btn btn-success d-block rounded-0 d-sm-none" data-bs-toggle="modal" data-bs-target="#addBillGenerate">
        New Bill</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>Id</span></th>
            <th class="text-center" scope="col"><span>Shop Details</span></th>
            <th class="text-center" scope="col"><span>Amount Details</span></th>
            <th class="text-center" scope="col"><span>Generated Details</span></th>
            <th class="text-center" scope="col"><span>Status</span></th>

          </tr>
        </thead>
        <tbody class="text-center">

          <?php $__currentLoopData = $billGenerateData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
          <?php if(isset($item) && $item != null): ?>
          <tr class="">
            <td class="text-center">
              <b>#<?php echo e($item->billing_id); ?></b>
            </td>

            <td class="text-start">
              <b>Generated By:</b> <?php echo e(Str::title($item->bill_generated_by)); ?> <br>
              <b>Shop Qty:</b> <?php echo e($item->total_shop_qty); ?> <br>
              <b>Shop Size:</b> <?php echo e($item->total_shop_size); ?> <br>
              <div class="row-actions">
                  <?php if(Auth::user()->can('bill-generate-edit')): ?>
                  <span><a class="text-primary fw-bolder"
                      href="<?php echo e(route('bill-generate-details', $item->id)); ?>">View Shop List</a></span>

                  <?php endif; ?>

                  <?php if(Auth::user()->can('bill-generate-delete')): ?>
                  
                  <?php endif; ?>
              </div>
            </td>

            <td class="text-start w-25">
              <b>Total Amount: </b><?php echo e($item->net_amount); ?> tk<br>
              <b>Total Paid: </b><?php echo e($item->paid_amount); ?> tk<br>
              <b>Total Due: </b><?php echo e($item->due_amount); ?> tk<br>
            </td>
            
            <td class="text-start w-25">
              <b>Date: </b><?php echo e(Carbon\Carbon::parse($item->bill_generated_date)->format('d-m-Y')); ?> <br>
              <b>Month: </b><?php echo e($item->bill_generated_month); ?> <br>
              <b>Year: </b><?php echo e($item->bill_generated_year); ?> <br>
            </td>

            <td>
              <?php if($item->is_full_pay == true): ?>
              <span class="badge bg-success">Paidup</span>
              <?php else: ?>
              <span class="badge bg-warning">Unpaid</span>
              <?php endif; ?>
            </td>

          </tr>

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


        </tbody>
      </table>
    </div>

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

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

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

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

        </p>
      </div>

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

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

  </div>

  
  <div class="modal fade" id="addBillGenerate" tabindex="-1" aria-labelledby="oneInputModalLabel" aria-hidden="true"
    data-bs-backdrop="static">
    <div class="modal-dialog modal-dialog-centered max-width-900px">
      <div class="modal-content">
        <div class="modal-header">
          <h1 class="modal-title fs-5" id="oneInputModalLabel">Shop Bill Generate</h1>
          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
        </div>
        <div class="modal-body p-0">
          <form action="<?php echo e(route('bill-generate.store')); ?>" method="POST" onsubmit="return checkValidate()">
            <?php echo csrf_field(); ?>
            <div class="row px-4">

              <div class="col-md-6 my-1">
                <div class="form-group custom-select2-form">
                  <label for="bill_generated_year"> Select Year <span class=" text-danger">(required)</span>
                  </label>
                  <select name="bill_generated_year" id="bill_generated_year" class="form-select select2" required>
                    <option value="" selected disabled>Select A Year</option>
                    <?php $__currentLoopData = $getAllYears; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$singleYear): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php if(isset($singleYear) && $singleYear != null): ?>
                    <option value="<?php echo e($singleYear); ?>" <?php echo e($singleYear == $currentYear ? 'selected' : ''); ?>>
                      <?php echo e($singleYear); ?></option>
                    <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  </select>
                </div>
              
                <?php $__errorArgs = ['bill_generated_year'];
$__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 class="col-md-6 my-1">
                <div class="form-group custom-select2-form">
                  <label for="bill_generated_month"> Select Month <span class=" text-danger">(required)</span>
                  </label>
                  <select name="bill_generated_month" id="bill_generated_month" class="form-select select2" required>
                    <option value="" selected disabled>Select A Month</option>

                    <?php $__currentLoopData = $getAllMonthNames; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$singleMonth): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php if(isset($singleMonth) && $singleMonth != null): ?>
                    <option value="<?php echo e($singleMonth); ?>" <?php echo e($singleMonth == $currentMonth ? 'selected' : ''); ?>>
                      <?php echo e($singleMonth); ?></option>
                    <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  </select>
                </div>
              
                <?php $__errorArgs = ['bill_generated_month'];
$__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="modal-footer">
              <div class="">
                <button type="submit" class="btn btn-success">Save</button>
                <button type="button" class="btn btn-danger" data-bs-dismiss="modal">Cancel</button>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>

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


<?php $__env->startSection('scripts'); ?>
<script>
    $(document).ready(function(){
      $("#bill_generated_year").select2({
      dropdownParent: $('#addBillGenerate')
      })
      $("#bill_generated_month").select2({
      dropdownParent: $('#addBillGenerate')
      })
    });

    function checkValidate() {
        return true;
    }
    
    //For update...
    function checkValidateForUpdate(id) {
        return true;
    }
    
    //To show update modal...
    function updateFloor(id) {
      $("#updateFloor"+id).modal('show');
    }
</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\Next-Web-Service\muktijoddhe-somobai-somity\resources\views/admin/billGenerate/index.blade.php ENDPATH**/ ?>