@extends('layouts.finance') @section('title', 'Running Profit') @section('subtitle', 'All-time net profit year by year — are we in overall profit or loss') @section('content') @php $displayCurrency = 'PKR'; $fmt = fn ($usd) => $metrics->moneyIn((float) $usd, 'USD', $displayCurrency); $running = $runningProfit ?? ['years' => [], 'overall' => 0, 'current_year' => now()->year, 'current_year_profit' => 0]; $years = collect($running['years'] ?? []); $overall = (float) ($running['overall'] ?? 0); $overallPositive = $overall >= 0; $currentYear = $running['current_year'] ?? now()->year; $currentYearProfit = (float) ($running['current_year_profit'] ?? 0); @endphp {{-- Back link --}}
{{-- Headline: overall running profit / loss --}}| Year | Revenue | Voucher Cost | Expenses | Net Profit |
|---|---|---|---|---|
| {{ $row['year'] }}@if($row['year'] == $currentYear) (YTD)@endif | {{ $fmt($row['revenue']) }} | {{ $fmt($row['cogs']) }} | {{ $fmt($row['expenses']) }} | {{ $fmt($row['profit']) }} |
| No profit data available yet. | ||||
| Overall | {{ $fmt($years->sum('revenue')) }} | {{ $fmt($years->sum('cogs')) }} | {{ $fmt($years->sum('expenses')) }} | {{ $fmt($overall) }} |