@extends('layouts.app') @section('content')

{{ $product->name }}

SKU: {{ $product->sku }}

Quantities In

{{ number_format($quantitiesIn, 2) }}

Quantities Out

{{ number_format($quantitiesOut, 2) }}

Current Stock

{{ number_format($currentStock, 2) }}

@forelse($histories as $history) @empty @endforelse
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
@php function getTypeColor($type) { $colors = [ 'Purchase' => 'success', 'Sale' => 'danger', 'Opening Stock' => 'primary', 'Stock Adjustment' => 'warning', 'Stock Transfer' => 'info' ]; return $colors[$type] ?? 'secondary'; } @endphp @endsection