@extends('layouts.app') @section('title', 'Credit Note Details') @section('content')

{{ $creditNote->credit_note_number }}

@if($creditNote->status == 'open') @endif
Credit Note Details
@php $badgeClass = [ 'open' => 'bg-light-primary text-primary', 'applied' => 'bg-light-success text-success', 'refunded' => 'bg-light-info text-info', 'draft' => 'bg-light-secondary text-secondary' ][$creditNote->status] ?? 'bg-light-secondary text-secondary'; @endphp {{ $creditNote->status }}
@foreach($creditNote->items as $item) @endforeach @if($creditNote->tax_total > 0) @endif
Item Name Quantity Rate Amount
{{ $item->name }} {{ number_format($item->quantity, 2) }} {{ formatCurrency($item->rate) }} {{ formatCurrency($item->amount) }}
Subtotal {{ formatCurrency($creditNote->subtotal) }}
Tax {{ formatCurrency($creditNote->tax_total) }}
Total Credit {{ formatCurrency($creditNote->total) }}
Used Amount
{{ formatCurrency($creditNote->used_amount) }}
Remaining Balance
{{ formatCurrency($creditNote->remaining_balance) }}
Customer Detail
{{ $creditNote->customer->name }}
{{ $creditNote->customer->email }}

CN Date: {{ \Carbon\Carbon::parse($creditNote->date)->format('d M Y') }}
@if($creditNote->invoice) @endif
Reason: {{ $creditNote->reason ?? 'N/A' }}
@endsection