@extends('layouts.app') @section('page-title', __('Payments')) @section('page-heading', __('Payments')) @section('styles') @endsection @section('content')
@if($paymentCycles->isNotEmpty())
@if($selectedCycle)
@csrf @method('DELETE')
@endif @else
No payment cycles available. Please create a new cycle first.
@endif
Import Payments
@if($selectedCycle)
Cycle Totals: Amount: KES {{ number_format($cycleTotals->total_amount ?? 0, 2) }} Tax: KES {{ number_format($cycleTotals->total_tax ?? 0, 2) }} Invoices: {{ number_format($cycleTotals->total_invoices ?? 0) }}/{{ number_format($cycleTotals->total_possible_invoices)}}
@if(session('success'))
{{ session('success') }}
@endif @if($payments->isEmpty())
@if(request()->has('search')) No payments found matching your search criteria. @else No payments found for the selected cycle. @endif
@else
@foreach($payments as $payment) @endforeach
User Amount Net Payable Tax Productivity Status Invoice Actions
{{ $payment->user->name ?? 'N/A' }} {{ number_format($payment->amount_payable, 2) }} {{ number_format($payment->net_payable, 2) }} {{ number_format($payment->tax, 2) }} {{ isset($payment->calculated_productivity) ? number_format($payment->calculated_productivity, 2) : $payment->productivity }} {{ $payment->status }} {{-- Show FAM Invoice if available --}} @if(isset($payment->fam_invoice) && $payment->fam_invoice) View (FAM) {{-- Fall back to payment invoices --}} @elseif($payment->invoice_file) View @elseif($payment->new_invoice_file) View @else No Invoice @endif
@csrf @method('DELETE')
@csrf @method('PATCH')
{{ $payments->appends(request()->except('page'))->links() }} @endif
@endif
@endsection @push('scripts') @endpush