@extends('layouts.app') @section('title', $product->name . ' - Bar & Maquis') @section('content')

{{ $product->name }}

{{ $product->description }}

@if(!auth()->user()->isVendeur()) Modifier @endif Retour

Informations générales

Catégorie: {{ $product->category->name }}
Prix de vente: {{ number_format($product->price, 0, ',', ' ') }} FCFA
Prix d'achat: {{ number_format($product->cost_price, 0, ',', ' ') }} FCFA
Marge bénéficiaire: {{ number_format($product->profit_margin, 1) }}%
Unité: {{ $product->unit }}

Stock

Quantité en stock: {{ $product->stock_quantity }} {{ $product->unit }}
Seuil d'alerte: {{ $product->min_stock_alert }} {{ $product->unit }}
Valeur du stock: {{ number_format($product->stock_quantity * $product->cost_price, 0, ',', ' ') }} FCFA
Statut: @if($product->stock_quantity === 0) Rupture @elseif($product->isLowStock()) Faible @else OK @endif
@if($product->saleItems->count() > 0)

Historique des ventes

@foreach($product->saleItems->take(10) as $item) @endforeach
Date Facture Quantité Prix unitaire Total Profit
{{ $item->sale->created_at->format('d/m/Y') }} {{ $item->sale->invoice_number }} {{ $item->quantity }} {{ $product->unit }} {{ number_format($item->unit_price, 0, ',', ' ') }} FCFA {{ number_format($item->total_price, 0, ',', ' ') }} FCFA {{ number_format($item->profit, 0, ',', ' ') }} FCFA
@endif @if($product->stockMovements->count() > 0)

Mouvements de stock

@foreach($product->stockMovements->take(10) as $movement) @endforeach
Date Type Quantité Raison Utilisateur
{{ $movement->created_at->format('d/m/Y H:i') }} {{ ucfirst($movement->type) }} {{ $movement->quantity }} {{ $product->unit }} {{ $movement->reason ?: '-' }} {{ $movement->employee->name }}
@endif
@endsection