@extends('layouts.app') @section('title', __('Monthly Report')) @push('stylesheets') @include('partials.index-datatable-styles') @include('partials.filter-card-styles') @include('partials.collapsible-filter-styles') @if (($activeTab ?? 'detail') === 'summary') @include('reports.partials.monthly-report-summary-styles') @endif @endpush @section('contents')
@php $selectedPlanTypes = is_array($filters['plan_type'] ?? null) ? $filters['plan_type'] : []; $selectedRegionIds = is_array($filters['region_id'] ?? null) ? array_map(static fn (int $id) => (string) $id, $filters['region_id']) : []; $monthlyFiltersOpen = \App\Support\MonthlyReportFilters::filtersHaveActiveValues($filters ?? []); $activeTab = in_array($activeTab ?? 'detail', ['detail', 'summary'], true) ? $activeTab : 'detail'; $monthlyTabQuery = is_array($tabQueryParams ?? null) ? $tabQueryParams : request()->except(['page', 'sort_col', 'sort_dir', 'tab']); $detailTabUrl = route('reports.monthly-report.index', array_merge($monthlyTabQuery, ['tab' => 'detail'])); $summaryTabUrl = route('reports.monthly-report.index', array_merge($monthlyTabQuery, ['tab' => 'summary'])); $listingBaseQuery = array_merge($monthlyTabQuery, ['tab' => 'detail']); @endphp
@php $includeCancelled = (bool) ($filters['include_cancelled'] ?? true); @endphp

{{ __('Monthly Report') }}

@if ($activeTab === 'summary') {{ __('Print preview') }} @else
@foreach ($filters as $key => $value) @if (is_array($value)) @foreach ($value as $item) @if ($key === 'plan_type') @elseif ($key === 'region_id') @endif @endforeach @elseif (is_bool($value)) @elseif ($value !== '') @endif @endforeach
@endif
@forelse ($rows as $row) @empty @endforelse
S# ADP # Lat Long Status Published Cost Department Location Region Sector Sub-
Sector
Type Name of Scheme Month Type of Plan
{{ $row['serial'] }} {{ $row['adp_number'] }} {{ $row['latitude'] }} {{ $row['longitude'] }} {{ $row['assessment_status'] }} {{ $row['published_status'] }} {{ $row['cost'] }} {{ $row['department'] }} {{ $row['location'] }} {{ $row['region'] }} {{ $row['mec_sector'] }} {{ $row['sub_sector'] }} {{ $row['scheme_type'] }} {{ $row['scheme_name'] }} {{ $row['month_label'] }} @if ($row['plan_type'] !== '—') {{ $row['plan_type'] }} @else @endif
{{ __('No data available.') }}
@include('partials.listing-pagination', [ 'paginator' => $paginator ?? null, 'perPage' => $perPage ?? 25, 'baseUrl' => route('reports.monthly-report.index', $listingBaseQuery), ])
@include('reports.partials.monthly-report-summary-dashboard')
@endsection @push('scripts') @include('partials.index-datatable-scripts') @include('partials.collapsible-filter-scripts') @if (($activeTab ?? 'detail') === 'summary') @include('reports.partials.monthly-report-summary-map-scripts') @endif @endpush