@extends('layouts.app') @section('title', 'Approved Bandwidth Logs - Company Wise') @section('page-title', 'Approved Bandwidth Logs - Company Wise') @section('content')
@if(session('success')) @endif @if(session('error')) @endif
@if(($groups ?? collect())->isEmpty())
No Approved Tickets Available

There are no approved tickets waiting for assignment.

@else @foreach($groups as $customerId => $logs)
{{ optional($logs->first()->customer)->company_name ? $logs->first()->customer->company_name . ' - ' . $logs->first()->customer->name : optional($logs->first()->customer)->name ?? 'Unknown Customer' }} @if(optional($logs->first()->customer)->email) ({{ $logs->first()->customer->email }}) @endif
Total approved logs: {{ $logs->count() }}
@csrf
0 selected
@php $logsByInvoice = $logs->groupBy(function($log) { return $log->salesInvoiceItem && $log->salesInvoiceItem->salesInvoice ? ($log->salesInvoiceItem->salesInvoice->id ?? 'no-invoice') : 'no-invoice'; }); @endphp
@foreach($logsByInvoice as $invoiceId => $invoiceLogs) @php $firstLog = $invoiceLogs->first(); $invoice = $firstLog->salesInvoiceItem && $firstLog->salesInvoiceItem->salesInvoice ? $firstLog->salesInvoiceItem->salesInvoice : null; $invoiceNumber = $invoice ? ($invoice->invoice_no ?? 'N/A') : 'No Invoice'; $invoiceDate = $invoice && $invoice->invoice_date ? $invoice->invoice_date->format('M d, Y') : ''; $uniqueId = 'invoice-' . $customerId . '-' . ($invoiceId !== 'no-invoice' ? $invoiceId : 'no-inv-' . $customerId); @endphp @endforeach
Invoice Number Invoice Date Items Count
{{ $invoiceNumber }} @if($invoiceDate) {{ $invoiceDate }} @else - @endif {{ $invoiceLogs->count() }} item(s)
@endforeach @endif
@endsection @section('styles') @endsection @push('scripts') @endpush