{{ __('main.stock_report') }}
# {{ __('main.material_name') }} {{ __('main.opening_stock') }} {{ __('main.purchase') }} {{ __('main.transferred') }} {{ __('main.adjusted') }} {{ __('main.in_stock') }}
@php $total = 0; $i = 1; $totalquantity =0; @endphp @foreach ($materials as $row) @php $total = $total + 1; @endphp @endforeach
{{ $i++ }} {{ $row->name }} {{ $row->opening_stock }} {{ getUnitType($row->unit) }} @php $purchase_list = \App\Models\Purchase::where('purchase_type', 2)->get(); $purchase_sum = 0; foreach ($purchase_list as $purchase_row) { $purchase_row_list = \App\Models\PurchaseDetail::where('purchase_id', $purchase_row->id)->get(); foreach ($purchase_row_list as $detail_row) { if ($detail_row->material_id == $row->id) { $purchase_sum = $purchase_sum + $detail_row->purchase_quantity; } } } @endphp {{ $purchase_sum }} {{ getUnitType($row->unit) }} {{ $row->transfer->sum('quantity') }} {{ getUnitType($row->unit) }} + {{ $row->adjustment->where('type', 2)->sum('quantity') }} {{ getUnitType($row->unit) }} / - {{ $row->adjustment->where('type', 1)->sum('quantity') }} {{ getUnitType($row->unit) }} @php $increments = $row->opening_stock + $row->purchase->sum('purchase_quantity') + $row->adjustment->where('type', 2)->sum('quantity'); $decrements = $row->transfer->sum('quantity') + $row->adjustment->where('type', 1)->sum('quantity'); $totalquantity += $increments-$decrements; @endphp {{ $increments - $decrements }} {{ getUnitType($row->unit) }}
@if ($hasMorePages)
Loading...
Loading...
@endif