<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Print</title>
    <!-- Google Font: Source Sans Pro -->
    
<style>
   /*@page  { size: 1000pt 0pt; }*/
   /*embed{*/
   /*    width="1000px";*/
   /*    height="500px";*/
   /*}*/
   th{
       background-color:orange;
       text-align:left;
   }
   td{
       border-left:1px solid grey;
       border-bottom:1px solid grey;
   }
   .logo img{
       width:300px;
       margin:0 auto;
   }
</style>
</head>

<body class="abc">

   <div class="logo">
            
            <center> <img src="<?php  echo $pic ?>"   ></center>
        </div>

          <table  class="table table-bordered table-striped">
                <thead >
                  <tr>
                    <th style="width:30px">Sl.no</th>
                     <th>Date</th>
                    <th>Company Name</th>
                     <th>Ledger</th>
                    <th>Invoice No</th>
                    <th>Vehicle Number</th>
                    <th>Driver Number</th>
                    <th>Kilometer</th>
                     <th>Quantity</th>
                          <th>Quantity Liter</th>
                      <th>Quantity Liter Price</th>
                    <th>Total</th>
                 
                  
         
                   
                   
                   
                    <th>Balance Due</th>
                      <th>Payment Mode</th>
                       <th >Payment Status</th>
                 </tr>
                </thead>
                <tbody>
                    <?php $i = 1;  $pay_status_final =0; $total=0; $qty=0; $qty_lit=0;$qty_lit_price=0;?>
        <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> {
           <?php if ($value['ledger'] == 'Cashsale') {
                $Cashsale = $value['ledger_value'];
                $DoNo = '-';
            }
            if ($value['ledger'] == 'DoNo') {
                $DoNo = $value['ledger_value'];
                $Cashsale = '-';
            }
            $id = urlencode(base64_encode($value['id']));

            $bill = App\Models\Transaction::where('id', '=', $value['id'])->first();

            $balance = DB::table('transaction_payment')->where('transaction_payment.transaction_id', '=', $value['id'])->sum('transaction_payment.amount');
            $pay_status = round($bill['amount'], 2) - round($balance, 2);
$pay_status_final +=$pay_status;

            if ($pay_status > 0.1) {
                if (auth()->user()->role == 'admin' || auth()->user()->role == 'users') {
                    $payment = 'Due ';
                } else {
                    $payment = '
                   Due
                    ';
                }
            } else {
                if (auth()->user()->role == 'admin' || auth()->user()->role == 'users') {
                    $payment = 'Paid';
                } else {
                    $payment = 'Paid';
                }
            }
            $total +=round($value['total'], 3);
            $qty +=$value['quantity'];
            $qty_lit +=$value['quantity_ltr'];
            $qty_lit_price +=$value['unit_ltr_price'];
                ?>
            <tr>

              <td><?php echo e($i); ?></td>
                <td><?php echo e(date('d-m-Y', strtotime($value['transaction_date']))); ?></td>
                  <td><?php echo e($value['company_name']); ?></td>
                  <td> <?php echo e($value['ledger']); ?></td>
               <td><?php echo e($value['ledger_value']); ?></td>
               <td><?php echo e($value['vehicle_no']); ?></td>
               <td> <?php echo e($value['driver_name']); ?></td>
               <td><?php echo e($value['kilometer']); ?></td>
               
              <td><?php echo e($value['quantity']); ?></td>
              <td><?php echo e($value['quantity_ltr']); ?></td>
              <td><?php echo e($value['unit_ltr_price']); ?></td>
               <td><?php echo e(round($value['total'], 3)); ?></td>
       
            
             
             
               
               <td><?php echo e(round($pay_status)); ?></td>
                  <td><?php echo e($value['payment_mode']); ?></td>
                       <td><?php echo e($payment); ?></td>
                </tr>
           <?php $i++ ?>
          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
               </tbody>
                    <!--<tfoot>-->

              <tr style="background-color:grey" class=" font-17  footer-total">
              <td  ><strong>Total:</strong></td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
             
             
              <td><?php echo e($qty); ?></td>
               <td><?php echo e($qty_lit); ?></td>
              <td><?php echo e($qty_lit_price); ?></td>
              <td><?php echo e($total); ?></td>
               <td><?php echo e($pay_status_final); ?></td>
                <td></td>
 <td></td>
              </tr>
              <!--</tfoot>-->
              </table>




</body>

</html>
<?php /**PATH /home/z7a6qwiy0umc/public_html/srkdiesel-trading.in/resources/views/export_pdf.blade.php ENDPATH**/ ?>