@extends('admin.layout') @php $title = 'Product Explorer'; $currentSort = request('sort'); $currentDir = request('dir','asc'); function arrow($field,$sort,$dir){ if($field !== $sort) return ''; return $dir === 'asc' ? ' ▲' : ' ▼'; } function nextDir($field,$sort,$dir){ if($field !== $sort) return 'asc'; return $dir === 'asc' ? 'desc' : 'asc'; } @endphp @section('content')
| Product | Winning Cost | Best Cost | Opportunity | Score |
|---|---|---|---|---|
| {{ $p->reference }} | @if($p->cost) € {{ number_format($p->cost,4) }} @else - @endif | @if($p->best_cost) € {{ number_format($p->best_cost,4) }} @else - @endif | @if($p->opportunity_percent !== null) +{{ $p->opportunity_percent }}% @else - @endif | 🔥 {{ $p->opportunity_score }} |
| ID{!! arrow('id',$currentSort,$currentDir) !!} | Reference{!! arrow('reference',$currentSort,$currentDir) !!} | Winning Supplier | Stock{!! arrow('stock',$currentSort,$currentDir) !!} | Cost{!! arrow('cost',$currentSort,$currentDir) !!} | Final Price{!! arrow('final_price',$currentSort,$currentDir) !!} | Margin{!! arrow('margin',$currentSort,$currentDir) !!} | Suppliers{!! arrow('suppliers',$currentSort,$currentDir) !!} | Best Cost | Worst Cost | Spread{!! arrow('spread',$currentSort,$currentDir) !!} | Opportunity | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @if(($product->suppliers_count ?? 0) > 0) @endif | {{ $product->id }} | {{ $product->reference }} | {{ $product->winning_supplier ?? '-' }} | {{ $product->winning_stock ?? '-' }} | @if($product->cost) € {{ number_format($product->cost,4) }} @else - @endif | @if($product->final_price) € {{ number_format($product->final_price,4) }} @else - @endif | @if($product->margin !== null) {{ $product->margin }} % @else - @endif | {{ $product->suppliers_count ?? 0 }} | @if($product->best_cost) € {{ number_format($product->best_cost,4) }} @else - @endif | @if($product->worst_cost) € {{ number_format($product->worst_cost,4) }} @else - @endif | @if($product->spread) € {{ number_format($product->spread,4) }} @else - @endif | @if($product->opportunity_percent !== null) +{{ $product->opportunity_percent }}% @else - @endif |
| No products found | ||||||||||||