{{-- Status Badge --}}
@php
$statusColors = [
'draft' => 'gray',
'issued' => 'blue',
'partially_applied' => 'amber',
'applied' => 'green',
'void' => 'red',
];
@endphp
{{ ucfirst(str_replace('_', ' ', $selectedCreditNote->status)) }}
{{ $selectedCreditNote->getReasonLabel() }}
{{-- Amount Summary --}}
Total Amount
{{ $selectedCreditNote->currency }} {{ number_format($selectedCreditNote->amount, 2) }}
Amount Used
{{ $selectedCreditNote->currency }} {{ number_format($selectedCreditNote->amount_used, 2) }}
Remaining
{{ $selectedCreditNote->currency }} {{ number_format($selectedCreditNote->getRemainingAmount(), 2) }}
{{-- Details Grid --}}
Workspace
{{ $selectedCreditNote->workspace?->name ?? 'N/A' }}
User
{{ $selectedCreditNote->user?->name ?? 'N/A' }}
{{ $selectedCreditNote->user?->email }}
Created
{{ $selectedCreditNote->created_at->format('d M Y H:i') }}
Issued
{{ $selectedCreditNote->issued_at?->format('d M Y H:i') ?? 'Not issued' }}
@if ($selectedCreditNote->issuedByUser)
by {{ $selectedCreditNote->issuedByUser->name }}
@endif
{{-- Source Information --}}
@if ($selectedCreditNote->order || $selectedCreditNote->refund)
Source
@if ($selectedCreditNote->order)
From Order: {{ $selectedCreditNote->order->order_number }}
@endif
@if ($selectedCreditNote->refund)
From Refund: #{{ $selectedCreditNote->refund->id }}
@endif
@endif
{{-- Applied To --}}
@if ($selectedCreditNote->appliedToOrder)
Applied To
Order: {{ $selectedCreditNote->appliedToOrder->order_number }}
@if ($selectedCreditNote->applied_at)
Applied on {{ $selectedCreditNote->applied_at->format('d M Y H:i') }}
@endif
@endif
{{-- Description --}}
@if ($selectedCreditNote->description)
Description
{{ $selectedCreditNote->description }}
@endif
{{-- Void Information --}}
@if ($selectedCreditNote->isVoid())
Voided on {{ $selectedCreditNote->voided_at->format('d M Y H:i') }}
@if ($selectedCreditNote->voidedByUser)
by {{ $selectedCreditNote->voidedByUser->name }}
@endif
@endif
Close
@endif