@extends('layouts.app') @section('title', 'Dashboard') @section('content') @php $hour = (int) now()->format('G'); $greet = $hour < 12 ? 'Good morning' : ($hour < 17 ? 'Good afternoon' : 'Good evening'); $kpis = [ ['sales', 'Sales', 'bag-check', '', 0, true, ''], ['collected', 'Collected', 'arrow-down-left-circle', 'chip-success', 2, true, ''], ['spent', 'Spent', 'arrow-up-right-circle', 'chip-danger', 3, true, 'invert'], ['profit', 'Net profit', 'graph-up-arrow', 'chip-violet', 5, true, ''], ['receivable', 'To receive from clients', 'people', 'chip-warning', 1, false, ''], ['payable', 'To pay to vendors', 'truck', 'chip-info', 4, false, ''], ]; @endphp
@can('payments.create') Receive payment @endcan @can('expenses.create') Add expense @endcan @can('orders.create') New order @endcan
@foreach ($ranges as $key => $label) @endforeach
{{ $range['label'] }}
{{-- KPIs --}}
@foreach ($kpis as [$key, $label, $icon, $chip, $color, $hasSpark, $extra])
{{ $label }}
{{ config('erp.currency') }}0.00
@if ($hasSpark)
—
@else
Outstanding right now Details
@endif
@if ($hasSpark)@endif
@endforeach

Sales include tax. Spent = vendor payments + expenses. Net profit = sales (excl. tax) − vendor bills − expenses. Arrows compare with the previous period.

{{-- Charts --}}
Sales vs collectionsWhat you billed against what came in
Where the money wentVendor payments + expenses
    Cash flowMoney in, money out and the net
    Open ordersBy stage, right now
      Receivables ageingUnpaid, by age of order
      Top clientsBy sales in this period
      {{-- Work lists --}}
      Upcoming deliveriesAll orders
        @forelse ($upcoming as $o) @php($late = $o->delivery_date->isPast())
      • {{ $o->order_no }} · {{ $o->client->name }} {{ $late ? 'Overdue since ' : 'Due ' }}{{ $o->delivery_date->format('d M') }} · {{ $o->statusLabel() }}
        @if ($late)Late@endif
      • @empty
      • No open orders with a delivery date.
      • @endforelse
      Overdue vendor billsView all
        @forelse ($overdueBills as $b)
      • {{ $b->vendor->name }} Due {{ $b->due_date->format('d M Y') }} · {{ (int) $b->due_date->diffInDays(now()) }}d late
        {{ money($b->due()) }}
      • @empty
      • Nothing overdue.
      • @endforelse
      Recent ordersView all
      @endsection