@extends('layouts.master') @section('css') @endsection @section('title') Manufacturing Consumption for {{ $stockItem->name }} - BOM {{ $stockItemBom->name }} @endsection @section('content') @csrf Back to Stock Item BOM Manufacturing Consumption for {{ $stockItem->name }} - BOM {{ $stockItemBom->name }} Select Main Unit @foreach ($itemUnits as $unit) manufacturing_unit_id == $unit->id ? 'selected' : '' }}> {{ $unit->symbol }} @endforeach @if ($stockItemManufacturers->count() > 0) @foreach ($stockItemManufacturers as $key => $stockItemManufacturer) @if ($key == 0) Item @if ($stockItemManufacturer->manufacturing_item_id != null) {{ $stockItemManufacturer->manufacturingItem->name }} @endif Unit @isset($stockItemManufacturer) @php $itemUnits = \App\Models\StockItemUnits::where( 'stock_item_id', $stockItemManufacturer->manufacturing_item_id, )->get(); @endphp @foreach ($itemUnits as $itemUnit) unit_id == $itemUnit->unit_id) selected @endif> {{ $itemUnit->unit->symbol }} @endforeach @endisset Quantity @else Item @if ($stockItemManufacturer->manufacturing_item_id != null) {{ $stockItemManufacturer->manufacturingItem->name }} @endif Unit @isset($stockItemManufacturer) @php $itemUnits = \App\Models\StockItemUnits::where( 'stock_item_id', $stockItemManufacturer->manufacturing_item_id, )->get(); @endphp @foreach ($itemUnits as $itemUnit) unit_id == $itemUnit->unit_id) selected @endif> {{ $itemUnit->unit->symbol }} @endforeach @endisset Quantity @endif @endforeach @else Item Unit Quantity @endif Add Row {{-- By Products --}} By Products @if ($stockItemByProducts->count() > 0) @foreach ($stockItemByProducts as $key => $byProduct) Item @if ($byProduct->by_product_id != null) {{ $byProduct->byProduct->name }} @endif Unit @isset($byProduct) @php $itemUnits = \App\Models\StockItemUnits::where( 'stock_item_id', $byProduct->by_product_id, )->get(); @endphp @foreach ($itemUnits as $itemUnit) unit_id == $itemUnit->unit_id) selected @endif> {{ $itemUnit->unit->symbol }} @endforeach @endisset Quantity @endforeach @endif Add Row {{-- End By Products --}} {{-- Expenses --}} Expenses @if ($stockItemExpenses->count() > 0) @foreach ($stockItemExpenses as $key => $expense) Item @if ($expense->expense_ledger_id != null) {{ $expense->expenseLedger->name }} @endif Amount @endforeach @endif Add Row @endsection @section('script') @endsection