@extends('admin.layouts.app') @section('title', 'Positive Stock Closing Report') @push('styles') @endpush @section('container')

Positive Stock Closing Report

@if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif
@if(count($stocks)>0)

Positive Stock Closing Report

Warehouse: {{ $selected_warehouse }}

Date: {{ date('d-m-Y',strtotime(request('date'))) }}

@php $totalUnitSetStock = 0; $totalLastPurPrice = 0; $totalAvgPrice = 0; $totalLastPurStockPrice = 0; $totalAvgStockPrice = 0; @endphp @foreach($stocks as $index=>$stock) @php $totalUnitSetStock += ($stock->s_stock_in - $stock->s_stock_out)/$stock->product->unit->quantity??1; $totalLastPurPrice += $stock->product->last_buying_price ?? 0 ; $totalAvgPrice += $stock->product->average_buying_price ?? 0 ; $totalLastPurStockPrice += $stock->product->last_buying_price * ($stock->s_stock_in - $stock->s_stock_out) ; $totalAvgStockPrice += $stock->product->average_buying_price * ($stock->s_stock_in - $stock->s_stock_out); @endphp @endforeach
SL Product Type Product Sub Type Product Stock In Stock Out Last Pur Price Average Pur Price Last Pur Stock Price Average Pur Stock Price Closing Stock(Pcs)
{{ $index+1 }} {{ $stock->product->productCategory->name??'' }} {{ $stock->product->productSubCategory->name??'' }} {{ $stock->product->name??'' }} {{ $stock->s_stock_in }} {{ $stock->s_stock_out }} {{ number_format($stock->product->last_buying_price ?? '0',2)}} {{ number_format($stock->product->average_buying_price ?? '0',2) }} {{ number_format(($stock->product->last_buying_price*($stock->s_stock_in - $stock->s_stock_out)),2)}} {{ number_format($stock->product->average_buying_price *($stock->s_stock_in - $stock->s_stock_out),2)}} {{ $stock->s_stock_in - $stock->s_stock_out }}
Total {{ $stocks->sum('s_stock_in') }} {{ $stocks->sum('s_stock_out') }} {{ number_format($totalLastPurPrice,2) }} {{ number_format($totalAvgPrice,2)}} {{ number_format($totalLastPurStockPrice,2) }} {{ number_format($totalAvgStockPrice,2)}} {{ $stocks->sum('s_stock_in')-$stocks->sum('s_stock_out') }}
@endif
@endsection @push('scripts') @endpush