@extends('layouts.master') @section('title') Reports @endsection @section('content') @component('components.breadcrumb') @slot('li_1') Management @endslot @slot('title') Management Reports @endslot @endcomponent {{-- Filters --}}
{{-- KPIs --}}
@php $cards = [ ['l'=>'Requisitions','v'=>number_format($kpis['total']),'i'=>'ri-file-list-3-line','b'=>'primary'], ['l'=>'Total Value (JMD)','v'=>number_format($kpis['value'],2),'i'=>'ri-money-dollar-circle-line','b'=>'success'], ['l'=>'Completion','v'=>$kpis['completion'].'%','i'=>'ri-checkbox-circle-line','b'=>'info'], ['l'=>'SLA On-Time','v'=>$kpis['sla_on_time'].'%','i'=>'ri-timer-flash-line','b'=>$kpis['sla_on_time']>=80?'success':'warning'], ['l'=>'Avg Cycle (days)','v'=>$kpis['avg_cycle'],'i'=>'ri-loader-2-line','b'=>'secondary'], ['l'=>'In Progress','v'=>number_format($kpis['in_progress']),'i'=>'ri-time-line','b'=>'warning'], ['l'=>'Satisfaction','v'=>$kpis['satisfaction'].'%','i'=>'ri-emotion-happy-line','b'=>'success'], ['l'=>'Cancelled','v'=>number_format($kpis['cancelled']),'i'=>'ri-close-circle-line','b'=>'danger'], ]; @endphp @foreach($cards as $c)

{{ $c['l'] }}

{{ $c['v'] }}

@endforeach
{{-- Totals by period --}}
Totals by {{ ucfirst($period) }}
@php $maxVal = $byPeriod->max('value') ?: 1; @endphp
@forelse($byPeriod as $p) @empty @endforelse
PeriodRequisitionsValue (JMD)Trend
{{ $p->period }} {{ number_format($p->count) }} {{ number_format($p->value,2) }}
No data in range.
{{-- Product details --}}
Top Products / Items
@forelse($products as $p) @empty @endforelse
ProductReqsQtyValue (JMD)
{{ $p->product ?? '—' }} {{ number_format($p->requisitions) }} {{ rtrim(rtrim(number_format($p->qty,2),'0'),'.') }} {{ number_format($p->value,2) }}
No product data.
{{-- By status + suppliers --}}
By Status
@forelse($byStatus as $status => $count)
{{ ucwords(str_replace('_',' ',$status)) }}{{ $count }}
@empty

No data.

@endforelse
Spend by Supplier (POs)
@forelse($bySupplier as $s) @empty@endforelse
SupplierPOsValue
{{ $s->name }}{{ $s->orders }}{{ number_format($s->value,2) }}
No PO spend in range.
Budget Utilisation
{{ $fiscalYear }}
@forelse($budgets as $b) @empty@endforelse
Cost CentreAllocationCommittedSpentBalanceUtil.
{{ $b['code'] }} {{ $b['name'] }} {{ number_format($b['allocation'],2) }} {{ number_format($b['committed'],2) }} {{ number_format($b['spent'],2) }} {{ number_format($b['balance'],2) }}
{{ $b['util'] }}%
No budgets set for {{ $fiscalYear }}.
Rejections / Returns by Reason
@forelse($byReason as $r) @empty@endforelse
CodeReasonCount
{{ $r->code }}{{ $r->label }}{{ $r->total }}
No coded rejections in range.
Spend by Area (POs)
@forelse($byArea as $a) @empty@endforelse
AreaPOsValue
{{ $a->name }}{{ $a->orders }}{{ number_format($a->value,2) }}
No PO spend in range.
Invoice Aging (unpaid)
@foreach($agingBuckets as $bucket => $value) @endforeach
Age (days)CountValue
{{ $bucket }} {{ $agingCounts[$bucket] }} {{ number_format($value,2) }}
Outstanding Purchase Orders
@forelse($outstandingPos as $po) @empty@endforelse
POSupplierIssuedStatusValue
{{ $po->po_number }} {{ $po->supplier?->name }} {{ optional($po->issue_date)->format('d M Y') }} {{ ucwords(str_replace('_',' ',$po->status)) }} {{ number_format($po->total,2) }}
No outstanding POs.
Pending / Overdue Deliveries
{{ $pendingDelivery->count() }} overdue
@forelse($pendingDelivery as $po) @php $late = (int) \Illuminate\Support\Carbon::parse($po->expected_delivery_date)->diffInDays(now()); @endphp @empty@endforelse
POSupplierExpectedDays LateStatusValue
{{ $po->po_number }} {{ $po->supplier?->name }} {{ \Illuminate\Support\Carbon::parse($po->expected_delivery_date)->format('d M Y') }} {{ $late }}d {{ ucwords(str_replace('_',' ',$po->status)) }} {{ number_format($po->total,2) }}
No overdue deliveries. 🎉
@endsection