@extends('dashboard.layouts.app') @section('content') @include('components.alert')
Back @if (in_array($payment->status, ['draft', 'pending'], true)) Edit
@csrf
@endif
{{ $payment->payment_no }}
{{ $payment->partyLabel }}
@php $statusClass = match ($payment->status) { 'posted' => 'ui-pill--success', 'draft' => 'ui-pill--warn', 'pending' => 'ui-pill--primary', 'reversed' => 'ui-pill--danger', 'voided' => 'ui-pill--neutral', default => 'ui-pill--neutral', }; @endphp {{ ucfirst($payment->status) }}
Payment Date
{{ optional($payment->payment_date)->format('Y-m-d') ?? $payment->payment_date }}
Journal Reference
{{ $payment->journalEntry?->reference_no ?? '-' }}
Direction
{{ ucfirst($payment->direction) }}
Payment Method
{{ ucwords(str_replace('_', ' ', $payment->payment_method ?? 'cash')) }}
Cost Center
{{ $payment->costCenter ? $payment->costCenter->code . ' - ' . $payment->costCenter->title : '-' }}
From Account
{{ $payment->fromAccount?->code }} - {{ $payment->fromAccount?->title }}
To Account
{{ $payment->toAccount?->code }} - {{ $payment->toAccount?->title }}
Party
{{ $payment->partyLabel }}
Amount
{{ number_format((float) ($payment->treasury_amount ?? $payment->amount), 2) }} {{ $payment->treasury_currency ?: $payment->currency }}
Journal Entry
@if ($payment->journalEntry) @foreach ($payment->journalEntry->lines as $line) @endforeach
Account Cost Center Debit Credit
{{ $line->account?->title }}
{{ $line->account?->code }}
@if ($line->costCenter)
{{ $line->costCenter->title }}
{{ $line->costCenter->code }}
@else - @endif
{{ $line->debit > 0 ? number_format($line->debit, 2) : '-' }} {{ $line->credit > 0 ? number_format($line->credit, 2) : '-' }}
@else
This payment has not been posted yet.
@endif
Allocations
@forelse ($payment->allocations as $allocation) @empty @endforelse
Document Amount Reversal
{{ class_basename($allocation->allocatable_type) }} #{{ $allocation->allocatable_id }} {{ number_format((float) $allocation->allocated_amount, 2) }} {{ $allocation->is_reversal ? 'Yes' : 'No' }}
No allocations linked.
Notes
{{ $payment->notes ?: '-' }}
Reversal Reason
{{ $payment->reversal_reason ?: '-' }}
@if ($payment->status === 'posted')
@csrf
@endif
@endsection