@extends('layouts.app') @section('title', $note->credit_note_number) @section('content')

{{ $note->credit_note_number }}

{{ title_case_words($note->type) }} credit · issued {{ $note->issue_date?->format('d M Y') }}

Print @if (in_array($note->status, ['draft', 'pending_approval'], true))
@csrf
@csrf
@endif @if ($note->status === 'approved')
@csrf @if (! $note->invoice) @endif
@endif @if ($note->status !== 'applied' && $note->status !== 'void')
@csrf
@endif
@include('components.kpi', ['label' => 'Credit amount', 'value' => money($note->amount), 'variant' => 'info']) @include('components.kpi', ['label' => 'Status', 'value' => title_case_words($note->status), 'variant' => $note->status === 'applied' ? 'good' : ($note->status === 'void' || $note->status === 'rejected' ? 'bad' : 'warn')]) @include('components.kpi', ['label' => 'Type', 'value' => title_case_words($note->type)]) @include('components.kpi', ['label' => 'Approved by', 'value' => $note->approved_by ? (string) $note->approved_by : '—'])

Credit note

Number
{{ $note->credit_note_number }}
Customer
@if ($note->customer) {{ $note->customer->display_name }} @else — @endif
Invoice
@if ($note->invoice) {{ $note->invoice->invoice_number }}
balance now {{ money($note->invoice->balance, $note->invoice->currency) }}
@else Not yet applied @endif
Amount
{{ money($note->amount) }}
Type
{{ title_case_words($note->type) }}
Issue date
{{ $note->issue_date?->format('d M Y') }}
Status
{{ title_case_words($note->status) }}
Reason
{{ $note->reason }}

Target invoice

@if ($note->invoice) @foreach ($note->invoice->items as $item) @endforeach
DescriptionAmount
{{ $item->description }} {{ money($item->amount) }}
Invoice total {{ money($note->invoice->total) }}
Already paid {{ money($note->invoice->amount_paid) }}
Credit applied {{ money($note->invoice->credit_applied) }}
Balance {{ money($note->invoice->balance, $note->invoice->currency) }}
@else @include('components.empty-state', [ 'icon' => '📄', 'title' => 'No invoice linked', 'message' => 'Approve the note, then choose which invoice it should settle.', ]) @endif
@if ($org)
Issued by {{ $org->name }} · ledger posting: debit subscription revenue, credit accounts receivable.
@endif
@endsection