<!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>Document</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css">
    <style>
        .daily__expense{
            padding: 60px 0;
        }
        .title{
            text-align: center;
    text-transform: uppercase;
    font-size: 20px;
    margin-bottom: 14px;
    font-weight: 700;
    color: #333;
        }
    </style>
</head>
<body onload="window.print()">
    <div class="container">
        <div class="daily__expense">
            <h3 class="title">All Transaction</h3>
            <table class="table table-bordered ">
                <thead class="table-secondary">
                  <tr>
                       <th scope="col">SR.No</th>
                    <th scope="col">DATE</th>
      
                    <th scope="col">TRANSACTION NUMBER</th>
                    <th scope="col">COMPANY NAME </th>
                    <th scope="col">QTY</th>
                 
                    <th scope="col">UNIT</th>
                    <th scope="col">AMOUNT</th>
                    <th scope="col">TAX</th>
                    <th scope="col">TOTAL AMOUNT</th>
                       <th scope="col">RETURN QTY</th>
                  </tr>
                </thead>
                <tbody>
                    <tr>
                        <th class="text-center" colspan="8">{{ \Carbon\Carbon::parse($datefrom)->format('d/m/Y')}} Between {{ \Carbon\Carbon::parse($dateto)->format('d/m/Y')}}</th>
                    </tr>
                   
                    @php
                    $total_qty=0;
                    $total_amount=0;
                    $tax=0;
                    $final_amont=0;
                    $rtrn_qty=0;
                    @endphp
                    @foreach($data as $dat)
                    @php
                    $total_qty +=$dat->quantity;
                    $total_amount +=$dat->gallon_price;
                    $tax=$dat->tax;
                    $final_amont +=$dat->total;
                    $rtrn_qty +=$dat->return_qty;
                    @endphp
                  <tr>
                    <td>{{@$i +=1}}</td>
                     <td>{{ \Carbon\Carbon::parse($dat->transaction_date)->format('d/m/Y')}}</td>
                   <td>{{$dat->ledger_value}}</td>
                    <td>{{$dat->company_name}}</td>
                     <td>{{$dat->quantity}}</td>
                        
                           <td>{{number_format($dat->unit_price,2)}}</td>
                             <td>{{number_format($dat->gallon_price,2)}}</td>
                               <td>{{number_format($dat->tax,2)}}</td>
                                 <td>{{number_format($dat->total,2)}}</td>
                                  <td>{{$dat->return_qty}}</td>
                   @endforeach
                  </tr>
                
                </tbody>
                 <tfoot>
                  <td colspan="4">TOTAL</td>
                  
                 
                  <td>{{number_format($total_qty,3)}}</td>
                  <td></td>
                  <td>{{number_format($total_amount,3)}}</td>
                    <td>{{number_format($tax,3)}}</td>
                  <td>{{number_format($final_amont,3)}}</td>
                    <td>{{number_format($rtrn_qty,3)}}</td>
                  
                </tfoot> -->
              </table>

        </div>
    </div>


<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>