@php $base64Image = base64_encode(file_get_contents(public_path('assets/images/tyres_logo.png'))); @endphp Logo

Sales@tyresplanet.com.au

www.tyresplanet.com.au

ABN: 95 633 998 624

TAX INVOICE

Tyres Planet PTY LTD

209 Mcroyle St, Wacol 4076

CALL: 07 3144 3131

Cutomer Details
Statement details
Invoice
Name: {{ $user->name ?? $user->first_name . ' ' . $user->last_name }}
Email: {{ $user->email }}
Phone: {{ $user->phone ?? 'N/A' }}
Address: {{ $user->address ?? '-' }}
Total Outstanding:
${{ number_format($totalInvoiced - $totalPaid, 2) }}
Statement Date: {{ now()->format('d/m/Y') }}
Account Status: {{ ($totalInvoiced - $totalPaid) > 0 ? 'Outstanding' : 'Current' }}

Statement Period: {{ now()->format('M Y') }}

Reference Date: {{ $generated_date ?? now()->format('d-m-Y') }}

Account: {{ strtoupper(substr($user->name ?? 'CUSTOMER', 0, 8)) }}

@php $transactionsPerPage = 12; $transactionChunks = count($statementData) > 0 ? array_chunk($statementData, $transactionsPerPage) : [[]]; $current = 0; $over30 = 0; $over60 = 0; $over90 = 0; $today = now(); @endphp @foreach ($transactionChunks as $chunkIndex => $transactionChunk) @if ($chunkIndex > 0)
@endif
@if ($chunkIndex > 0)
@php $base64Image = base64_encode(file_get_contents(public_path('assets/images/tyres_logo.png'))); @endphp Logo

Sales@tyresplanet.com.au

www.tyresplanet.com.au

ABN: 95 633 998 624

TAX INVOICE

Tyres Planet PTY LTD

209 Mcroyle St, Wacol 4076

CALL: 07 3144 3131

Customer Details
Statement details
Invoice
Name: {{ $user->name ?? $user->first_name . ' ' . $user->last_name }}
Email: {{ $user->email }}
Phone: {{ $user->phone ?? 'N/A' }}
Address: {{ $user->address ?? '-' }}
Total Outstanding:
${{ number_format($totalInvoiced - $totalPaid, 2) }}
Statement Date: {{ now()->format('d/m/Y') }}
Account Status: {{ ($totalInvoiced - $totalPaid) > 0 ? 'Outstanding' : 'Current' }}

Statement Period: {{ now()->format('M Y') }}

Reference Date: {{ $generated_date ?? now()->format('d-m-Y') }}

Account: {{ strtoupper(substr($user->name ?? 'CUSTOMER', 0, 8)) }}

@endif
@if(count($statementData) > 0 && count($transactionChunk) > 0) @foreach($transactionChunk as $index => $item) @endforeach @else @if($chunkIndex == 0) @endif @endif
Date Document Applied To Description Due Date Amount Outstanding
{{ $item['date']->format('d/m/Y') }} {{ $item['document'] }} {{ $item['applied_to'] }} {{ $item['description'] }} {{ $item['due_date']->format('d/m/Y') }} @if($item['amount'] < 0) -${{ number_format(abs($item['amount']), 2) }} @else ${{ number_format($item['amount'], 2) }} @endif @if($item['type'] == 'payment') $0.00 @else ${{ number_format($item['outstanding'], 2) }} @endif
No transactions found for this customer.
@endforeach @php $current = 0; $over30 = 0; $over60 = 0; $over90 = 0; $today = now(); foreach($statementData as $item) { if($item['balance'] > 0) { $daysDiff = $today->diffInDays($item['due_date']); if($daysDiff <= 30) { $current += $item['balance']; } elseif($daysDiff <= 60) { $over30 += $item['balance']; } elseif($daysDiff <= 90) { $over60 += $item['balance']; } else { $over90 += $item['balance']; } } } @endphp