@extends('layouts.app') @section('title', 'Journal Entry Details') @section('content')

Journal Entry Details

Entry Number

{{ $journalEntry->entry_number }}

Entry Date

{{ $journalEntry->entry_date->format('M d, Y') }}

Status

{{ ucfirst($journalEntry->status) }}

Description

{{ $journalEntry->description }}

@if($journalEntry->reference_type && $journalEntry->reference_id)

Reference: {{ class_basename($journalEntry->reference_type) }} #{{ $journalEntry->reference_id }}

@endif

Journal Entry Lines

@php $totalDebits = 0; $totalCredits = 0; @endphp @foreach($journalEntry->lines->sortBy('line_number') as $line) @php $totalDebits += $line->debit_amount; $totalCredits += $line->credit_amount; @endphp @endforeach
Line # Account Code Account Name Description Debit Credit
{{ $line->line_number }} {{ $line->account->account_code }} {{ $line->account->account_name }} {{ $line->description ?? '-' }} @if($line->debit_amount > 0) {{ number_format($line->debit_amount, 2) }} @else - @endif @if($line->credit_amount > 0) {{ number_format($line->credit_amount, 2) }} @else - @endif
Total LKR {{ number_format($totalDebits, 2) }} LKR {{ number_format($totalCredits, 2) }}
{{ round($totalDebits, 2) === round($totalCredits, 2) ? 'Entry is balanced! Total Debits = Total Credits' : 'WARNING: Entry is NOT balanced!' }}

Audit Information

Created By

{{ $journalEntry->creator->name }}

{{ $journalEntry->created_at->format('M d, Y h:i A') }}

@if($journalEntry->status === 'posted' && $journalEntry->approver)

Posted By

{{ $journalEntry->approver->name }}

{{ $journalEntry->posted_at->format('M d, Y h:i A') }}

@endif @if($journalEntry->status === 'void' && $journalEntry->voider)

Voided By

{{ $journalEntry->voider->name }}

{{ $journalEntry->voided_at->format('M d, Y h:i A') }}

@endif

Actions

@if($journalEntry->status === 'draft') @can('post journal entries')
@csrf
@endcan @endif @if($journalEntry->status === 'posted') @can('void journal entries')
@csrf
@endcan @endif Back to List
@endsection