@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 @if (!isset($stockItem) && isset($lastCode)) Last Code: {{ $lastCode }} @endif Item Code Name Stock Group Select stock group @isset($stockItem) {{ $stockItem->stockGroup->name }} @endisset Type Select type type == 'Goods' ? 'selected' : '') : '' }}> Goods type == 'Service' ? 'selected' : '') : '' }}> Service HSN Code hsn_code_required == 1) required @endif> GST Applicable Select gst_applicable == 'Applicable' ? 'selected' : '') : '' }}> Applicable gst_applicable == 'Not Applicable' ? 'selected' : '') : '' }}> Not Applicable {{-- GST% CESS% --}} Gst / Cess Slabs Starting From GST CESS Status status == 1 ? 'selected' : '') : 'selected' }}> Active status == 0 ? 'selected' : '') : '' }}> Inactive Stock warning level Stock critical level Margin % Mrp Starting From MRP + @isset($stockItemMrps) @foreach ($stockItemMrps->where('is_default', 0) as $stockItemMrp) - @endforeach @endisset 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 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) 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 @isset($stockItem) Update Stock Item @else Add Stock Item @endisset @endsection @section('script') @endsection