@extends('layouts.app') @section('page-title', __('My Payments')) @section('page-heading', __('My Payments')) @section('styles') @endsection @section('content') @php $paymentsCollection = $pagedPayments->getCollection(); $aggregatedPayments = $paymentsCollection->filter(function($payment) { return $payment->invoice_type === 'aggregated'; }); $individualPayments = $paymentsCollection->filter(function($payment) { return $payment->invoice_type === 'individual' || $payment->invoice_type === null; }); @endphp
@if($aggregatedPayments->isNotEmpty())
ETIMS Invoice Generation Details
Please use the following information:
CPHRM PIN: P052364620V
CPHRM Phone No: 0748778304
Description: Data Collection Professional fee
@if($aggregatedPayments->whereNull('new_invoice_file')->count() > 0 || $aggregatedPayments->where('status', 'Rejected')->count() > 0)
Aggregated Invoice Amount
Invoice Amount: KES {{ number_format($aggregatedPayments->sum('net_payable') + $aggregatedPayments->sum('tax'), 2) }}
@endif
@if($aggregatedPayments->where('status', 'Rejected')->count() > 0) @php $rejectedPayment = $aggregatedPayments->where('status', 'Rejected')->first(); @endphp
Combined invoice was rejected
@if($rejectedPayment->rejection_reason)
Reason: {{ $rejectedPayment->rejection_reason }}
@endif
@elseif($aggregatedPayments->whereNull('new_invoice_file')->count() > 0) @else @php $latestAggregated = $aggregatedPayments->whereNotNull('new_invoice_file')->first(); @endphp
All aggregated payments invoiced
@if($latestAggregated) @endif
@endif
@endif
@foreach($paymentsCollection as $payment) @endforeach
Payment Cycle Productivity Total Taxable Tax Advanced Net Status Invoice
{{ $payment->paymentCycle->description }} {{ isset($payment->calculated_productivity) ? number_format($payment->calculated_productivity, 2) : number_format($payment->productivity, 2) }} {{ number_format($payment->amount_payable, 2) }} {{ number_format($payment->taxable_amount, 2) }} {{ number_format($payment->tax, 2) }} {{ number_format($payment->advance_pay, 2) }} {{ number_format($payment->net_payable, 2) }} {{ $payment->status }} @if($payment->status == 'Rejected' && $payment->rejection_reason)
{{ $payment->rejection_reason }}
@endif
@if($payment->invoice_type === 'aggregated') Combined invoice above @else {{-- Show FAM Invoice if available --}} @if(isset($payment->fam_invoice) && $payment->fam_invoice) {{-- Fall back to payment invoice --}} @elseif($payment->invoice_file)
View @if($payment->status == 'Rejected') @endif
@else @endif @endif
{{ $pagedPayments->links() }}
@endsection @push('scripts') @endpush