@extends('layouts.app') @section('title', 'Dashboard') @section('breadcrumb') @endsection @section('content') @php $fp = $reports['fundPosition']; $wc = $reports['workingCapital']; $ms = $reports['monthlySeries']; $pr = $reports['profitRatio']; $eb = $reports['expenseBreakdown']; $topCustomers = $reports['topCustomerOutstanding']; $topVendors = $reports['topVendorOutstanding']; $fmt = fn ($v) => \App\Helpers\NumberHelper::formatAmount((float) $v, $companyId, true); @endphp

Fund Position

Cash and bank balances

Cash {{ $fmt($fp['cash']) }}
Bank {{ $fmt($fp['bank']) }}
Total funds {{ $fmt($fp['total']) }}

Working Capital

Current assets − liabilities

CA {{ $fmt($wc['current_assets']) }}
CL {{ $fmt($wc['current_liabilities']) }}
Net working capital {{ $fmt($wc['net']) }}

Top 5 Customer Outstanding

Largest receivable balances

@forelse($topCustomers as $i => $customer)
{{ $i + 1 }}
{{ $customer['name'] }}
Open {{ $customer['days_open'] }} days
{{ $fmt($customer['amount_due']) }}
@empty
No customer outstanding balances
@endforelse

Top 5 Vendor Outstanding

Largest payable balances

@forelse($topVendors as $i => $vendor)
{{ $i + 1 }}
{{ $vendor['name'] }}
Open {{ $vendor['days_open'] }} days
{{ $fmt($vendor['amount_due']) }}
@empty
No vendor outstanding balances
@endforelse

Income vs Expense

Last 6 months

Month-Wise Profit Ratio

Net profit as % of income

Expense Breakdown

By expense account

Active Users Online {{ $kpis['online_users'] }} online
@forelse($onlineSessions as $session) @empty @endforelse
User Last Active IP
{{ $session->user?->name ?? 'Unknown' }} @if($session->user_id === auth()->id()) You @endif
{{ \Carbon\Carbon::createFromTimestamp($session->last_activity)->diffForHumans() }} {{ $session->ip_address }}
No active sessions
@endsection @push('scripts') @endpush