@extends('layouts.app') @section('title', 'Voucher #' . $voucher->id) @section('content') @php $typeConfig = [ 'RECEIPT' => ['icon' => 'fa-arrow-down', 'color' => 'success', 'label' => 'Receipt', 'ar' => 'سند قبض'], 'PAYMENT' => ['icon' => 'fa-arrow-up', 'color' => 'danger', 'label' => 'Payment', 'ar' => 'سند صرف'], 'TRANSFER' => ['icon' => 'fa-right-left', 'color' => 'info', 'label' => 'Transfer', 'ar' => 'تحويل'], ]; $tc = $typeConfig[$voucher->voucher_type] ?? ['icon' => 'fa-file', 'color' => 'secondary', 'label' => $voucher->voucher_type, 'ar' => '']; $statusBadge = ['DRAFT' => 'warning', 'POSTED' => 'success', 'CANCELLED' => 'danger']; @endphp
{{ $debitCode ?? '—' }}
@if($debitCode && isset($accountNames[$debitCode]))
{{ $creditCode ?? '—' }}
@if($creditCode && isset($accountNames[$creditCode]))
| Group | Debit Account | Credit Account | Debit | Credit | Level |
|---|---|---|---|---|---|
| {{ substr($je->transaction_group_id, 0, 8) }}… | {{ $je->debit_account_code ?? '—' }} |
{{ $je->credit_account_code ?? '—' }} |
{{ $je->debit ? number_format($je->debit, 2) : '—' }} | {{ $je->credit ? number_format($je->credit, 2) : '—' }} | {{ $isParent ? 'Parent' : 'Primary' }} |
| Total | {{ number_format($voucher->journalEntries->sum('debit'), 2) }} | {{ number_format($voucher->journalEntries->sum('credit'), 2) }} | |||
No journal entries yet. Post the voucher to generate them.
@if($voucher->isDraft()) @endif| ID | #{{ $voucher->id }} |
| Type | {{ $tc['label'] }} |
| Status | {{ $voucher->status }} |
| Account |
{{ $voucher->account_code }}
@if(isset($accountNames[$voucher->account_code]))
{{ $accountNames[$voucher->account_code]->name_ar }} / {{ $accountNames[$voucher->account_code]->name_en }}
@endif
|
| Recipient |
{{ $voucher->recipient_account_code }}
@if(isset($accountNames[$voucher->recipient_account_code]))
{{ $accountNames[$voucher->recipient_account_code]->name_ar }} / {{ $accountNames[$voucher->recipient_account_code]->name_en }}
@endif
|
| Treasury |
{{ $voucher->treasury_account_code }}
@if(isset($accountNames[$voucher->treasury_account_code]))
{{ $accountNames[$voucher->treasury_account_code]->name_ar }} / {{ $accountNames[$voucher->treasury_account_code]->name_en }}
@endif
|
| Bank |
{{ $voucher->bank_account_code }}
@if(isset($accountNames[$voucher->bank_account_code]))
{{ $accountNames[$voucher->bank_account_code]->name_ar }} / {{ $accountNames[$voucher->bank_account_code]->name_en }}
@endif
|
| Expense Type | {{ $voucher->expense_type }} |
| Ref. # | {{ $voucher->reference_number ?? '—' }} |
| Entity | {{ $voucher->entity_type ?? '—' }} |
| Created By | {{ $voucher->createdBy?->name ?? '—' }} |
| Posted By | {{ $voucher->postedBy?->name ?? '—' }} |
| Posted At | {{ $voucher->posted_at?->format('d M Y H:i') }} |
| Settlement | {{ $voucher->is_sttel ? '✅ Yes' : '❌ No' }} |
| Note | {{ $voucher->note }} |
View full journal history for the account in this voucher.
@php $mainAcc = \App\Models\Account::where('code', $voucher->account_code)->first(); @endphp @if($mainAcc) Statement for{{ $voucher->account_code }}
@else
@endif