<!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;*/
        /*}*/
        h6.ml-5 {
    margin-left: 50px;
}
h5.card-title {
    font-weight: bold;
    font-size: 18px;
}
td {
 font-weight: bold;
    border: 1px solid #000 !important;
}
th {
   font-weight: bold;
    border: 1px solid #000 !important;
}
    </style>
</head>
<body onload="window.print()" style="zoom:80%">
    <div class="container">
        <div class="daily__expense">
            <div class="logo">
                <img src="{{asset('style/assets/img/logo2.jpeg')}}" style="width: 100%; margin-bottom:30px;" alt="">
            </div>
            <table class="table table-bordered table-responsive">
                <thead>
                  <tr>
                    <th class="text-center" colspan="6">@if($customer_data){{$customer_data->company_name}} @else - @endif</th>
                    <th class="text-center" colspan="7">DATE : {{ \Carbon\Carbon::parse($datefrom)->format('d/m/Y')}} - {{ \Carbon\Carbon::parse($dateto)->format('d/m/Y')}}</th>
                  
                  </tr>
                </thead>
                <tbody>
                    <tr>
                        <tr>
                            <th class="text-center" colspan="6">{{ \Carbon\Carbon::parse($datefrom)->format('d/m/Y')}} BETWEEN {{ \Carbon\Carbon::parse($dateto)->format('d/m/Y')}}  @if($customer_data) TRN NO:-@endif @if($customer_data){{$customer_data->trn_no}} @endif</th>
                            <th class="text-center" colspan="7">INVOICE : {{ isset($invoice_no->invoice_no) ? $invoice_no->invoice_no : '-'  }}</th>
                        
                            
                          </tr>
                    </tr>
                    <tr>
                        <th>DATE</th>
                        <th>DELIVERY NOTE</th>
                        @if($customer_data == '') 
                        <th>TRN NO</th>
                         @endif
                        <th>COMPANY NAME</th>
                       
                        <th>QTY</th>
                    
                        <th>UNIT</th>
                        <th>AMOUNT</th>
                        <th>TAX</th>
                        <th>TOTAL AMOUNT</th>
                       
                    </tr>
                    @php
                    $total_qty=0.00;
                    $total_amnt=0.00;
                    $total_tax=0;
                    $final_total=0;
                    @endphp
                    @foreach($transaction as $data)
                    @php
              
                    $total_qty +=round($data['quantity'],2);
                    $total_amnt +=round($data['quantity']*$data['unit_price'],2);
                    $total_tax +=($data['quantity']*$data['unit_price'])*$data['tax']/100;
                    $final_total +=($data['quantity']*$data['unit_price'])+($data['quantity']*$data['unit_price'])*$data['tax']/100;
                    @endphp
                  <tr>
                      <td>{{ \Carbon\Carbon::parse($data['transaction_date'])->format('d/m/Y')}}</td>
                      <td>{{$data['ledger_value']}}</td>
                       @if($customer_data == '') 
                      <td>{{$data['trn_no']}}</td>
                      @endif
                      <td>{{$data['company_name']}}</td>
                    
                      <td>{{$data['quantity']}}</td>
                    
                      <td>{{$data['unit_price']}}</td>
                      <td>{{$data['quantity']*$data['unit_price']}}</td>
                      <td>{{($data['quantity']*$data['unit_price'])*$data['tax']/100}}</td>
                      <td>{{($data['quantity']*$data['unit_price'])+($data['quantity']*$data['unit_price'])*$data['tax']/100}}</td>
                     
                  </tr>
                @endforeach
                </tbody>
                <!-- <tfoot> -->
                 <tr>
                      @if($customer_data == '') 
                     <td colspan="4">TOTAL</td>
                     @else
                     <td colspan="3">TOTAL</td>
                     @endif
                  
                 
                  <td>{{$total_qty}} /-GALL</td>
                  <td> {{round($total_amnt / $total_qty,2)}} /- AED</td>
                                    <td> {{$total_amnt}} /-AED</td>     
                                    <td> {{$total_tax}}/-AED</td>      
                                    <td> {{$final_total}} /-AED</td>
                  
                 </tr>
                  <!-- </tfoot> -->
              </table>
              <div class="border" style="margin-top:100px">
                <div class="row">
                  <div class="d-flex justify-content-between">
                      <div class="card border-0" style="width: 600px;min-height: 320px;">
                          <div class="card-body">
                            <h5 class="card-title">SRK DIESEL TRADING L.L.C </h5>
                            <h5 class="card-title">DUBAI - UNITED ARAB EMIRATES</h5>
                            <H6>Email : srkdieseltrading@gmail.com</H6>
                            <H6 class="ml-5">jamshiparayil@gmail.com</H6>
                            <h6>Mobile : 0091-55 33 46 408</h6>
                            <h6>Indian : 009171 9847 108 913</h6>
                            <h5>SIGNATURE :-</h5>
                            <img src="{{asset('style/assets/img/seal.png')}}" class="img-fluid mt-3" alt="">
                          </div>
                        </div>
                            <div class="card border-0" style="width: 24rem;min-height: 320px; float: right;">
                          <div class="card-body text-center">
                            <h5 class="card-title"></h5>
                            <h5 class="card-title">DUBAI - UNITED ARAB EMIRATES</h5>
                            
                          </div>
                        </div>
                    </div>
                   
                </div>
            </div>
        </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>