@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
@include('finance.partials.kpi', ['label' => 'SKUs', 'value' => $products->count()]) @include('finance.partials.kpi', ['label' => 'Total Units', 'value' => number_format($totalUnits)]) @include('finance.partials.kpi', ['label' => 'Total Value', 'value' => $metrics->money($totalValue)]) @include('finance.partials.kpi', ['label' => 'Avg Margin', 'value' => number_format($avgMargin, 1).'%'])

Add Inventory Item

@csrf

Voucher Inventory

@forelse($products as $product) @csrf @method('PUT') @empty @endforelse
SKUNameSupplierQtyCostSellCur.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' }}%
@csrf @method('DELETE')
No inventory items yet.
@endsection