@extends('dashboard.layouts.app') @section('content') @php $totalDebit = 0; $totalCredit = 0; @endphp
Back to List

Journal Entry #{{ $journalEntry->id }}

Registered on {{ $journalEntry->date->format('M d, Y') }}

Reference
JE-{{ str_pad($journalEntry->id, 5, '0', STR_PAD_LEFT) }}
Description / Memo

{{ $journalEntry->description ?: 'No description provided.' }}

Metadata
Created By {{-- {{ $journalEntry->creator->name ?? 'System' }} --}}
Created At {{ $journalEntry->created_at->format('Y-m-d H:i') }}
Entry Date {{ $journalEntry->date->format('Y-m-d') }}
@php $displayPartyName = $journalEntry->payment?->party_name ?: $journalEntry->party_name; $displayPartyType = $journalEntry->payment?->party_type ?: $journalEntry->party_type; $displayPartyRef = $journalEntry->payment?->party_ref ?: $journalEntry->party_ref; @endphp @if($displayPartyName || $displayPartyType)
Party {{ $displayPartyName ?: '-' }} @if($displayPartyType) ({{ ucfirst($displayPartyType) }}) @endif @if($displayPartyRef) - {{ $displayPartyRef }} @endif
@endif
Account Lines

Debit and credit breakdown for this journal entry.

{{ $journalEntry->lines->count() }} Line(s)
@foreach ($journalEntry->lines as $line) @php $totalDebit += $line->debit; $totalCredit += $line->credit; @endphp @endforeach
Account Details Debit Credit
@if($line->debit > 0) {{ number_format($line->debit, 2) }} {{ $journalEntry->currency ?? '' }} @else - @endif @if($line->credit > 0) {{ number_format($line->credit, 2) }} {{ $journalEntry->currency ?? '' }} @else - @endif
Grand Totals {{ number_format($totalDebit, 2) }} {{ $journalEntry->currency ?? '' }} {{ number_format($totalCredit, 2) }} {{ $journalEntry->currency ?? '' }}
Balance Check
{{ abs($totalDebit - $totalCredit) < 0.001 ? 'Balanced Journal Entry' : 'Unbalanced Journal Entry' }}
Debit: {{ number_format($totalDebit, 2) }} {{ $journalEntry->currency ?? '' }} Credit: {{ number_format($totalCredit, 2) }} {{ $journalEntry->currency ?? '' }} Difference: {{ number_format(abs($totalDebit - $totalCredit), 2) }}
Back to List
@endsection