Reports
Download Awesome Pdf's
@if(isset($invoices) && $invoices->isNotEmpty())
@php
$groupedInvoices = $invoices->groupBy(fn($invoice) => $invoice->prefix ?? 'Unknown');
// Map company name (prefix) to type
$companyTypes = [
'OBE' => 'OBE',
'SNT' => 'SNT',
];
@endphp
@foreach($groupedInvoices as $prefix => $companyInvoices)
@php
$slugPrefix = Str::slug($prefix ?: 'unknown-prefix');
$prefixId = optional($companyInvoices->first())->prefix_id ?? 'unknown-id';
// Use company_name instead of prefix
$companyName = $companyInvoices->first()->company_name ?? 'Unknown Company';
$companyType = $companyTypes[$companyName] ?? 'UNKNOWN';
$isOBE = $companyType === 'OBE';
@endphp
@endforeach
@endif
📁
{{ $prefix }}
📂
Release Documents
@foreach($companyInvoices as $invoice)
@php
$releaseType = $isOBE ? 'releaserequestpdf' : 'releasenotepdf';
$releaseLabel = $isOBE ? 'Release Request' : 'Release Note';
@endphp
@endforeach
📄
{{ $releaseLabel }} - #{{ $invoice->id }}
📂
Invoice Documents
@foreach($companyInvoices as $invoice)
@php
$invoiceType = $isOBE ? 'invoicepdf' : 'sntinvoicepdf';
$invoiceLabel = $isOBE ? 'Sales Invoice' : 'SNT Invoice';
@endphp
@endforeach
📄
{{ $invoiceLabel }} - #{{ $invoice->id }}