@extends('admin.layouts.app') @section('title', 'Reconciliation Report #'.$run->id) @section('page-title', 'Reconciliation Report #'.$run->id) @section('page-subtitle', 'Portal payments vs Paystack transactions and payouts') @section('content') @php $matches = collect($report['transaction_matches'] ?? []); $settlements = collect($report['settlement_reconciliation'] ?? []); $bankReport = $report['bank_reconciliation'] ?? null; $matched = $matches->where('status', 'matched'); $portalOnly = $matches->where('status', 'portal_only'); $paystackOnly = $matches->where('status', 'paystack_only'); $mismatches = $matches->where('status', 'amount_mismatch'); $bankPayoutMatches = collect($bankReport['payout_matches'] ?? []); $bankMatched = $bankPayoutMatches->where('status', 'matched'); $payoutNotInBank = $bankPayoutMatches->where('status', 'payout_not_in_bank'); $bankOnly = collect($bankReport['bank_only'] ?? []); $bankSettlements = collect($bankReport['bank_settlement_reconciliation'] ?? []); $balanced = $run->isBalanced(); @endphp
Back to Reconciliation
@if($balanced)
Reconciliation is balanced — portal, Paystack, payouts@if($run->hasBankStatement()) and bank credits@endif all align.
@else
Reconciliation has discrepancies. Review the sections below.
@endif @if(!empty($bankReport['warnings'])) @foreach($bankReport['warnings'] as $warning)
{{ $warning }}
@endforeach @endif
Portal Payments

{{ number_format($run->portal_payment_count) }}

₦{{ number_format($run->portal_gross_total, 2) }}
Paystack Transactions

{{ number_format($run->paystack_transaction_count) }}

₦{{ number_format($run->paystack_gross_total, 2) }}
Matched

{{ number_format($run->matched_count) }}

Net due: ₦{{ number_format($run->paystack_net_total, 2) }}
Payouts Settled

₦{{ number_format($run->payout_settled_total, 2) }}

Fees: ₦{{ number_format($run->paystack_fees_total, 2) }}
Portal Only

{{ number_format($run->portal_only_count) }}

Paystack Only

{{ number_format($run->paystack_only_count) }}

Amount Mismatches

{{ number_format($run->amount_mismatch_count) }}

Settlement Variances

{{ number_format($run->settlement_variance_count) }}

@if($run->hasBankStatement())
Bank Credits

{{ number_format($run->bank_credit_count) }}

₦{{ number_format($run->bank_credit_total, 2) }}
Payouts in Bank

{{ number_format($run->bank_matched_count) }}

Payout Not in Bank

{{ number_format($run->payout_not_in_bank_count) }}

Bank Only / Variances

{{ number_format($run->bank_only_count) }} / {{ number_format($run->bank_variance_count) }}

@endif
@forelse($matched as $row) @empty @endforelse
ReferenceUserConferencePortalPaystackNet DueFeesSettlement
{{ $row['reference'] }} {{ $row['portal_user'] ?? '—' }}
{{ $row['portal_email'] ?? '' }}
{{ $row['portal_conference'] ?? '—' }} ₦{{ number_format($row['portal_amount'], 2) }} ₦{{ number_format($row['paystack_amount'], 2) }} ₦{{ number_format($row['paystack_amount_due'], 2) }} ₦{{ number_format($row['paystack_fees'], 2) }} {{ $row['settlement_date'] ?? '—' }}
No matched transactions.

Successful portal payments with no matching Paystack transaction reference in the uploaded report.

@forelse($portalOnly as $row) @empty @endforelse
ReferenceUserConferenceTypeAmountPaid At
{{ $row['reference'] }} {{ $row['portal_user'] ?? '—' }}
{{ $row['portal_email'] ?? '' }}
{{ $row['portal_conference'] ?? '—' }} {{ str_replace('_', ' ', ucfirst($row['portal_type'] ?? '')) }} ₦{{ number_format($row['portal_amount'], 2) }} {{ $row['portal_paid_at'] ?? '—' }} @if(!empty($row['payment_id'])) View @endif
No unmatched portal payments.

Paystack transactions in the CSV with no matching portal payment record.

@forelse($paystackOnly as $row) @empty @endforelse
ReferenceEmailAmountNet DueFeesTransaction DateSettlement
{{ $row['reference'] }} {{ $row['paystack_email'] ?? '—' }} ₦{{ number_format($row['paystack_amount'], 2) }} ₦{{ number_format($row['paystack_amount_due'], 2) }} ₦{{ number_format($row['paystack_fees'], 2) }} {{ $row['paystack_transaction_date'] ?? '—' }} {{ $row['settlement_date'] ?? '—' }}
No unmatched Paystack transactions.
@forelse($mismatches as $row) @empty @endforelse
ReferenceUserPortal AmountPaystack AmountVarianceSettlement
{{ $row['reference'] }} {{ $row['portal_user'] ?? '—' }} ₦{{ number_format($row['portal_amount'], 2) }} ₦{{ number_format($row['paystack_amount'], 2) }} ₦{{ number_format($row['variance'], 2) }} {{ $row['settlement_date'] ?? '—' }}
No amount mismatches.

Compares total Amount Due from transaction reports (by settlement date) against Settled Amount from payout reports.@if($run->hasBankStatement()) Bank credit totals are shown when available.@endif

@if($run->hasBankStatement())@endif @forelse($settlements as $row) @if($run->hasBankStatement()) @endif @empty @endforelse
Settlement Date Transaction Net Payout Settled Paystack VarianceBank CreditsBank VarianceStatus
{{ $row['settlement_date'] }} ₦{{ number_format($row['transaction_net_total'], 2) }} ₦{{ number_format($row['payout_settled_total'], 2) }} ₦{{ number_format($row['variance'], 2) }}₦{{ number_format($row['bank_credit_total'] ?? 0, 2) }} {{ isset($row['bank_variance']) ? '₦'.number_format($row['bank_variance'], 2) : '—' }} @if($row['status'] === 'matched' && (($row['bank_status'] ?? 'matched') === 'matched' || ! $run->hasBankStatement())) Matched @else Variance @endif
No settlement data found.
@if($run->hasBankStatement())

Paystack payouts matched to incoming bank credits by amount and date (within 3-day window).

@forelse($bankMatched as $row) @empty @endforelse
Payout DatePayout AmountBank DateBank AmountDays DiffDescription
{{ $row['payout_settlement_date'] }} ₦{{ number_format($row['payout_amount'], 2) }} {{ $row['bank_date'] }} ₦{{ number_format($row['bank_amount'], 2) }} {{ $row['days_difference'] }} {{ Str::limit($row['bank_description'] ?? '—', 60) }}
No payout-to-bank matches found.

Paystack reports a payout but no matching credit was found in the bank statement.

@forelse($payoutNotInBank as $row) @empty @endforelse
Payout DatePayout Amount
{{ $row['payout_settlement_date'] }} ₦{{ number_format($row['payout_amount'], 2) }}
All payouts were found in the bank statement.

Bank credits not matched to any Paystack payout in the uploaded reports.

@forelse($bankOnly as $row) @empty @endforelse
Bank DateAmountPaystack-likeDescription
{{ $row['bank_date'] }} ₦{{ number_format($row['bank_amount'], 2) }} {{ !empty($row['is_paystack_like']) ? 'Yes' : 'No' }} {{ Str::limit($row['bank_description'] ?? '—', 80) }}
No unmatched bank credits.

Daily comparison of Paystack payout totals against bank credit totals.

@forelse($bankSettlements as $row) @empty @endforelse
DatePayout SettledBank CreditsVarianceStatus
{{ $row['settlement_date'] }} ₦{{ number_format($row['payout_settled_total'], 2) }} ₦{{ number_format($row['bank_credit_total'], 2) }} ₦{{ number_format($row['variance'], 2) }} @if($row['status'] === 'matched') Matched @else Variance @endif
No bank settlement data.
@endif
Run by {{ $run->createdBy?->name ?? 'System' }} on {{ $run->created_at->format('M d, Y H:i') }}. @if($run->conference) Conference: {{ $run->conference->name }}. @endif @if($run->period_from || $run->period_to) Portal filter: {{ $run->period_from?->format('Y-m-d') ?? 'start' }} to {{ $run->period_to?->format('Y-m-d') ?? 'end' }}. @endif @if($run->hasBankStatement()) Bank statement included. @endif
@endsection