@extends('admin.layouts.layout') @section('title', 'Inspector Payouts') @push('page_css') @endpush @section('content')

Inspector Payouts

@if(!session('tenant_id') && $tenants->count() > 0) @endif @if($startDate || $endDate || $tenantId) Clear @endif
@if($inspectorPayouts && count($inspectorPayouts) > 0)
Gross Amount: ${{ number_format($grandTotal, 2) }}
Total Amount: ${{ number_format($grandTotal, 2) }}
Overdue Payment: ${{ number_format($grandTotal, 2) }}
{{ count($inspectorPayouts) }} Inspector(s)
@foreach($inspectorPayouts as $inspectorData)
{{ $inspectorData['inspector']['name'] }}
Gross: ${{ number_format($inspectorData['total_gross'], 2) }} Overdue: ${{ number_format($inspectorData['total_overdue'], 2) }}
${{ number_format($inspectorData['total_gross'], 2) }}
Total
@if(count($inspectorData['inspection_fees']) > 0)
Inspection Fees ({{ count($inspectorData['inspection_fees']) }} item{{ count($inspectorData['inspection_fees']) > 1 ? 's' : '' }})
${{ number_format($inspectorData['inspection_total'], 2) }}
@foreach($inspectorData['inspection_fees'] as $schedule)
{{ \Carbon\Carbon::parse($schedule['date'])->format('m/d/Y') }}
{{ $schedule['appointment_id'] }} {{ $schedule['inspector_count'] }} Inspector{{ $schedule['inspector_count'] > 1 ? 's' : '' }} @if($schedule['status'] == 'Unpaid') {{ $schedule['status'] }} @else {{ $schedule['status'] }} @endif
{{ $schedule['address'] }}
{{ $schedule['service_name'] }}
${{ number_format($schedule['amount'], 2) }}
{{ ucfirst($schedule['pay_type']) }} @if(isset($schedule['payout_type']) && $schedule['payout_type']) | {{ ucfirst($schedule['payout_type']) }} @endif
@endforeach @endif @if(count($inspectorData['commission_fees']) > 0)
Commission Fees ({{ count($inspectorData['commission_fees']) }} item{{ count($inspectorData['commission_fees']) > 1 ? 's' : '' }})
${{ number_format($inspectorData['commission_total'], 2) }}
@foreach($inspectorData['commission_fees'] as $schedule)
{{ \Carbon\Carbon::parse($schedule['date'])->format('m/d/Y') }}
{{ $schedule['appointment_id'] }} {{ $schedule['inspector_count'] }} Inspector{{ $schedule['inspector_count'] > 1 ? 's' : '' }} @if($schedule['status'] == 'Unpaid') {{ $schedule['status'] }} @else {{ $schedule['status'] }} @endif
{{ $schedule['address'] }}
{{ $schedule['service_name'] }}
${{ number_format($schedule['amount'], 2) }}
{{ ucfirst($schedule['pay_type']) }} @if(isset($schedule['payout_type']) && $schedule['payout_type']) | {{ ucfirst($schedule['payout_type']) }} @endif
@endforeach @endif @if(count($inspectorData['inspection_fees']) == 0 && count($inspectorData['commission_fees']) == 0)
No payouts found for this inspector.
@endif
@endforeach
@else

No Payouts Found

@if($startDate || $endDate) No payouts found for the selected date range. @else No payouts have been calculated yet. Payouts are automatically calculated when schedules are created or updated. @endif

@if($startDate || $endDate) View All Payouts @endif
@endif
@endsection @push('page_script') @endpush