{{ $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) }}
|
@endforeach
@php
$total = $total + 1;
@endphp