@php $layout = isSeller() ? 'layouts.seller' : 'layouts.admin'; $updateRoute = isSeller() ? 'seller.add-stock.update' : 'admin.individual-stock.update'; $listRoute = isSeller() ? 'seller.add-stock.index' : 'admin.individual-stock.index'; $select2OptionsRoute = isSeller() ? 'seller.add-stock.select2-options' : 'admin.add-stock.select2-options'; @endphp @extends($layout) @section('content')
{!! Form::model($result, ['route' => [$updateRoute, $result->id], 'method' => 'POST', 'id' => 'ajaxSave', 'files' => true]) !!}
@if(!isSeller())
{!! Form::label('store_id', __('store.title1'), ['class' => 'control-label mb-2']) !!} {!! Form::select('store_id', $stores, $result->store_id, [ 'class' => 'form-control select2', 'data-actions-box' => 'true', 'data-width' => '100%', ]) !!}
@else {!! Form::hidden('store_id', sellerId()) !!} @endif
{{ Form::label('date', __('add_stock.date'), ['class' => 'control-label']) }} {{ Form::text('date', dateFormat($result->adjustment_dt, SHOW_DATE), ['class' => 'form-control', 'readonly' => true]) }}
{{ Form::label('remarks', __('add_stock.remarks'), ['class' => 'control-label']) }} {{ Form::textarea('remarks', null, ['class' => 'form-control', 'size' => '2x1']) }}
@if($result) @endif
{{ Form::label('department_name', __('add_stock.department_name'), ['class' => 'control-label']) }}
{{ Form::label('remark', __('add_stock.item_name'), ['class' => 'control-label']) }}
{{ Form::label('quantity', __('add_stock.quantity'), ['class' => 'control-label']) }}
{{ Form::label('remarks', __('add_stock.remarks'), ['class' => 'control-label']) }}
{!! Form::hidden('delete_items', null, ['class' => '__delete_item']) !!}
@php $count = 0; @endphp @if (isset($stockItems) && count($stockItems) > 0) @foreach ($stockItems as $k => $item)
{{ Form::select('department_id['.$k.']', $inventoryDepartments, $item->department_id, array('class' => 'form-control item_departments select2', 'id' => 'department', 'data-live-search' => 'true','data-item_id'=>$k,'onChange'=>'itemsFilter(this)')) }}
{!! Form::hidden("stock_item_id[$k]", $item->id) !!} @php $invItems = $inventoryItems; // $invItems[$item->item_id] = $item->item_name; $invItems = array_unique($invItems); @endphp {{-- {!! Form::select("item[$k]", $invItems, $item->item_id, ['class' => 'form-control __item select2']) !!} --}}
{!! Form::text("quantity[$k]", $item->quantity, ['class' => 'form-control __quantity']) !!}
{!! Form::text("item_remarks[$k]", $item->remarks, ['class' => 'form-control __remarks']) !!}
@php $count++; @endphp @endforeach @endif
  • {{ Form::submit(__('common.save'), ['class' => 'btn btn-primary width80']) }}
  • {{--
  • {{ Form::reset( __('common.cancel'), array('class' => 'btn btn-default btn-lg font12'));}}
  • --}}
{{ Form::close() }}
{{ Form::select('department_id', $inventoryDepartments, '', array('class' => 'item-department item_departments','onChange'=>'itemsFilter(this)','data-item_id'=>0)) }}
{{-- {!! Form::select('item', $inventoryItems, null, ['class' => 'form-control __item']) !!} --}} @php $invItems = $inventoryItems; // $invItems[$item->item_id] = $item->item_name; $invItems = array_unique($invItems); @endphp
{!! Form::text('quantity', null, ['class' => 'form-control __quantity']) !!}
{!! Form::text('item_remarks', null, ['class' => 'form-control __remarks']) !!}
@endsection @section('script') @endsection