Time Period Filter

@php $range = $daterange[0] ?? null; $periodLabel = ''; if ($timePeriod === 'current_month') { $periodLabel = 'Current Month (Month to Date)'; } elseif ($timePeriod === 'last_month_vs_current') { $periodLabel = 'Last Month vs Current Month'; } elseif ($timePeriod === 'current_vs_last_year') { $periodLabel = 'Current Month vs Same Month Last Year'; } elseif ($timePeriod === 'last_3_months') { $periodLabel = 'Last 3 Months'; } @endphp Active: {{ $periodLabel }}
@if (!empty($range['startDate']) && !empty($range['endDate']))
Date Range: {{ \Carbon\Carbon::parse($range['startDate'])->format('M d, Y') }} - {{ \Carbon\Carbon::parse($range['endDate'])->format('M d, Y') }}
@endif

Financial Summary

Total Billing Amount
$ {{ number_format($totalBillAmount, 2) }}
Paid Amount
$ {{ number_format($paidBillAmount, 2) }}
Unpaid Amount
$ {{ number_format($unpaidBillAmount, 2) }}

Month to Month Graphical Summary

@if (in_array($timePeriod, ['last_month_vs_current', 'current_vs_last_year', 'last_3_months']) && isset($comparisonSummary))
@if($timePeriod === 'last_month_vs_current' && $comparisonSummary['last_month'])

This Month vs Last Month

Month Total Billed Assignment Total Billing Amount Total Paid Amount Total Unpaid Amount Total Supplements Billed
This Month {{ $comparisonSummary['current']['total_files'] }} ${{ number_format($comparisonSummary['current']['total_invoice_amount'], 2) }} ${{ number_format($comparisonSummary['current']['total_paid_amount'], 2) }} ${{ number_format($comparisonSummary['current']['total_invoice_amount'] - $comparisonSummary['current']['total_paid_amount'], 2) }} {{ $comparisonSummary['current']['supplement_count'] }}
Last Month {{ $comparisonSummary['last_month']['total_files'] }} ${{ number_format($comparisonSummary['last_month']['total_invoice_amount'], 2) }} ${{ number_format($comparisonSummary['last_month']['total_paid_amount'], 2) }} ${{ number_format($comparisonSummary['last_month']['total_invoice_amount'] - $comparisonSummary['last_month']['total_paid_amount'], 2) }} {{ $comparisonSummary['last_month']['supplement_count'] }}
@elseif($timePeriod === 'current_vs_last_year')

This Month vs Same Month Last Year

@php $same = $comparisonSummary['same_month_last_year'] ?? []; @endphp
Month Total Billed Assignment Total Billing Amount Total Paid Amount Total Unpaid Amount Total Supplements Billed
This Month {{ $comparisonSummary['current']['total_files'] }} ${{ number_format($comparisonSummary['current']['total_invoice_amount'], 2) }} ${{ number_format($comparisonSummary['current']['total_paid_amount'], 2) }} ${{ number_format($comparisonSummary['current']['total_invoice_amount'] - $comparisonSummary['current']['total_paid_amount'], 2) }} {{ $comparisonSummary['current']['supplement_count'] }}
Same Month Last Year {{ $same['total_files'] ?? 0 }} ${{ number_format($same['total_invoice_amount'] ?? 0, 2) }} ${{ number_format($same['total_paid_amount'] ?? 0, 2) }} ${{ number_format(($same['total_invoice_amount'] ?? 0) - ($same['total_paid_amount'] ?? 0), 2) }} {{ $same['supplement_count'] ?? 0 }}
@elseif($timePeriod === 'last_3_months')

Last 3 Months Overview

@foreach ($comparisonSummary['last_3_months'] as $item) @endforeach
Month Total Billed Assignment Total Billing Amount Total Paid Amount Total Unpaid Amount Total Supplements Billed
{{ \Carbon\Carbon::create($item['year'], $item['month'], 1)->format('M Y') }} {{ $item['total_files'] }} ${{ number_format($item['total_invoice_amount'], 2) }} ${{ number_format($item['total_paid_amount'], 2) }} ${{ number_format($item['total_invoice_amount'] - $item['total_paid_amount'], 2) }} {{ $item['supplement_count'] }}
@endif
@endif

📊 Monthly Performance & Comparison Summary

This chart compares this month vs last month, this month vs same month last year, and shows a 3-month trend of key metrics.

Files Opened & Completed by Date

@if(!empty($dateWiseChart['series']))
@foreach($dateWiseChart['series'] as $series) @php $isOpen = str_contains(strtolower($series['name']), 'open'); $colorClass = $isOpen ? 'text-blue-700 bg-blue-50' : 'text-green-700 bg-green-50'; @endphp @endforeach @foreach($dateWiseChart['labels'] as $index => $day) @foreach($dateWiseChart['series'] as $series) @php $isOpen = str_contains(strtolower($series['name']), 'open'); $textColor = $isOpen ? 'text-blue-600' : 'text-green-600'; $fontWeight = ($series['data'][$index] ?? 0) > 0 ? 'font-semibold' : ''; @endphp @endforeach @endforeach
Date {{ $series['name'] }}
{{ $day }} {{ $series['data'][$index] ?? 0 }}
@else

No comparison data available. Please select a comparison mode.

@endif

Month to Month Summary

@php $i = 1; @endphp @if (!empty($Monthtomonthdata))
@foreach ($Monthtomonthdata as $key => $insData) @endforeach
# Month Total Billed Assignment Total Billing Amount Total Paid Amount Total Unpaid Amount Total Supplements Billed
{{ $i++ }} {{ \Carbon\Carbon::createFromDate($insData['year'], $insData['month'], 1)->format('F Y') }} {{ $insData['total_files'] }} ${{ number_format($insData['total_invoice_amount'], 2) }} ${{ number_format($insData['total_paid_amount'], 2) }} ${{ number_format($insData['total_invoice_amount'] - $insData['total_paid_amount'], 2) }} {{ $insData['supplement_count'] }}
@endif

Office Cycle Time

Color Legend: ≤ 5 Days 6-10 Days 11-15 Days > 15 Days
@foreach($averagecycletime as $i => $row) @php $cycleTime = max(0, round($row->cycle_time ?? 0, 2)); $filesCompleted = $row->files_completed ?? 0; // Cycle Time Color Logic if ($cycleTime <= 5) $cycleBg = 'bg-success text-white'; else if ($cycleTime <= 10) $cycleBg = 'bg-primary text-white'; else if ($cycleTime <= 15) $cycleBg = 'bg-warning text-dark'; else $cycleBg = 'bg-danger text-white'; @endphp @endforeach
# Office Cycle Time Files Completed
{{ $i+1 }} {{ $row->officecode }} - {{ $row->officename }} {{ $cycleTime }} Days {{ $filesCompleted }}

Top 10 Longest Cycle Time

@php $siteUrl = url('admin/assignment/'); $newUrl = str_replace('/exec', '', $siteUrl); @endphp @if(count($top10LongestCycleTime) > 0)
@foreach($top10LongestCycleTime as $index => $file) @endforeach
# File Number Claim Number Insurance Company Date Opened Office Assigned Appraiser Assigned Cycle Time (Days)
{{ $index + 1 }} {{ $file->file_no }} {{ $file->claim_number ?? 'N/A' }} {{ $file->insurance_company_name ?? 'N/A' }} {{ $file->created_date ? \Carbon\Carbon::parse($file->created_date)->format('m/d/Y') : 'N/A' }} @if($file->office_code && $file->office_name) {{ $file->office_code }} - {{ $file->office_name }} @elseif($file->office_name) {{ $file->office_name }} @else N/A @endif {{ $file->appraiser_name ?? 'N/A' }} {{ number_format($file->cycle_time, 0) }} Days
@else @endif