@extends('layouts.admin') @section('title', $journalEntry->number) @section('content') @php $statusTone = match($journalEntry->status) { 'posted' => 'success', 'approved' => 'info', 'draft' => 'muted', 'reversed' => 'danger', default => 'warning', }; $debitTotal = $journalEntry->lines->sum('debit_cents'); $creditTotal = $journalEntry->lines->sum('credit_cents'); @endphp Back @if(session('status'))
{{ session('status') }}
@endif @if($errors->any())
{{ $errors->first() }}
@endif @if(in_array($journalEntry->status, ['draft', 'pending_approval'], true))
@csrf
@endif @if(in_array($journalEntry->status, ['draft', 'pending_approval', 'approved'], true))
@csrf
@endif @if($journalEntry->status === 'posted')
@csrf
@endif
Status
{{ str($journalEntry->status)->headline() }}
Fiscal period
{{ $journalEntry->fiscalPeriod?->name ?? '—' }}
Debits
AUD {{ number_format($debitTotal / 100, 2) }}
Credits
AUD {{ number_format($creditTotal / 100, 2) }}
@foreach($journalEntry->lines as $line) @endforeach
Account Memo Debit Credit
{{ $line->account?->code }}
{{ $line->account?->name }}
{{ $line->memo ?: '—' }} {{ $line->debit_cents ? number_format($line->debit_cents / 100, 2) : '—' }} {{ $line->credit_cents ? number_format($line->credit_cents / 100, 2) : '—' }}
Totals {{ number_format($debitTotal / 100, 2) }} {{ number_format($creditTotal / 100, 2) }}
Posted
{{ $journalEntry->posted_at?->format('d M Y H:i') ?? 'Not posted' }}
Reversal of
@if($journalEntry->reversalOf) {{ $journalEntry->reversalOf->number }} @else — @endif
@endsection