@extends('../layout/' . $layout) @section('subhead') Atarud MIS - Inventory Items @endsection @section('subcontent')

Inventory Items List

New Item
@foreach($items as $row) @php $type = App\Models\InventoryItemType::where('id', $row->type_id)->first(); $in = App\Models\InventoryItemsTransactions::where('item_id', $row->id) ->where('transaction_type', 'In') ->where('status', 'completed') ->sum('quantity'); $out = App\Models\InventoryItemsTransactions::where('item_id', $row->id) ->where('transaction_type', 'Out') ->where('status', 'completed') ->sum('quantity'); $total = $row->quantity + $in - $out; @endphp @endforeach
# Name Type Starting Quantity Quantity Actions
{{ ++$loop->index }} {{ $row->name }} {{ $type->name }} {{ $row->quantity }} {{ $total }}
@include('../pages/inventory_items/create') @endsection