@extends('layout.app') @section('title', 'Stock Item Report') @push('header_script') @endpush @section('content')
{{-- FILTER FORM --}}
@if($product)
Stock Item Register
{{ $product->product_name }}
Period: {{ date('d-M-Y', strtotime($fromDate)) }} to {{ date('d-M-Y', strtotime($toDate)) }}
@php $totalInQty = 0; $totalInValue = 0; $totalOutQty = 0; $totalOutValue = 0; $lastRow = null; @endphp @forelse($ledgerData as $row) @php $totalInQty += $row['inward_qty'] ?? 0; $totalInValue += $row['inward_value'] ?? 0; $totalOutQty += $row['outward_qty'] ?? 0; $totalOutValue += $row['outward_value'] ?? 0; $lastRow = $row; @endphp {{-- Inwards --}} {{-- Outwards --}} {{-- Balance --}} @php $closingRate = $row['closing_qty'] > 0 ? $row['closing_value'] / $row['closing_qty'] : 0; @endphp @empty @endforelse @php $finalRate = ($lastRow && $lastRow['closing_qty'] != 0) ? $lastRow['closing_value'] / $lastRow['closing_qty'] : 0; @endphp
Date Particulars Vch Type Vch No. Inwards Outwards Closing
Quantity Unit Rate Value Quantity Unit Rate Value Quantity Unit Rate Value
{{ $row['date'] ? date('d-M-y', strtotime($row['date'])) : '' }} @if($row['voucher_type'] == 'Purchase' && $row['voucher_id']) {{ $row['particulars'] }} @elseif($row['voucher_type'] == 'Sale' && $row['voucher_id']) {{ $row['particulars'] }} @else {{ $row['particulars'] }} @endif {{ $row['voucher_type'] ?? '' }} {{ $row['voucher_no'] ?? '' }}{{ $row['inward_qty'] ? number_format($row['inward_qty'], 2) : '' }} {{ $row['inward_qty'] ? $product->units : '' }} {{ $row['inward_rate'] ? number_format($row['inward_rate'], 2) : '' }} {{ $row['inward_value'] ? number_format($row['inward_value'], 2) : '' }}{{ $row['outward_qty'] ? number_format($row['outward_qty'], 2) : '' }} {{ $row['outward_qty'] ? $product->units : '' }} {{ $row['outward_rate'] ? number_format($row['outward_rate'], 2) : '' }} {{ $row['outward_value'] ? number_format($row['outward_value'], 2) : '' }}{{ number_format($row['closing_qty'], 2) }} {{ $product->units }}{{ $closingRate > 0 ? number_format($closingRate, 2) : '' }} {{ number_format($row['closing_value'], 2) }}
No transactions found for this period.
Totals: {{ $totalInQty > 0 ? number_format($totalInQty, 2) : '' }} {{ $totalInQty > 0 ? number_format($totalInValue / $totalInQty, 2) : '' }} {{ $totalInValue > 0 ? number_format($totalInValue, 2) : '' }} {{ $totalOutQty > 0 ? number_format($totalOutQty, 2) : '' }} {{ $totalOutQty > 0 ? number_format($totalOutValue / $totalOutQty, 2) : '' }} {{ $totalOutValue > 0 ? number_format($totalOutValue, 2) : '' }} {{ $lastRow ? number_format($lastRow['closing_qty'], 2) : '' }} {{ $finalRate > 0 ? number_format($finalRate, 2) : '' }} {{ $lastRow ? number_format($lastRow['closing_value'], 2) : '' }}
@else
Stock Item Summary
Period: {{ date('d-M-Y', strtotime($fromDate)) }} to {{ date('d-M-Y', strtotime($toDate)) }}
@php $totalOpQty = 0; $totalOpVal = 0; $totalInQtySum = 0; $totalInValSum = 0; $totalOutQtySum = 0; $totalOutValSum = 0; $totalClQtySum = 0; $totalClValSum = 0; @endphp @forelse($summaryData as $index => $row) @php $totalOpQty += $row['opening_qty']; $totalOpVal += $row['opening_value']; $totalInQtySum += $row['inward_qty']; $totalInValSum += $row['inward_value']; $totalOutQtySum += $row['outward_qty']; $totalOutValSum += $row['outward_value']; $totalClQtySum += $row['closing_qty']; $totalClValSum += $row['closing_value']; $drilldownUrl = route('stock-item-ledger.index') . '?product_id=' . $row['product_id'] . '&from_date=' . date('d-m-Y', strtotime($fromDate)) . '&to_date=' . date('d-m-Y', strtotime($toDate)); @endphp @empty @endforelse
Sr. No. Item Name Unit Opening Qty Opening Value Inward Qty Inward Value Outward Qty Outward Value Closing Qty Closing Value Action
{{ $index + 1 }} {{ $row['product_name'] }} {{ $row['units'] }} {{ number_format($row['opening_qty'], 2) }} {{ number_format($row['opening_value'], 2) }} {{ number_format($row['inward_qty'], 2) }} {{ number_format($row['inward_value'], 2) }} {{ number_format($row['outward_qty'], 2) }} {{ number_format($row['outward_value'], 2) }} {{ number_format($row['closing_qty'], 2) }} {{ number_format($row['closing_value'], 2) }} Next
No items found.
Total: {{ number_format($totalOpQty, 2) }} {{ number_format($totalOpVal, 2) }} {{ number_format($totalInQtySum, 2) }} {{ number_format($totalInValSum, 2) }} {{ number_format($totalOutQtySum, 2) }} {{ number_format($totalOutValSum, 2) }} {{ number_format($totalClQtySum, 2) }} {{ number_format($totalClValSum, 2) }}
@endif
@endsection @push('footer_script') @endpush