@extends('layouts.app') @section('title','Products') @section('page_title','Products') @section('content') @php $isCashier = auth()->user()->isCashier(); @endphp

All Products

{{ number_format($products->total()) }} products
@if(in_array(auth()->user()->role,['owner','manager'],true)) Import Products @endif @if($canAddProducts)+ Add Product@endif
@if(session('status'))
{{ session('status') }}
@endif @if($errors->any())
{{ $errors->first() }}
@endif
@unless($isCashier)@endunless @forelse($products as $product) @unless($isCashier)@endunless @empty @endforelse
ImageProduct NameCategorySelling ModeCost PriceSelling PricesStockStatusActions
@if($product->imageUrl())@else{{ strtoupper(substr($product->name,0,1)) }}@endif
{{ $product->name }}Added by {{ ucfirst($product->creator?->role ?? 'system') }} {{ $product->category?->displayName() ?? 'General Products' }} {{ $product->sellingModeLabel() }}
@if($product->canSellSingle()){{ $product->singleUnitSingular() }}TZS {{ tzs_amount($product->costPricePerSingle()) }}@endif @if($product->canSellWholesale()){{ $product->wholesaleUnitSingular() }}TZS {{ tzs_amount($product->cost_price_per_carton) }}@endif
@if($product->canSellSingle()){{ $product->singleUnitSingular() }}TZS {{ tzs_amount($product->default_selling_price_per_single) }}@endif @if($product->canSellWholesale()){{ $product->wholesaleUnitSingular() }}TZS {{ tzs_amount($product->default_selling_price_per_carton) }}@endif
@if($product->canSellWholesale()) {{ number_format($product->wholesaleAvailable()) }} {{ $product->unitName('wholesale',$product->wholesaleAvailable()) }} @endif @if($product->canSellSingle()) {{ number_format($product->looseSingleAvailable()) }} {{ $product->unitName('single',$product->looseSingleAvailable()) }} @endif
@if($product->canSellWholesale() && $product->canSellSingle()) @endif
Total: {{ number_format($product->current_stock_pieces) }} {{ $product->unitName('single',$product->current_stock_pieces) }}
@if($product->isArchived()) Archived @elseif($product->status === 'inactive') Inactive @else {{ $product->stockStatusLabel() }} @endif @if(in_array(auth()->user()->role,['owner','manager'],true))
@if(!$product->isArchived()) Edit
•••
status==='active') data-confirm="{{ 'Deactivate '.$product->name.'? It will no longer appear in POS. Current stock: '.$product->stockDisplay().'. Sales and stock history will remain available.' }}" data-dialog-title="Deactivate product" data-dialog-danger="1" data-confirm-text="Deactivate" @endif>@csrf @method('PATCH')
@csrf
@else
@csrf @method('DELETE')
@endif
@else — @endif
No products found.
@forelse($products as $product)
@if($product->thumbnailUrl())@else{{ strtoupper(substr($product->name,0,1)) }}@endif

{{ $product->name }}

{{ $product->category?->displayName() ?? 'General Products' }}
@if($product->isArchived())Archived@elseif($product->status === 'inactive')Inactive@else{{ $product->stockStatusLabel() }}@endif
@if($product->canSellSingle()){{ $product->singleUnitSingular() }}TZS {{ tzs_amount($product->default_selling_price_per_single) }}@endif @if($product->canSellWholesale()){{ $product->wholesaleUnitSingular() }}TZS {{ tzs_amount($product->default_selling_price_per_carton) }}@endif
Stock: {{ $product->stockDisplay() }}
@if(in_array(auth()->user()->role,['owner','manager'],true) && !$product->isArchived())Edit@elseView@endif @if(in_array(auth()->user()->role,['owner','manager'],true))
•••
@if(!$product->isArchived())View Stock
status==='active') data-confirm="{{ 'Deactivate '.$product->name.'? It will no longer appear in POS. Current stock: '.$product->stockDisplay().'. Sales and stock history will remain available.' }}" data-dialog-title="Deactivate product" data-dialog-danger="1" data-confirm-text="Deactivate" @endif>@csrf @method('PATCH')
@csrf
@else
@csrf @method('DELETE')
@endif
@endif
@empty
P

No products found

Try clearing the filters or add your first product.

@if($canAddProducts)Add Product@endif
@endforelse
@endsection