@extends('layouts.app') @section('title') {{'Item Wise Stock Ledger'}} @endsection @section('content')
Item Wise Stock Ledger Back
Search by Item
Start Date
End Date

 

@if(isset($product_id) && $product_id !='')
@include('layouts.head')

Item Ledger

{!! date('d-F-Y', strtotime($start_date)) !!} to {!! date('d-F-Y', strtotime($end_date)) !!}

@if (Session::has('msg'))
{{ Session::get('msg') }}
@endif
@php foreach($all_products as $val){ if($_GET['product_id'] == $val->id){ $product_name = $val->product_name; break; } } @endphp
Item Code: {{$_GET['product_id']}}
Item Name: {{$product_name}}
@php $i=0; $T_Received = 0; $T_Sales = 0; $Balance = 0; $opening_balance = $opening_stock->product_received - $opening_stock->product_sales + $opening_stock->product_in -$opening_stock->product_out + $opening_stock->product_return - $opening_stock->purchase_return; @endphp @php $i = 1; @endphp @foreach ($product_data as $txn_date => $products) @foreach ($products as $index => $product) @php $Supplier = DB::table('suppliers')->select('name')->where('id','=', $product['supplier'])->first(); $T_Received += isset($product['in']) ? $product['in'] : 0 ; $T_Sales += isset($product['out']) ? $product['out'] : 0; $Balance = $opening_balance + $T_Received - $T_Sales; @endphp @endforeach @endforeach
S.N. Date Voucher No. Supplier/Customer Name Vch Type In Quantity Out Quantity Stock
0 {!! date('d-m-Y', strtotime($start_date))!!} Opening Balance -- -- -- -- {{ $opening_balance }}
{{ $i++ }} {!! date('d-M-Y', strtotime($txn_date)) !!} {{ $product['voucher_no'] }} {{ $Supplier->name }} {{ $product['vch_type'] }} {{ isset($product['in']) ? $product['in'] : '' }} {{ isset($product['out']) ? $product['out'] : '' }} {{ $Balance }}
# {!! date('d-m-Y', strtotime($end_date))!!} Closing Balance -- -- {{ number_format($T_Received,2) }} {{ number_format($T_Sales,2) }} {{ number_format($Balance,2) }}
@endif
@endsection