@extends('layouts.app') @section('page-title', __('Distribute Assets')) @section('page-heading', __('Distribute Assets to ' . $user->first_name . ' ' . $user->last_name)) @section('content')
@if(session('error'))
{{ session('error') }} @if(strpos(session('error'), 'Transaction timeout') !== false)
The system is currently busy. Please wait a moment and try again. @endif
@endif @if(session('success'))
{{ session('success') }}
@endif
@csrf
@if($assets->count() > 0)
@foreach($assets as $asset) @endforeach
Name Available Current Holdings Quantity to Distribute
id, old('assets')) ? 'checked' : '' }}> {{ $asset->quantity }} {{ $userInventory->get($asset->id)?->quantity ?? 0 }} id, old('assets')) ? '' : 'disabled' }}>
@else

No assets available for distribution.

@endif
@csrf
@if($user->distributedAssets->groupBy('asset_id')->count() > 0)
@foreach($user->distributedAssets->groupBy('asset_id') as $assetId => $distributions) @php $asset = $distributions->first()->asset; $totalDistributed = $distributions->sum('quantity'); $currentHoldings = $userInventory->get($assetId)?->quantity ?? 0; @endphp @endforeach
Name Total Distributed Quantity to Return
{{ $totalDistributed }} {{ $currentHoldings }}
@else

No assets have been distributed to this user.

@endif
Inventory Status
    @foreach($assets as $asset)
  • {{ $asset->name }} {{ $asset->quantity }}
  • @endforeach
@endsection @push('scripts') @endpush