@extends('layouts.app') @section('title', 'Profit & Loss') @section('page', 'reports') @section('content') @include('reports.partials.header', [ 'title' => 'Profit & Loss', 'subtitle' => 'Gross profit from product sales vs cost. Net profit after expenses and payroll. '.$dateFrom.' to '.$dateTo.'.', ])

Total Revenue

{{ money($pnlKpis['revenue']['value']) }}

{{ $pnlKpis['revenue']['trend']['label'] }} {{ $pnlCompareLabel }}

Gross Profit

{{ money($pnlKpis['grossProfit']['value']) }}

{{ $pnlKpis['grossProfit']['trend']['label'] }} {{ $pnlCompareLabel }}

Operating Profit

{{ money($pnlKpis['operatingProfit']['value']) }}

{{ $pnlKpis['operatingProfit']['trend']['label'] }} {{ $pnlCompareLabel }}

Net Profit

{{ money($pnlKpis['netProfit']['value']) }}

{{ $pnlKpis['netProfit']['trend']['label'] }} {{ $pnlCompareLabel }}

Profit & Loss Statement

@foreach ($pnlStatement as $row) @endforeach
Description Amount % of Sales
{{ $row['label'] }} @if ($row['amount'] < 0) ({{ money(abs($row['amount'])) }}) @else {{ money($row['amount']) }} @endif {{ number_format($row['pct'], 2) }}%

P&L Summary Chart (Monthly)

Profit Margin (%)

Revenue Breakdown

Expense Breakdown

Key Performance Indicators

@foreach ($pnlPerformance as $gauge) @php $maxScale = max(1, (float) ($gauge['max'] ?? 100)); $fillPct = min(100, max(0, round(((float) $gauge['value'] / $maxScale) * 100, 1))); $inRange = ! empty($gauge['inverse']) ? (float) $gauge['value'] <= (float) $gauge['max'] : (float) $gauge['value'] >= (float) $gauge['min'] && (float) $gauge['value'] <= (float) $gauge['max']; @endphp
{{ $gauge['label'] }} {{ number_format($gauge['value'], 2) }}%

Target: {{ $gauge['target'] }}

@endforeach

Sales Revenue

{{ money($salesRevenue) }}

Product line totals

Product Cost

{{ money($productCost) }}

{{ number_format($itemsSold) }} items sold

Gross Profit

{{ money($grossProfit) }}

Sales − product cost

Gross Margin

{{ number_format($grossMargin, 2) }}%

On product sales

Gross Profit by Product

Sales revenue {{ money($salesRevenue) }}
Product cost − {{ money($productCost) }}
Gross profit {{ money($grossProfit) }}
@forelse ($grossByProduct as $row) @empty @endforelse
Product Qty Sales Cost Profit
{{ $row->product_name }} {{ $row->qty }} {{ money($row->revenue) }} {{ money($row->cost) }} {{ money($row->profit) }}
No product sales in this period.
@include('reports.partials.net-pnl-statement')
@endsection @push('styles') @endpush @push('scripts') @endpush