@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
@foreach($companyRows as $r)@endforeach
CompanyOrdersInvestmentBillingProfitMargin
{{ $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 }}%

Monthly Performance

Investment vs billing vs profit
@foreach($monthly as $r)@endforeach
MonthOrdersInvestmentBillingProfit
{{ $r['month'] }}{{ $r['orders'] }}₹{{ number_format($r['investment'],0) }}₹{{ number_format($r['billing'],0) }}₹{{ number_format($r['profit'],0) }}

Receivable Ageing

Open invoice balances
@forelse($receivables as $i)@php $days=$i->due_date?now()->startOfDay()->diffInDays($i->due_date,false):null; @endphp@empty@endforelse
InvoiceCompanyDue DateInvoice TotalPaidBalanceAge
{{ $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
No open invoice receivables.
@endsection