{{-- Author By : zulfazdliabuas@gmail.com | Date : 2026 --}} @php use Illuminate\Support\Facades\Storage; use Illuminate\Support\Str; @endphp @push('styles') @endpush
@php $viewer = auth()->user(); $canCreateRequests = $viewer?->hasAnyRole(['admin', 'ao', 'spv']) ?? false; $canAmendRequests = $viewer?->hasAnyRole(['admin', 'ao']) ?? false; $canSubmitToLhdn = $viewer?->hasAnyRole(['admin', 'ao']) ?? false; $canMarkPaid = $viewer?->hasAnyRole(['admin', 'ao', 'spv']) ?? false; $invoiceStatusClasses = [ 'unpaid' => 'text-bg-warning text-dark', 'paid' => 'text-bg-success', 'cancelled' => 'text-bg-secondary', ]; $statusClasses = [ 'pending' => 'text-bg-secondary', 'new_request' => 'text-bg-info', 'approved' => 'text-bg-info', 'waiting_validation' => 'text-bg-warning', 'validated' => 'text-bg-success', 'failed' => 'text-bg-danger', 'einvoice_sent_to_customer' => 'text-bg-success', 'cancelled' => 'text-bg-secondary', ]; @endphp

e-Invoice Requests

{{-- Filter card hidden --}} {{--
Reset
--}} @if(session('success'))
{{ session('success') }}
@endif @if($errors->any())
{{ $errors->first() }}
@endif
Export Excel
@forelse($requests as $item) @empty @endforelse
No Name Email/Phone Billing Invoice Car Plate Location Amount (RM) Billing Status LHDN Status Receipt Actions
{{ $loop->index + 1 }} @if($canAmendRequests) {{ $item->name }} @else {{ $item->name }} @endif
{{ $item->email ?? '-' }}
{{ $item->phone ?? '' }}
{{ $item->invoice_no }}
{{ optional($item->txn_date)->format('d/m/Y H:i') ?? '-' }}
{{ $item->car_plate ?? '-' }} {{ $item->site->name ?? '-' }} {{ $item->amount !== null ? number_format($item->amount, 2) : '-' }} {{ $item->invoice_status_label }} @if($item->payment_date)
{{ optional($item->payment_date)->format('d/m/Y') }}
@endif
{{ $item->payment_stage_label }}
@if($item->status) {!! implode('
', explode(' ', $item->status_label)) !!}
@endif
{{ $item->lhdn_status ?: 'Not submitted' }}
@php $receiptUrl = $item->receipt_path ? Storage::url($item->receipt_path) : ''; if ($receiptUrl) { $host = parse_url($receiptUrl, PHP_URL_HOST); $path = parse_url($receiptUrl, PHP_URL_PATH) ?: $receiptUrl; if (!$host || $host === 'localhost') { $receiptUrl = request()->getSchemeAndHttpHost() . $path; } } @endphp @if($receiptUrl) View @else - @endif @php $hasActions = ($canSubmitToLhdn && ( (($item->invoice_status ?? 'unpaid') === 'paid' && !$item->payment_approved_at) || ($item->payment_approved_at && $item->customer_requested_at) || (($item->invoice_status ?? 'unpaid') === 'paid' && $item->payment_approved_at && !$item->customer_requested_at) || (($item->invoice_status ?? 'unpaid') === 'paid' && $item->customer_requested_at && !($item->payment_approved_at && $item->customer_requested_at)) )) || $canAmendRequests; @endphp @if($hasActions) @endif
No records.
@if($canCreateRequests) @endif @if($canAmendRequests) @foreach($requests as $item) @endforeach @endif
@push('scripts') @endpush