@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
hsn_code_required == 1) required @endif>
@if(Auth::user()->company_profile->transfer_business_key != null)
@endif
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
Stock Location Details
@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
{{-- Variant Locations Start-- --}}
Stock Location Details (Variants)
@isset($stockItem) @foreach ($stockItem->stockItemLocations->where('variant_item','1') as $key => $stockItemLocation)
@endforeach @endisset
{{-- Varaiant Stok Locations End --}}
Manufacturing Consumption
@isset($stockItem) @if ($stockItem->stockItemManufacturers->count() > 0) @foreach ($stockItem->stockItemManufacturers as $key => $stockItemManufacturer) @if ($key == 0)
@else
@endif @endforeach @else
{{--
--}}
@endif @else
{{--
--}}
@endisset
Price Slab Details
@isset($stockItem) @if ($stockItem->stockItemPriceSlabs->count() > 0) @foreach ($stockItem->stockItemPriceSlabs as $key => $stockItemPriceSlab) @if ($key == 0)
@else
@php $is_used = false; $orderItems = \App\Models\OrderItem::where([ 'business_key' => $stockItem->business_key, 'price_slab_id' => $stockItemPriceSlab->id, ])->first(); $avItems = \App\Models\AccountingVoucherItem::where( [ 'business_key' => $stockItem->business_key, 'price_slab_id' => $stockItemPriceSlab->id, ], )->first(); if ($avItems) { $is_used = true; } if ($orderItems) { $is_used = true; } @endphp
@if (!$is_used)
@endif
@endif @endforeach @else
@endif @else
@endisset
@endsection @section('script') @endsection