{{-- resources/views/invoices/show.blade.php --}} @extends('layouts.app') @section('content')

Invoice Details

Back to List @if($invoice->payment_status == 'pending') Add Payment @endif @if(in_array($invoice->payment_status, ['paid', 'partially_paid'])) Process Refund @endif @if($invoice->payments->count() == 0 && $invoice->refunds->count() == 0) Edit @endif
{{-- Invoice Details --}}

Invoice #{{ $invoice->invoice_number }}

Date: {{ $invoice->created_at->format('d M Y, h:i A') }}

{{ str_replace('_', ' ', ucfirst($invoice->payment_status)) }}

Subscriber Information

{{ $invoice->subscriber->name }}

{{ $invoice->subscriber->email }}

@if($invoice->subscriber->phone)

{{ $invoice->subscriber->phone }}

@endif

Subscription Information

{{ $invoice->subscription->package->name ?? 'N/A' }}

{{ $invoice->subscription->start_date->format('d M Y') }} - {{ $invoice->subscription->end_date->format('d M Y') }}

Type: {{ ucfirst($invoice->invoice_type) }}

Invoice Summary

Subtotal: ৳{{ number_format($invoice->subtotal, 2) }}
@if($invoice->credit_used > 0)
Credit Used: - ৳{{ number_format($invoice->credit_used, 2) }}
@endif @if($invoice->adjustment_credit > 0)
Adjustment Credit: + ৳{{ number_format($invoice->adjustment_credit, 2) }}
@endif
Total Payable: ৳{{ number_format($invoice->total_payable, 2) }}
@if($invoice->creator)
Created by: {{ $invoice->creator->name }} on {{ $invoice->created_at->format('d M Y, h:i A') }}
@endif
{{-- Payments and Refunds --}}
{{-- Payments --}}

Payments

@if($invoice->payments->count() > 0)
@foreach($invoice->payments as $payment)

৳{{ number_format($payment->amount, 2) }}

{{ ucfirst($payment->method) }}

{{ $payment->payment_date->format('d M Y') }}
@if($payment->reference_no)

Ref: {{ $payment->reference_no }}

@endif
@endforeach
Total Paid: ৳{{ number_format($invoice->total_paid, 2) }}
@else

No payments yet

@endif
{{-- Refunds --}}

Refunds

@if($invoice->refunds->count() > 0)
@foreach($invoice->refunds as $refund)

৳{{ number_format($refund->amount, 2) }}

{{ str_replace('_', ' ', ucfirst($refund->refund_type)) }}

{{ $refund->created_at->format('d M Y') }}
@if($refund->note)

{{ $refund->note }}

@endif
@endforeach
Total Refunded: ৳{{ number_format($invoice->total_refunded, 2) }}
@else

No refunds yet

@endif
@endsection