@extends('layouts.app') @section('title', __('messages.vouchers')) @section('content')

{{ __('messages.vouchers') }}

{{ __('messages.vouchers_subtitle') }}

{{ __('messages.new_voucher' ?? 'New Voucher') }}
{{-- Tabs --}} {{-- Compact Status Filter --}}
Status: @foreach(['DRAFT' => 'warning', 'POSTED' => 'success', 'CANCELLED' => 'danger'] as $st => $clr) {{ $st }} @endforeach @if($status) @endif
{{-- Table --}}
@forelse($vouchers as $v) @empty @endforelse
# {{ __('messages.type') }} {{ __('messages.debit_account') }} {{ __('messages.credit_account') }} {{ __('messages.amount') }} {{ __('messages.status') }} {{ __('messages.created_by') }} {{ __('messages.date') }} {{ __('messages.actions') }}
#{{ $v->id }} @php $typeConfig = [ 'RECEIPT' => ['icon' => 'fa-arrow-down', 'color' => 'success', 'label' => __('messages.receipts')], 'PAYMENT' => ['icon' => 'fa-arrow-up', 'color' => 'danger', 'label' => __('messages.payments')], 'TRANSFER' => ['icon' => 'fa-right-left', 'color' => 'info', 'label' => __('messages.transfers')], ]; $tc = $typeConfig[$v->voucher_type] ?? ['icon' => 'fa-file', 'color' => 'secondary', 'label' => $v->voucher_type]; @endphp {{ $tc['label'] }} @php $debitAcc = '—'; if ($v->voucher_type === 'RECEIPT') { $debitAcc = $v->treasury_account_code ?: ($v->bank_account_code ?: '—'); } elseif ($v->voucher_type === 'PAYMENT') { $debitAcc = $v->account_code; } elseif ($v->voucher_type === 'TRANSFER') { $debitAcc = $v->recipient_account_code; } @endphp {{ $debitAcc }} @php $creditAcc = '—'; if ($v->voucher_type === 'RECEIPT') { $creditAcc = $v->account_code; } elseif ($v->voucher_type === 'PAYMENT') { $creditAcc = $v->treasury_account_code ?: ($v->bank_account_code ?: '—'); } elseif ($v->voucher_type === 'TRANSFER') { $creditAcc = $v->account_code; } @endphp {{ $creditAcc }} ${{ number_format($v->amount, 2) }} @php $statusBadge = ['DRAFT' => 'warning', 'POSTED' => 'success', 'CANCELLED' => 'danger']; @endphp {{ $v->status }} {{ $v->createdBy?->name ?? '—' }} {{ $v->created_at?->format('d M Y') }} @if($v->status === 'DRAFT')
@csrf
@csrf
@endif

No vouchers found. Create one.

@if($vouchers->hasPages())
{{ $vouchers->withQueryString()->links() }}
@endif
{{-- Modern Confirmation Modal --}} {{-- Toast Notification --}}
@endsection