@extends('layouts.app')
@section('title','Reports • JAN Enterprises ERP')
@section('page_title','Business Reports')
@section('page_subtitle','Company profitability, monthly performance and receivable ageing')
@section('content')
Total Investment₹{{ number_format($totals['investment'],0) }}
Total Billing₹{{ number_format($totals['billing'],0) }}
Gross Profit₹{{ number_format($totals['profit'],0) }}
Invoice Receivable₹{{ number_format($totals['receivable'],0) }}
Company Performance
All historical orders| Company | Orders | Investment | Billing | Profit | Margin |
@foreach($companyRows as $r)| {{ $r['company']->name }} | {{ $r['orders'] }} | ₹{{ number_format($r['investment'],0) }} | ₹{{ number_format($r['billing'],0) }} | ₹{{ number_format($r['profit'],0) }} | {{ $r['investment']>0?number_format($r['profit']/$r['investment']*100,1):0 }}% |
@endforeach
Monthly Performance
Investment vs billing vs profit| Month | Orders | Investment | Billing | Profit |
@foreach($monthly as $r)| {{ $r['month'] }} | {{ $r['orders'] }} | ₹{{ number_format($r['investment'],0) }} | ₹{{ number_format($r['billing'],0) }} | ₹{{ number_format($r['profit'],0) }} |
@endforeach
Receivable Ageing
Open invoice balances| Invoice | Company | Due Date | Invoice Total | Paid | Balance | Age |
@forelse($receivables as $i)@php $days=$i->due_date?now()->startOfDay()->diffInDays($i->due_date,false):null; @endphp| {{ $i->invoice_no }} | {{ $i->order->company->name }} | {{ $i->due_date?->format('d M Y') ?? '—' }} | ₹{{ number_format((float)$i->total_amount,0) }} | ₹{{ number_format($i->paid_amount,0) }} | ₹{{ number_format($i->balance,0) }} | @if($days===null)—@elseif($days<0){{ abs($days) }} days overdue@else{{ $days }} days to due@endif |
@empty| No open invoice receivables. |
@endforelse
@endsection