@extends('layouts.finance') @section('title', 'Inventory') @section('subtitle', 'Voucher stock, costs and margins') @section('content') @php $totalUnits = $products->sum(fn($p) => $p->stock); $totalValue = $products->sum(fn($p) => $metrics->usd($p->stock * (float) $p->cost_price, $p->currency)); $avgMargin = $products->count() ? $products->avg(fn($p) => (float) $p->selling_price > 0 ? (((float) $p->selling_price - (float) $p->cost_price) / (float) $p->selling_price) * 100 : 0) : 0; @endphp
| SKU | Name | Supplier | Qty | Cost | Sell | Cur. | Margin | |
|---|---|---|---|---|---|---|---|---|
| {{ number_format($product->stock) }} | {{ (float) $product->selling_price > 0 ? number_format((((float) $product->selling_price - (float) $product->cost_price) / (float) $product->selling_price) * 100, 1) : '0.0' }}% | |||||||
| No inventory items yet. | ||||||||