@extends('pdf.layout') @section('content') @php $m = fn ($v) => number_format((float) $v, 2); $pct = fn ($v) => $v === null ? '-' : (($v >= 0 ? '+' : '') . number_format($v, 1) . '%'); @endphp
Sales
{{ $currency }} {{ $m($totalSales) }}
{{ $totalTransactions }} transactions, {{ $pct($deltas['revenue']) }} {{ $comparisonLabel }}
Gross profit
{{ $currency }} {{ $m($grossProfit) }}
{{ $grossMargin }}% margin, {{ $pct($deltas['gross_profit']) }}
Net profit
{{ $currency }} {{ $m($netProfit) }}
{{ $netMargin }}% margin, {{ $pct($deltas['net_profit']) }}
Items sold
{{ number_format($totalItemsSold) }}
Stock turnover {{ number_format($inventoryTurnover, 2) }}x

Income statement

@foreach($writeOffsByReason as $reason => $amount) @endforeach @foreach($expensesByCategory as $category => $amount) @endforeach
Item{{ $currency }}% of sales
Sales{{ $m($totalSales) }}100.0%
Less: cost of goods sold({{ $m($costOfGoodsSold) }}){{ $totalSales > 0 ? number_format($costOfGoodsSold / $totalSales * 100, 1) : '0.0' }}%
Gross profit{{ $m($grossProfit) }}{{ $grossMargin }}%
Less: stock written off({{ $m($stockWrittenOff) }})
{{ $reason }}{{ $m($amount) }}
Less: operating expenses({{ $m($operatingExpenses) }})
{{ $category }}{{ $m($amount) }}
Net profit{{ $m($netProfit) }}{{ $netMargin }}%

Stock

@if($otherStockChanges) @endif
ItemAt cost ({{ $currency }})At selling price ({{ $currency }})
Stock at the start ({{ $fromDateLabel }}){{ $m($openingStockCost) }}{{ $m($openingStockRetail) }}
+ Stock received (purchases, stock in, new products){{ $m($stockReceived) }}
of which purchases recorded{{ $m($totalPurchase) }}
of which stock-in adjustments{{ $m($stockInByAdjustment) }}
- Cost of goods sold{{ $m($costOfGoodsSold) }}
- Stock written off{{ $m($stockWrittenOff) }}
Other changes (price updates, stock found, deleted sales){{ $m($otherStockChanges) }}
Stock at the end ({{ $toDateLabel }}), {{ number_format($totalStockUnits) }} units{{ $m($closingStockCost) }}{{ $m($closingStockRetail) }}

Most profitable products

@if(count($topProducts)) @foreach($topProducts as $i => $p) @endforeach
#ProductQtySales ({{ $currency }})Profit ({{ $currency }})Margin
{{ $i + 1 }}{{ $p['name'] }}{{ rtrim(rtrim(number_format($p['qty'], 2), '0'), '.') }}{{ $m($p['revenue']) }}{{ $m($p['profit']) }}{{ $p['margin'] }}%
@else
No sales in this period.
@endif @if(count($categoryMargins))

Categories

@foreach($categoryMargins as $name => $c) @endforeach
CategorySales ({{ $currency }})Profit ({{ $currency }})Margin
{{ $name }}{{ $m($c['revenue']) }}{{ $m($c['profit']) }}{{ $c['margin'] }}%
@endif

Slow-moving stock (not sold in 30 days)

@if($slowMovingProducts->count()) @foreach($slowMovingProducts as $p) @endforeach
ProductIn stockValue at cost ({{ $currency }})
{{ $p->name }}{{ rtrim(rtrim(number_format((float) $p->current_stock, 2), '0'), '.') }}{{ $m((float) $p->current_stock * (float) $p->purchase_price) }}
Total tied up in slow-moving stock{{ $m($slowMovingValue) }}
@else
Everything in stock sold in the last 30 days.
@endif

Last six months

@foreach($seasonalityTrend as $month) @endforeach
MonthSales ({{ $currency }})Costs and expenses ({{ $currency }})Net profit ({{ $currency }})
{{ $month['month'] }}{{ $m($month['revenue']) }}{{ $m($month['expenses']) }}{{ $m($month['net_profit']) }}
@endsection