@extends('layouts.finance')
@php
$providerKey = $providerKey ?? '';
$provider = $provider ?? null;
$providers = $providers ?? \App\Support\FinanceSuiteMetrics::KUICKPAY_PROVIDERS;
$providerLabel = $provider['label'] ?? 'All KuickPay';
$providerPrefix = $provider['prefix'] ?? null;
@endphp
@section('title', $providerLabel.' Credits')
@section('subtitle', 'Paid Link1Voucher transactions'.($providerPrefix ? ' for voucher prefix '.$providerPrefix : '').' from the Examism v3 database')
@section('content')
@php
$filters = $filters ?? ['mode' => 'month', 'month' => now()->format('Y-m'), 'from' => now()->startOfMonth()->toDateString(), 'to' => now()->endOfMonth()->toDateString(), 'q' => '', 'provider' => $providerKey];
$rows = $rows ?? collect();
$total = (float) ($total ?? 0);
$feeTotal = (float) ($feeTotal ?? 0);
$todayTotal = (float) ($todayTotal ?? 0);
$todayFee = (float) ($todayFee ?? 0);
$todayNet = (float) ($todayNet ?? max(0.0, $todayTotal - $todayFee));
$slabs = $slabs ?? \App\Support\FinanceSuiteMetrics::KUICKPAY_FEE_SLABS;
$isPaginated = $rows instanceof \Illuminate\Contracts\Pagination\LengthAwarePaginator;
@endphp
{{-- FILTERS --}}
Filters
{{ $filters['mode'] === 'date' ? 'Date wise' : 'Monthly' }}{{ $providerPrefix ? ' · '.$providerPrefix : '' }}
{{-- SUMMARY KPI --}}
Total Credits (Filtered)
{{ $metrics->money(max(0, $total - $feeTotal), 'PKR') }}
Before fee: {{ $metrics->money($total, 'PKR') }}
{{ \Illuminate\Support\Carbon::parse($filters['from'])->format('M d, Y') }}
–
{{ \Illuminate\Support\Carbon::parse($filters['to'])->format('M d, Y') }}
Total Fee (Filtered)
{{ $metrics->money($feeTotal, 'PKR') }}
Net after fee: {{ $metrics->money(max(0, $total - $feeTotal), 'PKR') }}
{{-- Today KPI: credits --}}
Today Credits
{{ $metrics->money($todayTotal, 'PKR') }}
{{ now()->format('M d, Y') }}
{{-- Today KPI: fee --}}
Today Fee
{{ $metrics->money($todayFee, 'PKR') }}
Net after fee: {{ $metrics->money($todayNet, 'PKR') }}
Rows (This Page)
{{ $isPaginated ? number_format($rows->count()) : number_format(count($rows)) }}
Status = Paid
@if($isPaginated)
Total Rows
{{ number_format($rows->total()) }}
Across all pages
@endif
{{-- FEE STRUCTURE REFERENCE --}}
Fee Structure
Per single transaction
| Transaction Amount |
Fee (PKR) |
@foreach($slabs as $slab)
| {{ $slab['label'] }} |
{{ number_format($slab['fee']) }} |
@endforeach
{{-- TRANSACTIONS TABLE --}}
{{ $providerLabel }} Transactions
Link1Voucher · Status = Paid{{ $providerPrefix ? ' · Prefix '.$providerPrefix : '' }}
| # |
Voucher |
Candidate |
Agent ID |
Amount (PKR) |
Fee (PKR) |
Transaction Date |
Status |
@forelse($rows as $i => $row)
@php
$offset = $isPaginated ? (($rows->currentPage() - 1) * $rows->perPage()) : 0;
$rowNum = $offset + $i + 1;
$voucher = $row->Voucher ?? '-';
$candName = $row->CandName ?? '-';
$agentId = $row->agent_id ?? '-';
$amount = (float) ($row->TransactionAmount ?? 0);
$fee = $metrics->kuickpayFee($amount);
$txDate = $row->TransactionDate ?? '-';
$status = $row->Status ?? '-';
@endphp
| {{ $rowNum }} |
{{ $voucher }} |
{{ $candName }} |
#{{ $agentId }} |
{{ $metrics->money($amount, 'PKR') }} |
{{ $metrics->money($fee, 'PKR') }} |
{{ $txDate }} |
{{ $status }}
|
@empty
|
No KuickPay transactions found for the selected filters.
|
@endforelse
@if($isPaginated && $rows->hasPages())
{{ $rows->appends(request()->query())->links() }}
@endif
@endsection