@extends('layouts.app') @section('title', __('dashboard.Expenses Statistics')) @section('page_heading', __('dashboard.Expenses Statistics')) @section('content') @php $formattedStart = $startDate->format('Y-m-d'); $formattedEnd = $endDate->format('Y-m-d'); $totalAmount = collect($chartData['amounts'])->sum(); $daysCount = max(count($chartData['labels']), 1); $avgPerDay = $totalAmount / $daysCount; $maxDay = collect($chartData['amounts'])->max() ?? 0; $maxDayLabel = $maxDay > 0 ? ($chartData['labels'][collect($chartData['amounts'])->search($maxDay)] ?? '—') : '—'; $minDay = collect($chartData['amounts'])->filter()->min() ?? 0; $minDayLabel = $minDay > 0 ? ($chartData['labels'][collect($chartData['amounts'])->search($minDay)] ?? '—') : '—'; @endphp @include('dashboard.statistics.partials.nav') @include('dashboard.statistics.partials.filter', [ 'filterAction' => route('dashboard.statistics.expenses'), 'range' => $range, 'formattedStart' => $formattedStart, 'formattedEnd' => $formattedEnd, 'exportRoute' => route('dashboard.statistics.expenses.export', ['custom_start'=>$formattedStart,'custom_end'=>$formattedEnd,'range'=>$range]), 'exportXlsRoute' => route('dashboard.statistics.expenses.export', ['custom_start'=>$formattedStart,'custom_end'=>$formattedEnd,'range'=>$range,'format'=>'xls']), ]) {{-- KPIs --}}
| {{ $h }} | @endforeach|||
|---|---|---|---|
| {{ $i+1 }} | {{ $date }} |
{{ number_format($chartData['amounts'][$i],2) }}
ج.م
|
{{ number_format($pct,1) }}%
|
| الإجمالي | {{ number_format($totalAmount,2) }} ج.م | 100% | |