@extends('admin.layouts.app') @section('title', 'Product Ledger') @push('styles') @endpush @section('container')

Product Ledger

@if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif
@error('product')

{{ $message }}

@enderror
@error('start_date')

{{ $message }}

@enderror
@error('end_date')

{{ $message }}

@enderror
@if(count($stocks)>0)

Product Ledger

Product Unit: {{ $stocks[0]->product->unit->name??'' }}
@php $total_in = 0; $total_out = 0; $total_exchange_in = 0; $total_exchange_out = 0; $balance = $prevBalance; @endphp @foreach($stocks as $stock) @php $total_in += $stock->stock_in; $total_out += $stock->stock_out; if ($stock->stock_type == 'PURCHASERETURNADJUSTMENT') { $total_exchange_in += $stock->stock_in; $total_exchange_out += $stock->stock_out; } $balance += ($stock->stock_in) - ($stock->stock_out); @endphp {{-- Exchange in/out --}} @endforeach
Date Product Type Product Sub Type Product Voucher No. Type Account Name Rate Exchange In Exchange Out In Out Balance
Previous Balance {{ $prevBalance }}
{{ date('d-m-Y',strtotime($stock->date)) }} {{ $stock->product->productCategory->name ?? '' }} {{ $stock->product->productSubCategory->name ?? '' }} {{ $stock->product->name ?? ''}} @if($stock->stock_in > 0) @if($stock->purchase && $stock->purchase->purchase_no) {{ $stock->purchase->purchase_no??'' }} @else Opening Product @endif @elseif($stock->stock_out > 0) @if($stock->sale && $stock->sale->sale_no) {{ $stock->sale->sale_no??'' }} @else Opening Product @endif @endif {{ $stock->stock_type }} @if($stock->stock_in > 0) @if($stock->purchase && $stock->purchase->purchase_no) {{ $stock->purchase->supplier->name??'' }} @else Opening Product @endif @elseif($stock->stock_out > 0) @if($stock->sale && $stock->sale->sale_no) {{ $stock->sale->client->name??'' }} @else Opening Product @endif @endif @if($stock->stock_in > 0) {{ $stock->buying_price}} @else {{ $stock->selling_price}} @endif @if ($stock->stock_type == 'PURCHASERETURNADJUSTMENT') {{ $stock->stock_in}} @endif @if ($stock->stock_type == 'PURCHASERETURNADJUSTMENT') {{ $stock->stock_out }} @endif {{ $stock->stock_in }} {{ $stock->stock_out }} {{ $balance }}
Total {{ $total_exchange_in }} {{ $total_exchange_out }} {{ $total_in }} {{ $total_out }} {{ $balance }}
@endif
@endsection @push('scripts') @endpush