{{$lang->data['print_stock_report'] ?? 'Print Stock Report'}} @php $branch = 'All Branches'; if($search != '') { $search = $search; $materials =\App\Models\Material::where('name','like','%'.$search.'%')->whereIsActive(1)->get(); } else{ $materials =App\Models\Material::whereIsActive(1)->get(); } @endphp

Stock Report

{{$branch}}
{{ \Carbon\Carbon::now()->format('d/m/Y') }}


@php $total = 0; $i = 1; @endphp @foreach ($materials as $row) @endforeach @php $total = $total + 1; @endphp
# {{ $lang->data['material_name'] ?? 'Material Name' }} {{ $lang->data['opening_stock'] ?? 'Opening Stock' }} {{ $lang->data['purchase'] ?? 'Purchase' }} {{ $lang->data['transferred'] ?? 'Transferred' }} {{ $lang->data['adjusted'] ?? 'Adjusted' }} {{ $lang->data['in_stock'] ?? 'In Stock' }}
{{ $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'); @endphp {{ $increments - $decrements }} {{ getUnitType($row->unit) }}