@extends('layouts.finance')
@section('title', ($report['selected_product']->product_name ?? 'Item').' Points')
@section('subtitle', 'Agent point activity from Examism vouchers')
@section('content')
@php
$filters = $report['filters'];
$agentSummaries = $report['agent_summaries'];
$selectedProduct = $report['selected_product'];
$summary = $report['item_summary'];
$baseParams = [
'type' => $report['type'],
'mode' => $filters['mode'],
'month' => $filters['month'],
'year' => $filters['year'],
'from' => $filters['from'],
'to' => $filters['to'],
];
@endphp
{{ $selectedProduct->product_name ?? 'Item' }} Details
Selected Range: {{ $summary['from'] }} to {{ $summary['to'] }}
{{ number_format($report['total']) }} points
Sold Vouchers
{{ number_format($summary['sold_vouchers']) }}
{{ $summary['from'] }} to {{ $summary['to'] }}
@php $pointWord = $report['type'] === 'redeemed' ? 'Redeemed' : 'Points'; @endphp
Quarterly {{ $pointWord }}
{{ number_format($summary['quarterly_points'], 2) }}
Yearly {{ $pointWord }}
{{ number_format($summary['yearly_points'], 2) }}
Total {{ $pointWord }}
{{ number_format($summary['total_points'], 2) }}
Agents
{{ $agentSummaries->total() }} agents
| Agent ID |
Business Name |
Agent |
Email |
Vouchers |
Orders |
Rows |
Points |
@forelse($agentSummaries as $agent)
| {{ $agent->agent_id ?: '-' }} |
{{ $agent->agent_business_name ?: '-' }} |
@if($agent->agent_id)
{{ $agent->agent_name }}
@else
{{ $agent->agent_name }}
@endif
|
{{ $agent->agent_email ?: '-' }} |
{{ number_format($agent->vouchers ?? 0) }} |
{{ number_format($agent->orders_count) }} |
{{ number_format($agent->rows_count) }} |
{{ number_format($agent->points) }} |
@empty
| No agent point activity found for this filter. |
@endforelse
@if($agentSummaries->hasPages())
Showing {{ number_format($agentSummaries->firstItem()) }} to {{ number_format($agentSummaries->lastItem()) }} of {{ number_format($agentSummaries->total()) }} agents
@if($agentSummaries->onFirstPage())
Previous
@else
Previous
@endif
@foreach($agentSummaries->getUrlRange(max(1, $agentSummaries->currentPage() - 2), min($agentSummaries->lastPage(), $agentSummaries->currentPage() + 2)) as $page => $url)
@if($page === $agentSummaries->currentPage())
{{ $page }}
@else
{{ $page }}
@endif
@endforeach
@if($agentSummaries->hasMorePages())
Next
@else
Next
@endif
@endif
@endsection