@extends('layouts.app') @section('title', 'Journal Voucher ' . $journal->voucher_no) @section('content') @php $impact = $journal->lines->groupBy('ledger_account_id')->map(function ($lines) { $debit = (float) $lines->where('side', 'Debit')->sum('amount'); $credit = (float) $lines->where('side', 'Credit')->sum('amount'); return ['name' => $lines->first()->account_name, 'net' => $debit - $credit]; }); @endphp

Journal voucher {{ $journal->voucher_no }}

Double-entry posting · {{ $journal->entry_date?->format('d F Y') }}
Journal entries
@csrf @method('DELETE')
@include('finance._nav')

{{ \App\Models\Setting::get('school_name', 'School') }}

{{ \App\Models\Setting::get('school_address', '') }}
Journal voucher · {{ $journal->voucher_no }}
{{ ucfirst($journal->status) }}
Date: {{ $journal->entry_date?->format('d M Y') }}
Reference: {{ $journal->reference ?: '—' }}
@foreach($journal->debitLines() as $line) @if($line->memo)@endif @endforeach @foreach($journal->creditLines() as $line) @if($line->memo)@endif @endforeach
Details / Accounts affectedDebit (KES)Credit (KES)
{{ $line->account_name }} {{ money($line->amount) }} —
{{ $line->memo }}
↳{{ $line->account_name }} — {{ money($line->amount) }}
{{ $line->memo }}
Totals {{ money($journal->totalDebit()) }} {{ money($journal->totalCredit()) }}
Narration
{{ $journal->narration }}
Posted by {{ $journal->creator?->name ?? 'System' }} on {{ $journal->created_at?->format('d M Y, H:i') }}

Ledger impact

Net effect of this voucher on each account, using its normal balance.
{{ $journal->isBalanced() ? 'Balanced' : 'Out of balance' }}
@foreach($impact as $item) @endforeach
AccountNet effect
{{ $item['name'] }} {{ $item['net'] == 0 ? '—' : ($item['net'] > 0 ? 'Dr ' : 'Cr ') . money(abs($item['net'])) }}
@endsection