@extends('layouts.app') {{-- Helpers used below (declared first: they are conditional, so not hoisted) --}} @php if (!function_exists('getTypeColor')) { function getTypeColor($type) { $colors = [ 'Purchase' => 'success', 'Sale' => 'danger', 'Opening Stock' => 'primary', 'Stock Adjustment' => 'warning', 'Stock Transfer' => 'info' ]; return $colors[$type] ?? 'secondary'; } } @endphp @section('content')
SKU: {{ $product->sku }}
Quantities In
{{ number_format($quantitiesIn, 2) }}
Quantities Out
{{ number_format($quantitiesOut, 2) }}
Current Stock
{{ number_format($currentStock, 2) }}
| Type | Quantity change | New Quantity | Date | Reference No | Customer/Supplier |
|---|---|---|---|---|---|
| {{ $history->type }} | {{ $history->quantity_change > 0 ? '+' : '' }}{{ number_format($history->quantity_change, 2) }} | {{ number_format($history->new_quantity, 2) }} | {{ \Carbon\Carbon::parse($history->date)->format('M d, Y') }} | {{ $history->reference_no ?? '-' }} | {{ $history->customer_supplier ?? '-' }} |
| No stock history found | |||||