@extends('layouts.admin') @section('title', 'Voucher Details') @section('content') @php $debit = (float) $voucher->entries->sum('debit'); $credit = (float) $voucher->entries->sum('credit'); @endphp
{{ $voucher->voucher_no }} {{ ucfirst($voucher->status ?: 'draft') }}
{{ $voucher->voucher_date->format('d M Y') }}@if ($voucher->preparedBy) ยท prepared by {{ $voucher->preparedBy->name }}@endif
@if ($voucher->narration)

Narration: {{ $voucher->narration }}

@endif @foreach ($voucher->entries as $e) @endforeach
Account Debit Credit Memo
{{ $e->account?->account_name }}@if ($e->account?->account_code) ({{ $e->account->account_code }})@endif {{ (float) $e->debit > 0 ? number_format($e->debit, 2) : '' }} {{ (float) $e->credit > 0 ? number_format($e->credit, 2) : '' }} {{ $e->memo }}
Total {{ number_format($debit, 2) }} {{ number_format($credit, 2) }}
@endsection