@extends('layouts.master') @section('css') @endsection @section('title') Stock Items @endsection @section('content')
@isset($stockItem)
@method('put') @else @endisset @csrf
@isset($stockItem) Edit Stock Item @else Add Stock Item @endisset
@if (!isset($stockItem) && isset($lastCode))

Last Code: {{ $lastCode }}

@endif
hsn_code_required == 1) required @endif>
{{--
--}}
@isset($stockItemMrps) @foreach ($stockItemMrps->where('is_default', 0) as $stockItemMrp)
@endforeach @endisset
Base Unit & Price Details
@isset($stockItem) @php $baseUnitId = $stockItem->baseStockItemUnit->unit_id; $inventoryUsed = \App\Models\InventoryVoucherItem::where( 'stock_item_id', $stockItem->id, ) ->where('unit_id', $baseUnitId) ->first(); $accountingUsed = \App\Models\AccountingVoucherItem::where( 'stock_item_id', $stockItem->id, ) ->where('unit_id', $baseUnitId) ->first(); if ($inventoryUsed || $accountingUsed) { $used = true; } else { $used = false; } @endphp @if ($used == true) @else @endif @else @endisset
{{--
--}}
@isset($stockItem) @foreach ($stockItem->stockItemUnits as $key => $stockItemUnit) @php $inventoryUsed = \App\Models\InventoryVoucherItem::where( 'stock_item_id', $stockItem->id, ) ->where('unit_id', $stockItemUnit->unit->id) ->first(); $accountingUsed = \App\Models\AccountingVoucherItem::where( 'stock_item_id', $stockItem->id, ) ->where('unit_id', $stockItemUnit->unit->id) ->first(); if ($inventoryUsed || $accountingUsed) { $used = true; } else { $used = false; } @endphp
@if ($used == true) @else @endif
@if ($used == true && $stockItemUnit->unit_qty != null) @else @endif
@endforeach @endisset
Opening stock location
@isset($stockItem) @if ($use_variant) Variants @endif @endisset
@isset($stockItem) @if ($stockItem->stockItemLocations->count() > 0) @foreach ($stockItem->stockItemLocations->where('variant_item', '0') as $key => $stockItemLocation)
@if ($key == 0)
@else
@endif
@endforeach @else
@endif @else
@endisset
@endsection @section('script') @endsection