@php use App\Support\MoneyFormat; $srcLabel = ['own' => __('WhatsApp Store'), 'woocommerce' => __('WooCommerce'), 'shopify' => __('Shopify')][$source] ?? __('All stores'); $allOk = collect($checklist)->every(fn ($c) => $c['ok']); @endphp
{{ $srcLabel }} · {{ __('Invoices') }}

{{ __('Auto') }} {{ __('invoices') }}

{{ __('A numbered PDF invoice is generated for each paid order and delivered on WhatsApp — the customer taps a button to view or download it.') }}

@if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif
{{-- Setup checklist / warnings --}} @unless ($allOk)
{{ __('Finish setup to auto-send') }}
    @foreach ($checklist as $c)
  • @if ($c['ok']) @else@endif {{ $c['label'] }}@unless ($c['ok']) — {{ $c['hint'] }}@endunless
  • @endforeach
{{ __('Open settings') }}
@endunless {{-- Generate from paid orders --}} @if ($orders->isNotEmpty())
{{ __('Paid orders without an invoice') }}
@foreach ($orders as $o)
@csrf
@endforeach
@endif {{-- Invoice list --}}
@if ($invoices->isEmpty())
{{ __('No invoices yet. Generate one from a paid order above, or turn on auto-send in Settings.') }}
@else
@foreach ($invoices as $inv) @php $sc = match($inv->send_status){ 'sent'=>'bg-wa-green/15 text-wa-deep','send_failed'=>'bg-accent-coral/10 text-accent-coral','ready','rendering','pending'=>'bg-accent-amber/20 text-[#7B5A14]',default=>'bg-paper-100 text-ink-600' }; @endphp @endforeach
{{ __('Number') }}{{ __('Customer') }}{{ __('Type') }}{{ __('Total') }}{{ __('Delivery') }}
{{ $inv->invoice_number }} {{ $inv->buyer_name ?: '—' }} {{ str_replace('_',' ',$inv->doc_type) }} {{ $inv->total_display }} {{ str_replace('_',' ',$inv->send_status) }} PDF
@endif
{{-- How it works --}}