 <div class="table-responsive">
    <table id="example" class="table table-bordered align-middle" style="width:100%">
        <thead class="table-light">
            <tr>
                <th class="thbutton">Sl No</th>
                <th>License No</th>
                <!-- <th>Order Date</th> -->
                <!-- <th>Project</th> -->
                <th>Customer Details</th>
                <th>Service Details</th>
                <!-- <th>Expiry Date</th> -->
                <th>Amount</th>
            </tr>
        </thead>
        <tbody>
            @php $i=1; $total=0; @endphp
            @if(count($data)>0)
                @foreach($data as $key=> $list)
                    <tr>
                        <td class="text-center">{{$key + 1}}</td>
                        <td><a href="{!! route('license-registered-details', $list->id) !!}"><strong>{!! $list->license_no !!}</strong></a><br>
                            {!! formatedDate($list->license_date) !!} <br />
                            Order Date: {!! formatedDate($list->order_date) !!} <br />
                            <strong>{!! @$list->project->title !!}</strong><br />
                            {!! @$list->project->code !!}
                        </td>
                        <!-- <td>{!! formatedDate($list->order_date) !!}</td> -->
                        <!-- <td>
                            <strong>{!! @$list->project->title !!}</strong><br />
                            {!! @$list->project->code !!}
                        </td> -->
                        <td>
                            <strong>{!! @$list->bill_to->name !!}</strong><br />
                            @if ($list->bill_to->account_contact->email != '')
                            <a href="mailto:{!! @$list->bill_to->account_contact->email !!}"><i class="bi bi-envelope"></i> {!! @$list->bill_to->account_contact->email !!}</a><br />
                            @endif
                            @if ($list->bill_to->account_contact->phone_no != '')
                            <a href="tel:{!! @$list->bill_to->account_contact->phone_no !!}"><i class="bi bi-telephone-fill"></i> {!! @$list->bill_to->account_contact->phone_no !!}</a><br />
                            @endif
                            @if ($list->bill_to->account_contact->whatsapp_no != '')
                            <a href="https://wa.me/{!! @$list->bill_to->account_contact->phone_no !!}"><i class="bi bi-whatsapp"></i> {!! @$list->bill_to->account_contact->whatsapp_no !!}</a><br />
                            @endif
                        </td>
                        <td>{!! @$list->services !!}</td>
                        <?php
                            if (isset($list->expiry_date)) {
                            $expiryDate = \Carbon\Carbon::parse($list->expiry_date);
                            $currentDate = \Carbon\Carbon::now();
                            $remainingDays = $currentDate->diffInDays($expiryDate);
                            }
                        ?>
                        <!-- <td>
                            {!! formatedDate(@$list->expiry_date) !!}
                            @if (isset($list->expiry_date))
                            ({!! $remainingDays !!} Days)
                            @endif
                        </td> -->
                        <?php $total += ($list->taxable_rate != '') ? $list->taxable_rate : 0; ?>
                        <td>₹{!! @$list->taxable_rate !!}{!! ($list->tax != '') ? ' (' . @$list->tax . ')' : '' !!}</td>
                    </tr>
                    @php $i++; @endphp
                @endforeach
            @else
            <tr>
                <td colspan="13">No Data Found</td>
            </tr>
            @endif
        </tbody>
    </table>
</div>
<nav class="row align-items-center mt-3">
    <div class="col-md-6"><h6>Total Revenue: ₹{!! isset($total) ? $total : 0 !!}</h6></div>
    <div class="col-md-6" style="text-align: right;">
        <div class="btn-group mb-0">
            <a class="btn btn-outline-primary" href="{!! route('revenue.report.export', ['type' => request()->route('type')]) !!}" target="_blank"><i class="bx bx-download"></i> Export</a>
        </div>
    </div>
</nav>
</div>

