@extends('admin.layouts.app') @section('title', $voucher->voucher_no . ' - Voucher Summary') @section('content')

@if($voucher->voucher_type == 'journal') 📝 Journal Voucher @elseif($voucher->voucher_type == 'receipt') 💰 Receipt Voucher @elseif($voucher->voucher_type == 'payment') 💸 Payment Voucher @elseif($voucher->voucher_type == 'contra') 🔄 Contra Voucher @endif

{{ $voucher->voucher_no }}
@if($voucher->status == 'posted') ✓ Posted @elseif($voucher->status == 'draft') Draft @else Cancelled @endif
@if(session('success'))
✓ {{ session('success') }}
@endif
📋 Voucher Details
Voucher No
{{ $voucher->voucher_no }}
Date
{{ date('d M Y', strtotime($voucher->voucher_date)) }}
@if($voucher->reference_no)
Reference No
{{ $voucher->reference_no }}
@endif
Type
{{ ucfirst($voucher->voucher_type) }}
@if($voucher->narration)
📝 Narration:
{{ $voucher->narration }}
@endif
Created By
{{ $voucher->creator->name ?? 'System' }}
Created At
{{ $voucher->created_at->format('d M Y, h:i A') }}
@if($voucher->status == 'posted' && $voucher->approver)
Approved By
{{ $voucher->approver->name }}
Approved At
{{ $voucher->approved_at->format('d M Y, h:i A') }}
@endif
📝 Transaction Entries
@php $totalDebit = 0; $totalCredit = 0; @endphp @foreach($voucher->transactions as $index => $transaction) @endforeach
# Account Ledger Debit Credit Description
{{ $index + 1 }}
{{ $transaction->ledger->name }}
{{ $transaction->ledger->code ?? 'N/A' }}
@if($transaction->transaction_type == 'debit') Rs. {{ number_format($transaction->amount, 2) }} @php $totalDebit += $transaction->amount; @endphp @else - @endif @if($transaction->transaction_type == 'credit') Rs. {{ number_format($transaction->amount, 2) }} @php $totalCredit += $transaction->amount; @endphp @else - @endif {{ $transaction->narration ?? '-' }}
Total: Rs. {{ number_format($totalDebit, 2) }} Rs. {{ number_format($totalCredit, 2) }} @if($totalDebit == $totalCredit && $totalDebit > 0) ✓ Balanced @else ⚠ Not Balanced @endif
📊 Summary
Total Debit: Rs. {{ number_format($totalDebit, 2) }}
Total Credit: Rs. {{ number_format($totalCredit, 2) }}
Difference: Rs. {{ number_format(abs($totalDebit - $totalCredit), 2) }}
@if($voucher->status == 'draft') ✎ Edit Voucher
@csrf
@csrf @method('DELETE')
@elseif($voucher->status == 'posted')
@csrf
@endif ← Back to List
@endsection