@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 Go Back Item Code Name Image Stock Group Select stock group HSN Code hsn_code_required == 1) required @endif> Type Select type type == 'Goods' ? 'selected' : '') : '' }}> Goods type == 'Service' ? 'selected' : '') : '' }}> Service Barcode Internal Barcode GST Applicable Select gst_applicable == 'Applicable' ? 'selected' : '') : '' }}> Applicable gst_applicable == 'Not Applicable' ? 'selected' : '') : '' }}> Not Applicable GST% CESS% Status status == 1 ? 'selected' : '') : 'selected' }}> Active status == 0 ? 'selected' : '') : '' }}> Inactive Description {{ isset($stockItem) ? $stockItem->description : '' }} Stock warning level Stock critical level Stock Category Select Category @foreach ($stockCategories as $stockCategory) id, $stockItem->stockItemCategories?->pluck('stock_category_id')->toArray() ?? []) ? 'selected' : '') : '' }}> {{ $stockCategory->name }} @endforeach @if(Auth::user()->company_profile->transfer_business_key != null) Is Transfer is_transfer) selected @endif @endisset>Yes is_transfer) selected @endif @endisset>No @endif Base Unit & Price Details Base Unit @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 @foreach ($units as $unit) baseStockItemUnit->unit_id == $unit->id ? 'selected' : '') : '' }}> {{ $unit->symbol }} @endforeach @endif @else @foreach ($units as $unit) baseStockItemUnit->unit_id == $unit->id ? 'selected' : '') : '' }}> {{ $unit->symbol }} @endforeach @endisset Selling Price(Excl Tax) Selling Price(Incl Tax) Purchase Price(Excl Tax) Purchase Price(Incl Tax) MRP @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 Alternative Unit @if ($used == true) @else @foreach ($units as $unit) unit_id == $unit->id ? 'selected' : '') : '' }}> {{ $unit->symbol }} @endforeach @endif Alternative Unit Qty @if ($used == true && $stockItemUnit->unit_qty != null) @else @endif Alternative Unit Selling Price Alternative Unit Purchase Price @endforeach @endisset +Add 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) Stock Location @foreach ($stockLocations as $stockLocation) stock_location_id == $stockLocation->id ? 'selected' : '') : '' }}> {{ $stockLocation->name }} @endforeach Unit @foreach ($units as $unit) unit_id == $unit->id ? 'selected' : '') : '' }}> {{ $unit->symbol }} @endforeach Opening Stock Rate Value @if ($key == 0) @else @endif @endforeach @else Stock Location @foreach ($stockLocations as $stockLocation) {{ $stockLocation->name }} @endforeach Unit @foreach ($units as $unit) {{ $unit->symbol }} @endforeach Opening Stock Rate Value @endif @else Stock Location @foreach ($stockLocations as $stockLocation) {{ $stockLocation->name }} @endforeach Unit @foreach ($units as $unit) {{ $unit->symbol }} @endforeach Opening Stock Rate Value @endisset {{-- Variant Locations Start-- --}} Stock Location Details (Variants) @isset($stockItem) @foreach ($stockItem->stockItemLocations->where('variant_item','1') as $key => $stockItemLocation) Stock Location @foreach ($stockLocations as $stockLocation) stock_location_id == $stockLocation->id ? 'selected' : '') : '' }}> {{ $stockLocation->name }} @endforeach Unit @foreach ($units as $unit) unit_id == $unit->id ? 'selected' : '') : '' }}> {{ $unit->symbol }} @endforeach Opening Stock Rate Value @endforeach @endisset {{-- Varaiant Stok Locations End --}} Manufacturing Consumption Select Main Unit @foreach ($units as $unit) manufacturing_unit_id == $unit->id ? 'selected' : '') : '' }}> {{ $unit->symbol }} @endforeach @isset($stockItem) @if ($stockItem->stockItemManufacturers->count() > 0) @foreach ($stockItem->stockItemManufacturers as $key => $stockItemManufacturer) @if ($key == 0) Item @isset($stockItemManufacturer) {{ $stockItemManufacturer->manufacturingItem->name }} @endisset Unit @isset($stockItemManufacturer) {{ $stockItemManufacturer->unit->symbol }} @endisset Quantity @else Item @isset($stockItemManufacturer) {{ $stockItemManufacturer->manufacturingItem->name }} @endisset Unit @isset($stockItemManufacturer) {{ $stockItemManufacturer->unit->symbol }} @endisset Quantity @endif @endforeach @else Item Unit Quantity {{-- --}} @endif @else Item Unit Quantity {{-- --}} @endisset Price Slab Details @isset($stockItem) @if ($stockItem->stockItemPriceSlabs->count() > 0) @foreach ($stockItem->stockItemPriceSlabs as $key => $stockItemPriceSlab) @if ($key == 0) Price Slab @foreach ($priceSlabs as $priceSlab) price_slab_id == $priceSlab->id ? 'selected' : '') : '' }}> {{ $priceSlab->name }} @endforeach Unit @foreach ($units as $unit) unit_id == $unit->id ? 'selected' : '') : '' }}> {{ $unit->symbol }} @endforeach Selling Price (Excl Tax) Selling Price(Incl Tax) @else Price Slab @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 @foreach ($priceSlabs as $priceSlab) price_slab_id == $priceSlab->id ? 'selected' : '') : '' }}> {{ $priceSlab->name }} @endforeach Unit @foreach ($units as $unit) unit_id == $unit->id ? 'selected' : '') : '' }}> {{ $unit->symbol }} @endforeach Selling Price (Excl Tax) Selling Price(Incl Tax) @if (!$is_used) @endif @endif @endforeach @else Price Slab @foreach ($priceSlabs as $priceSlab) {{ $priceSlab->name }} @endforeach Unit @foreach ($units as $unit) {{ $unit->symbol }} @endforeach Selling Price(Excl Tax) Selling Price(Incl Tax) @endif @else Price Slab @foreach ($priceSlabs as $priceSlab) {{ $priceSlab->name }} @endforeach Unit @foreach ($units as $unit) {{ $unit->symbol }} @endforeach Selling Price(Excl Tax) Selling Price(Incl Tax) @endisset @isset($stockItem) Update Stock Item @else Add Stock Item @endisset @endsection @section('script') @endsection