@extends('layouts.contentLayoutMaster') @section('title') {{ $object->code }} @endsection @php $breadcrumbs = [ [ 'link'=>route('inventories'), 'name' =>'Inventories' ] ] @endphp @section('vendor-style') @endsection @section('content') @include('elements.messages-error')

Item Details

{!! Form::model($object, ['route' => ['inventory-update', $object->id], 'method' => 'post', 'class' => 'form form-vertical', 'novalidate']) !!} @csrf
{!! Form::label('code', 'Item *') !!}
{!! Form::text('code', old('code'), [ 'id' => 'code', 'class' => 'form-control', ] + $validationRules['code']) !!}
{!! Form::label('supplier_ids', 'Supplier') !!}
{!! Form::select('supplier_ids[]', $suppliers['options'], old('supplier_ids', $object->suppliers()->withTrashed()->get()), ['id' => 'supplier_ids', 'class' => 'select2 form-control', 'multiple' => 'multiple'] + $validationRules['supplier_ids'], $suppliers['optionAttributes']) !!}
{!! Form::label('descriptions', 'Description') !!}
{!! Form::textarea('descriptions', old('descriptions'), [ 'id' => 'descriptions', 'class' => 'form-control', ] + $validationRules['descriptions']) !!}
{!! Form::label('updated_at', 'Updated At') !!}
{{ $object->updated_at->format(env('DEFAULT_DATE_FORMAT')) }}
{!! Form::label('remaining_stock', 'Remaining stock') !!}
{{ $object->unit ?? 0 }}
Cancel
{{ Form::close() }}

Generate Transaction

Transaction Types Legend
{!! Form::open(['route' => ['inventory-transaction-store', $object->id], 'method' => 'post', 'class' => 'form form-vertical', 'novalidate']) !!} @csrf
{!! Form::label('transaction_type', 'Transaction Type') !!}
{!! Form::select('transaction_type', $transactionTypes, old('transaction_type'), [ 'id' => 'transaction_type', 'class' => 'select2 form-control', 'placeholder' => 'Select Type', 'data-minimum-results-for-search' => 'Infinity' ] + $transactionValidationRules['transaction_type']) !!}
{!! Form::label('quantity', 'Quantity') !!}
{!! Form::text('quantity', old('quantity'), [ 'id' => 'quantity', 'class' => 'form-control', ] + $transactionValidationRules['quantity']) !!}
{!! Form::label('note', 'Note') !!}
{!! Form::text('note', old('note'), [ 'id' => 'note', 'class' => 'form-control', ] + $transactionValidationRules['note']) !!}
{{ Form::close() }}

Transaction History

@if($inventoryTransactions->isNotEmpty()) @foreach($inventoryTransactions as $inventoryTransaction) @endforeach
Date User Transaction Type Quantity Note
{{ $inventoryTransaction->created_at->format('d/m/Y H:i:s') }} {{ $inventoryTransaction->creator->first_name }} {{ $inventoryTransaction->creator->last_name }} {{ \App\Models\InventoryTransaction::INVENTORY_TRANSACTION_TYPES[$inventoryTransaction->transaction_type] }} {{ $inventoryTransaction->quantity }} {{ $inventoryTransaction->note }}
@else There are no transactions to show @endif

Stock-in transactions: These transactions represent the addition of new inventory items to your stock. When you receive new items, you would log the quantity received and update the Remaining Quantity of an item in your inventory.

Stock-out transactions: Stock-out transactions occur when you sell or otherwise temporarily remove items from your inventory (e.g. an employee takes an item on the job and returns it when the job is done). You would record the quantity sold or removed and subtract it from the Remaining Quantity of that item in your inventory.

Return transactions: Return transactions occur when customers or employees return items. You would record the quantity returned and add it back to your inventory.

Adjustment transactions: Adjustment transactions are useful for correcting discrepancies or making manual updates to your inventory quantities. For example, if you discover damaged or lost items, you can perform an adjustment transaction to reduce the quantity accordingly.

@endsection