{{-- A price list of the selected products, grouped by category: from the Products page at the products' own prices, or from a location's catalogue at the prices the till charges there. The landed cost is printed only when asked for, since a price list is often handed to customers. @param array $groups category => rows (PriceListService::prepare) @param int $count @param int $unpriced products with no till price @param ?array $location ['name' => …, 'type' => …] or null for product prices @param bool $includeCost @param string $currency @param string $reportDate --}} @php $org = auth()->user()->organization ?? \App\Models\System\Organization::find(auth()->user()->organization_id); $atLocation = $location !== null; $money = fn (float $value) => $value > 0 ? number_format($value, 2) : '—'; @endphp @extends('documents.inventory._layout', [ 'documentTitle' => 'Price List', 'reference' => null, 'documentDate' => $reportDate, ]) @section('styles') .price-list th { color: #fff; } .price-list .num { text-align: right; white-space: nowrap; } .price-list .till { font-weight: bold; } @endsection @section('header-meta')
@if($atLocation) Prices at: {{ $location['name'] }} @else Product prices (before any location's own prices) @endif
Currency: {{ $currency }}
Products: {{ number_format($count) }}
@endsection @section('content') @foreach($groups as $category => $rows)

{{ $category }}

@if($includeCost) @endif @if($atLocation) @endif @foreach($rows as $i => $row) @if($includeCost) @endif @if($atLocation) @endif @endforeach
# Product Code / SKU UnitLanded costSelling {{ $atLocation ? 'Till price' : 'Outlet price' }} FloorPrice from
{{ $i + 1 }} {{ $row['name'] }} @if($row['variant'])
{{ $row['variant'] }}@endif
{{ $row['code'] }} @if($row['sku'])
{{ $row['sku'] }}@endif
{{ $row['uom'] ?? '—' }}{{ $money($row['landed_cost']) }}{{ $money($row['selling_price']) }} {{ $row['outlet_price'] > 0 ? number_format($row['outlet_price'], 2) : 'No price' }} {{ $money($row['discount_cap']) }}{{ $row['source'] }}@if($row['rule'])
{{ $row['rule'] }}@endif
@endforeach

{{ $atLocation ? 'Till price' : 'Outlet price' }} is the price a customer pays at the till; Floor is the lowest a seller may go with a discount. @if($atLocation) A product's own price at this location comes first, then the location's default rule, then the product's own price. @endif

@if($unpriced > 0)

{{ number_format($unpriced) }} {{ $unpriced === 1 ? 'product has' : 'products have' }} no price and cannot be sold at the till until priced.

@endif
@endsection