<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Print Receipt</title>

    <!-- Bootstrap css -->
    <link rel="stylesheet" href="<?php echo e(asset('css/bootstrap.min.css')); ?>">

    <!-- Bootstrap Select CSS -->
		<link rel="stylesheet" href="<?php echo e(asset('vendor/bs-select/bs-select.css')); ?>" />
    
		<!-- Sweet Alert-->
		<link href="<?php echo e(asset('vendor/libs/sweetalert2/sweetalert2.min.css')); ?> " rel="stylesheet" type="text/css" />

		
		<!-- Icomoon Font Icons css -->
		<link rel="stylesheet" href="<?php echo e(asset('fonts/style.css')); ?>">

		<!-- Main css -->
		<link rel="stylesheet" href="<?php echo e(asset('css/main.css')); ?>">

		<!-- fontAwesome -->
    <link href="<?php echo e(asset('fontawesome/css/all.css')); ?>" rel="stylesheet">
  <style>
    .container {
      display: flex;
      justify-content: center;
    }


    .footer {
      position: fixed;
      left: 0;
      bottom: 0;
      width: 100%;
      background-color: #073a82;
      color: white;
      text-align: center;
      padding:10px
    }

    table{
      font-size:10px;
    }


    @media  print {
      body * {
        visibility: hidden;
      }
      #section-to-print, #section-to-print * {
        visibility: visible;
      }
      #section-to-print {
        position: absolute;
        left: 0;
        top: 0;
      }
    }
  </style>
</head>
<body onLoad="window.print();">
  <?php echo $__env->make('inc.errorfile', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<div class="container" id="section-to-print">
  
    <div class="child">

    <table width="250" border="0" cellspacing="0" cellpadding="0" style="font-family:Arial, Helvetica, sans-serif; font-size:12px;">
    <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="4">
      <tr>
        <td align="center"><h4><?php echo e($app->app_name); ?></h4></td>
      </tr>
      <tr>
      <td align="center" style="font-size:17px;">ORDER NO: <strong><?php echo e($display_waiting); ?></strong></td>
      </tr>
      <tr>
        <td align="center">
        <div>
            <strong><?= $branch_details -> branch_name ?></strong><br>
            <?= $branch_details -> branch_location ?></br>
            Phone   : <?= $branch_details -> branch_contact ?></br>
            Momo Number  : <?= $branch_details -> branch_momo ?></br>
        </div>
      
      </td>
    </tr>
    <tr>
      <td align="center">Receipt Number: <strong>#<?php echo e($number); ?></strong> <input type="text" readonly hidden id="receipt_n" value="<?php echo e($number); ?>"></td>
    </tr>
    <tr>
    <td align="center">TIN: <strong><?= $branch_details -> tin_number ?></strong></td>
    </tr>
  </table></td>
  </tr>
  <tr>
  <td><table width="100%" border="0"  cellspacing="0" cellpadding="5" style="font-size:10px">
    <tr>
      <td>
      PHARMACIST:
         <?php 
      $f_name = explode(" ", $sales_person_name);
      echo @strtoupper($f_name[0]);
      ?>
      
      <h5><em><?php echo e(empty($agency_->agency) ?  "" : "DELIVERY AGENT: " . $agency_->agency); ?></em></h5>

    </td>

    </tr>
    <tr>
      <td><?= @strtoupper($time) ?></td>
      <!-- use $time if you waant buying date -->
    </tr>
  </table>
  </td></tr>

  <tr>
  <td>
    
  <table width="100%" border="0" cellspacing="0" cellpadding="5" style="border-top:solid 1px #000; border-bottom:solid 1px #000; font-size:10px">
    <tr>
      <td><strong>ITEM</strong></td>
      <td><strong>QTY</strong></td>
      <td><strong>RATE</strong></td>
      <td align="right"><strong>TOTAL</strong></td>
    </tr>
    <?php $__currentLoopData = $invoice_generate; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $invoice): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    <tr>
      <td><?php echo @strtoupper($invoice->invoice_product_name); ?></td>
      <td><?php echo e($invoice->invoice_quantity); ?></td>
      <td><?php echo number_format($invoice->invoice_unit_price, 2); ?></td>
      <td align="right"><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format($invoice->invoice_total_price, 2); ?></td>
    </tr>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  </table>
  
  </td>
  </tr>
  <tr>
  <td>
  
  <table width="100%" border="0" cellspacing="0" cellpadding="4" style="font-size:10px">
    <tr>
      <?php if($discount == null): ?>
      <td><strong>DISCOUNT</strong></td>
      <td align="right"><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?> 0,00</td>
      <?php else: ?>
      <?php 
        if ($discount->type == "Cash") {
          echo '<td>' . '<strong>' . "DISCOUNT" . '</strong>' . '</td>';
          echo '<td align="right">' . $discount->discount . '</td>';
        }elseif ($discount->type == "Percentage") {
          echo '<td>' . '<strong>' . "DISCOUNT" . '</strong>' . '</td>';
          echo '<td align="right">' . $discount->discount . "%". '</td>';
        }
        ?>
      <?php endif; ?>
    </tr>
    <?php if($discount != null): ?>
    <tr>
    <td><strong>DISCOUNT SUBTOTAL</strong></td>
    <td align="right"><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format($discount->amount_paid, 2); ?></td>
    </tr>
    <?php endif; ?>
    <tr>
    <?php if($discount == null): ?>
      <td><strong>VAT EXCL. TOTAL</strong></td>
      <td align="right"><strong><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format(($total)/(1+ ($gTax) + ($mTax->vat) + ($gTax*$mTax->vat)), 2); ?></strong></td>
      <?php else: ?>
      <td><strong>VAT EXCL. TOTAL</strong></td>
      <td align="right"><strong><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format(($discount->amount_paid)/(1+($gTax) + ($mTax->vat) + ($gTax)*($mTax->vat)), 2); ?> </strong></td>
      <?php endif; ?>
    </tr>
    <tr>
      <td></td>
      <?php if($discount == null): ?>
      <tr>
        <td>COVID LEVY  <strong>1%</strong></td>
        <td align="right"><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format(($total)/(1+ ($gTax) + ($mTax->vat) + ($gTax*$mTax->vat))*$mTax->covid, 2); ?></td>
      </tr>
      <tr>
        <td>GETFUND LEVY <strong>2.5%</strong></td>
        <td align="right"><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format(($total)/(1+ ($gTax) + ($mTax->vat) + ($gTax*$mTax->vat))*$mTax->getfund, 2); ?></td>
      </tr>
      <tr>
        <td>NHIL LEVY <strong>2.5%</strong></td>
        <td align="right" style="text-decoration:underline"><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format(($total)/(1+ ($gTax) + ($mTax->vat) + ($gTax*$mTax->vat))*$mTax->nhil, 2); ?></td>
      </tr>
      <tr>
        <td></td>
        <td align="right"><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format(((($total)/(1+ ($gTax) + ($mTax->vat) + ($gTax*$mTax->vat))*$mTax->covid) + (($total)/(1+ ($gTax) + ($mTax->vat) + ($gTax*$mTax->vat))*$mTax->getfund) + (($total)/(1+ ($gTax) + ($mTax->vat) + ($gTax*$mTax->vat))*$mTax->nhil)) + ($total)/(1+ ($gTax) + ($mTax->vat) + ($gTax*$mTax->vat)), 2); ?></td>
      </tr>
      <tr>
        <td>VAT <strong>12.5%</strong></td>
        <td align="right"><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?> ₵<?php echo number_format((((($total)/(1+ ($gTax) + ($mTax->vat) + ($gTax*$mTax->vat))*$mTax->covid) + (($total)/(1+ ($gTax) + ($mTax->vat) + ($gTax*$mTax->vat))*$mTax->getfund) + (($total)/(1+ ($gTax) + ($mTax->vat) + ($gTax*$mTax->vat))*$mTax->nhil)) + ($total)/(1+ ($gTax) + ($mTax->vat) + ($gTax*$mTax->vat))) * $mTax->vat, 2); ?></td>
      </tr>
      <?php else: ?>
      <tr>
        <td>COVID LEVY  <strong>1%</strong></td>
        <td align="right"><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format(($discount->amount_paid)/(1+ ($gTax) + ($mTax->vat) + ($gTax*$mTax->vat))*$mTax->covid, 2); ?></td>
      </tr>
      <tr>
        <td>GETFUND LEVY <strong>2.5%</strong></td>
        <td align="right"><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format(($discount->amount_paid)/(1+ ($gTax) + ($mTax->vat) + ($gTax*$mTax->vat))*$mTax->getfund, 2); ?></td>
      </tr>
      <tr>
        <td>NHIL LEVY <strong>2.5%</strong></td>
        <td align="right" style="text-decoration:underline"><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format(($discount->amount_paid)/(1+ ($gTax) + ($mTax->vat) + ($gTax*$mTax->vat))*$mTax->nhil, 2); ?></td>
      </tr>
      <tr>
        <td></td>
        <td align="right"><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format(((($discount->amount_paid)/(1+ ($gTax) + ($mTax->vat) + ($gTax*$mTax->vat))*$mTax->covid) + (($total)/(1+ ($gTax) + ($mTax->vat) + ($gTax*$mTax->vat))*$mTax->getfund) + (($discount->amount_paid)/(1+ ($gTax) + ($mTax->vat) + ($gTax*$mTax->vat))*$mTax->nhil)) + ($discount->amount_paid)/(1+ ($gTax) + ($mTax->vat) + ($gTax*$mTax->vat)), 2); ?></td>
      </tr>
      <tr>
        <td>VAT <strong>12.5%</strong></td>
        <td align="right"><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?> ₵<?php echo number_format((((($discount->amount_paid)/(1+ ($gTax) + ($mTax->vat) + ($gTax*$mTax->vat))*$mTax->covid) + (($discount->amount_paid)/(1+ ($gTax) + ($mTax->vat) + ($gTax*$mTax->vat))*$mTax->getfund) + (($discount->amount_paid)/(1+ ($gTax) + ($mTax->vat) + ($gTax*$mTax->vat))*$mTax->nhil)) + ($discount->amount_paid)/(1+ ($gTax) + ($mTax->vat) + ($gTax*$mTax->vat))) * $mTax->vat, 2); ?></td>
      </tr>
      <?php endif; ?>
    </tr>
    <tr>
      <td><strong>VAT INCL. TOTAL</strong></td>
      <?php if($discount == null): ?>
      <td align="right"><strong><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format($total, 2); ?></strong></td>
      <?php else: ?>
      <td align="right"><strong><?php echo e(empty($app->currency) ? "GHS" : $app->currency); ?><?php echo number_format($discount->amount_paid, 2); ?></strong></td>
      <?php endif; ?>
    </tr>
  </table>
  
</td>
  </tr>

  <tr>
  <td>
    
  <table width="100%" border="0" cellspacing="0" cellpadding="1">
    <tr>
      <td style="border-bottom:solid 1px #000;"> </td>
    </tr>
    <tr>
      <td align="center"><?php echo e($app->app_receipt_footer); ?></td>
    </tr>
  </table>
  </td>
  </tr>

  </table>

  </div>
</div>

  


<div class="footer">
  <p>

  <?php if(auth()->user()->role == "Cashier"): ?>
  <a href="<?php echo e(route('index.cashier')); ?>" class="btn btn-success rounded-pill stripes-btn">Order Display</a>

  <button onclick="display()" class="btn btn-danger rounded-pill stripes-btn">
  <i class="fa fa-print" aria-hidden="true"></i>Print Order
  </button>
  <?php endif; ?>
  
  <?php if(auth()->user()->sales_person_category == "Drive Thru"): ?>
  <button type="button" class="btn btn-primary rounded-pill stripes-btn" data-bs-toggle="modal" data-bs-target="#exampleModalFullScreen">
  <i class="fas fa-users"></i> Add Customer
	</button>
  
  <a href="#" class="btn btn-primary rounded-pill stripes-btn"  data-bs-toggle="modal" data-bs-target="#DeliveryModalGeneral">New Invoice</a>

  <a href="#" class="btn btn-secondary stripes-bn" data-bs-toggle="modal" data-bs-target="#staticBackdrop"><i class="icon-attach_money"></i>Accept Payment</a>
  <?php elseif(auth()->user()->role == "Branch Officer"): ?>
  <a href="#" onclick="viewOrders()"  class="btn btn-primary rounded-pill stripes-btn">Back to Orders</a>
  <?php else: ?>
  <?php if(auth()->user()->role == "Sales Person"): ?>
  <a href="#" class="btn btn-primary rounded-pill stripes-btn"  data-bs-toggle="modal" data-bs-target="#DeliveryModalGeneral">New Invoice</a>
  <?php endif; ?>
  <a href="#" class="btn btn-secondary rounded-pill stripes-btn" data-bs-toggle="modal" data-bs-target="#staticBackdrop"><i class="icon-attach_money"></i>Accept Payment</a>
  <?php endif; ?>
  </p>
</div>


<?php echo $__env->make('inc.new-customer', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->make('modal.delivery-modal', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->make('tingg.tingg-modal', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

  <script>
         function display() {
          window.print();
         }


         function newInvoice() {
          Swal.fire({
              title: 'Are you sure?',
              text: "You Want to Create New Invoice!",
              icon: 'warning',
              showCancelButton: true,
              confirmButtonColor: '#3085d6',
              cancelButtonColor: '#d33',
              confirmButtonText: 'Yes, Create Invoice!'
            }).then((result) => {
              if (result.isConfirmed) {
                window.location.href = "<?php echo e(route('index.invoice')); ?>";
              }
            })
         }


         function viewOrders() {
          Swal.fire({
              title: 'Are you sure?',
              text: "You Want to View Orders!",
              icon: 'warning',
              showCancelButton: true,
              confirmButtonColor: '#3085d6',
              cancelButtonColor: '#d33',
              confirmButtonText: 'Yes, View Orders!'
            }).then((result) => {
              if (result.isConfirmed) {
                window.location.href = "/orders-from-counter/check-to-complete";
              }
            })
         }


  </script>

  <!-- Required jQuery first, then Bootstrap Bundle JS -->
  <script src="<?php echo e(asset('js/jquery.min.js')); ?>"></script>
		<script src="<?php echo e(asset('js/bootstrap.bundle.min.js')); ?>"></script>
		<script src="<?php echo e(asset('js/modernizr.js')); ?>"></script>
		<script src="<?php echo e(asset('js/moment.js')); ?>"></script>

    <!-- Bootstrap Select JS -->
		<script src="<?php echo e(asset('vendor/bs-select/bs-select.min.js')); ?>"></script>
		<script src="<?php echo e(asset('vendor/bs-select/bs-select-custom.js')); ?>"></script>

    <!-- Sweet Alerts js -->
		<script src="<?php echo e(asset('vendor/libs/sweetalert2/sweetalert2.min.js')); ?>"></script>

  <!-- Main Js Required -->
  <script src="<?php echo e(asset('js/main.js')); ?>"></script>
</body>
</html><?php /**PATH /home/morttsons/public_html/morttsonsposfiles/resources/views/print-invoice.blade.php ENDPATH**/ ?>