@extends('layouts.app') @section('title','Dashboard • JAN Enterprises ERP') @section('page_title','Dashboard') @section('page_subtitle','Live order, investment, billing, agreement and receivable status') @section('content')
Total Orders From Start{{ $totalOrders }}{{ $completed->count() }} completed • {{ $active->count() }} active
Active Orders{{ $active->count() }}Current open supply orders
Total Investment₹{{ number_format($investment,0) }}All historical order items
Total Billing₹{{ number_format($billing,0) }}Profit ₹{{ number_format($profit,0) }}
Outstanding Receivables₹{{ number_format($receivables,0) }}Against generated invoices
Overdue Invoices{{ $overdueInvoices }}Invoices past their due date

Active Order Details

Current open orders with investment and payout dates
View All
@forelse($activeDetails as $row)@empty@endforelse
OrderCompanyAssetsQtyInvestmentBillingProfitPayoutAction
{{ $row['order']->order_no }}
{{ $row['order']->order_date->format('d M Y') }}
{{ $row['order']->company->name }}{{ $row['assets'] }}{{ rtrim(rtrim(number_format($row['qty'],2,'.',''),'0'),'.') }}₹{{ number_format($row['investment'],0) }}₹{{ number_format($row['billing'],0) }}₹{{ number_format($row['profit'],0) }}{{ $row['order']->payout_date?->format('d M Y') ?? '—' }}@if($row['order']->payout_date && $row['order']->payout_date->isPast())
Overdue
@endif
Invoice
No active orders.

Order Snapshot

Current month and statuses
This Month Orders{{ $monthOrders }}
Completed Orders{{ $completed->count() }}
Active Orders{{ $active->count() }}
Overall Gross Profit₹{{ number_format($profit,0) }}
@if($alerts->count())

ERP Alerts

Agreement and invoice reminders
@foreach($alerts as $alert)
{{ $alert->title }}
{{ $alert->message }}
{{ strtoupper($alert->severity) }}
@endforeach
@endif

Monthly Investment vs Billing

Automatically calculated from order items
@php $max=max(1,$monthly->max(fn($m)=>max($m['investment'],$m['billing']))); @endphp
InvestmentBilling
@foreach($monthly as $m)
@endforeach

Agreement Renewals

One-year customer agreements
Manage
@foreach($upcoming->take(8) as $agreement)@php $days=now()->startOfDay()->diffInDays($agreement->end_date,false); @endphp
{{ $agreement->company->name }}
Ends {{ $agreement->end_date->format('d M Y') }}
{{ $days }} days
@endforeach
@endsection