@extends('layouts.admin') @section('title', 'Pricing · Aromaniacs ERP') @section('overline', 'Engine') @section('heading', 'Pricing') @section('content') {{-- KPI tiles --}}
@foreach ([ ['label' => 'SKUs priced', 'value' => $metrics['total_priced']], ['label' => 'With cost data', 'value' => $metrics['with_cost']], ['label' => 'Avg cost / ml', 'value' => number_format($metrics['avg_cost_ml'], 2), 'suffix' => '৳/ml'], ['label' => 'Manual overrides', 'value' => $metrics['overrides']], ] as $tile)

{{ $tile['label'] }}

{{ $tile['value'] }} @if (! empty($tile['suffix'])) {{ $tile['suffix'] }} @endif

@endforeach
{{-- Filters --}}
@if (($query ?? '') !== '' || $brandId || $fragranceId) @endif
{{-- Price sheet table --}}
@if ($sheet->isEmpty())

No priced SKUs found.

Add bottle intakes and active SKUs to see computed prices.

@else
@php $prevFragrance = null; @endphp @foreach ($sheet as $row) @php $isNewGroup = $row->sku->fragrance_id !== $prevFragrance; $prevFragrance = $row->sku->fragrance_id; @endphp @endforeach
SL. Thumb SKU Fragrance Brand Size Cost/ml Juice Cost (Unit) Multiplier Bottle Cost Computed Override Storefront Price Actions
{{ $loop->iteration }} @if ($row->sku->effectiveImageUrl(false)) {{ $row->sku->code }} thumbnail @else @endif {{ $row->sku->code }} {{ $row->sku->fragrance->name }} {{ $row->sku->fragrance->brand->name }} {{ $row->sku->decantSize->label }} @if ($row->cost_per_ml > 0) {{ number_format($row->cost_per_ml, 2) }} @else @endif @if ($row->cost_per_ml > 0) {{ number_format($row->cost_per_ml * (float) $row->sku->decantSize->volume_ml, 2) }} @else @endif {{ number_format((float) $row->sku->decantSize->multiplier, 2) }}× {{ number_format((float) ($row->sku->decantSize->bottle_cost ?? 0), 2) }} @if ($row->computed > 0) {{ number_format($row->computed, 2) }} @else @endif @if ($row->is_override) {{ number_format($row->override, 2) }} @else @endif
@endif
{{-- Formula reference --}}

Formula reference

computed_price = (juice_cost_per_ml × decant_volume_ml × size_multiplier) + bottle_cost

juice_cost_per_ml = Σ cost_total ÷ Σ volume_ml  (weighted average across all decant intakes for the fragrance)

If a manual override is set on the SKU, it takes precedence over the computed price.

storefront_price is editable inline and is used as the customer-facing selling price.

@endsection