@extends('layouts.app') @section('page-title', 'Level 1 Flow') @section('content')
Level 1 Receipts
PKR {{ number_format((float) $totalReceipts, 0) }}
Posted customer receipts
Sent To Level 2
PKR {{ number_format((float) $totalTransfers, 0) }}
Tifwa, AR Commission, and other clearing
Remaining In Level 1
PKR {{ number_format((float) $totalReceipts - (float) $totalTransfers, 0) }}
Posted receipts minus completed transfers

Receiving Accounts

@if($receivingAccounts->isEmpty())
No Level 1 receiving accounts are configured.
@else
@foreach($receivingAccounts as $account) @endforeach
Account Kind Bank/Gateway Posted Balance
{{ $account->name }} {{ str_replace('_', ' ', $account->account_kind) }} {{ $account->bank_name ?? 'Other' }} {{ $account->currency->code }} {{ number_format($account->current_balance, 2) }}
@endif

Level 2 Clearing Targets

@if($clearingAccounts->isEmpty())
No Level 2 clearing accounts are configured.
@else
@foreach($clearingAccounts as $account) @endforeach
Account Kind Resource Posted Balance
{{ $account->name }} {{ str_replace('_', ' ', $account->account_kind) }} {{ $account->bank_name ?? 'Other' }} {{ $account->currency->code }} {{ number_format($account->current_balance, 2) }}
@endif

Recent Level 1 Ledger

@if($recentTransactions->isEmpty())
No Level 1 ledger postings yet.
@else
@foreach($recentTransactions as $transaction) @php $receiptEntry = $transaction->entries->firstWhere('entry_side', 'debit'); $amount = $transaction->accountTransfer?->amount ?? $receiptEntry?->amount ?? 0; $currency = $receiptEntry?->currency?->code ?? $transaction->accountTransfer?->currency?->code ?? 'PKR'; @endphp @endforeach
Date No. Type Route Reference Amount
{{ $transaction->business_date->format('Y-m-d') }} {{ $transaction->transaction_no }} {{ str_replace('_', ' ', $transaction->transaction_type) }} @if($transaction->transaction_type === 'customer_receipt') {{ $transaction->paymentChannel->name ?? 'Channel' }} to {{ $receiptEntry?->moneyAccount?->name ?? 'account' }} @else {{ $transaction->accountTransfer?->fromMoneyAccount?->name ?? 'source' }} to {{ $transaction->accountTransfer?->toMoneyAccount?->name ?? 'destination' }} @endif {{ $transaction->reference ?? '-' }} {{ $currency }} {{ number_format((float) $amount, 2) }} View
{{ $recentTransactions->links() }}
@endif
@endsection