@extends('layouts.app') @section('content')
Update Stock
has('bar_select')) autofocus @endif>
@if($product)
@csrf
Barcode {{ $product->product_barcode }}
Product ID {{ $product->product_productid }}
Name {{ $product->product_name }} @if($product->product_name != $product->product_name_sinhala) , {{ $product->product_name_sinhala }} @endif

Total In {{ number_format(\App\Models\StockDetail::totalIn($product->product_systemid), 3) }}
Total Out {{ number_format(\App\Models\StockDetail::totalOut($product->product_systemid), 3) }}
Balance QTY {{ number_format(\App\Models\StockDetail::availableQty($product->product_systemid), 3) }}

@if($type == 0)
@endif
@foreach($locations as $location) @endforeach
{{ $location->ld_name }} {{ number_format(\App\Models\StockDetail::availableQtyByLocation($product->product_systemid, $location->ld_id), 3) }}
@endif
Last 50 record stock summary
@if($product)
@php $movements = \App\Models\StockDetail::where('stock_systemid', $product->product_systemid) ->with(['badge', 'location']) ->orderBy('stock_id', 'desc') ->limit(50) ->get(); @endphp @forelse($movements as $movement) @empty @endforelse
Time Info QTY Type
{{ $movement->stock_addtime->format('Y-m-d h:i A') }} {{ $movement->stock_info }}
@if($movement->badge) {{ $movement->badge->price_name }} @endif @if($movement->location) ({{ $movement->location->ld_name }}) @endif @if($movement->stock_type == 0 && $movement->stock_return_remark)
{{ $movement->stock_return_remark }} @endif
{{ number_format($movement->stock_qty, 3) }} @if($movement->stock_type == 1) Stock In @else Stock Out @endif
Record Not Found
Badge wise available Qty
@php $badges = \App\Models\PriceDetail::where('price_systemid', $product->product_systemid) ->orderBy('price_id', 'desc') ->get(); @endphp @foreach($badges as $badge) price_remove == 1) style="text-decoration: line-through;" @endif> @endforeach
Badge Create Time MRP Qty
{{ $badge->price_name }} {{ $badge->price_addtime->format('Y-m-d h:i A') }} {{ number_format($badge->price_sale, 2) }} {{ number_format(\App\Models\StockDetail::availableQtyByBadge($product->product_systemid, $badge->price_id), 3) }}
@endif
@foreach($products as $prod) @endforeach @if($notFound) @endif @if(session('success')) @endif @endsection