@extends('layouts.admin') @section('title', 'Top up — '.$client->name) @section('content')

UPDATE CLIENT UTILISATION

@php $daysSinceTopUp = $client->daysSinceLastTopUp(); @endphp @if ($daysSinceTopUp !== null)

@if ($daysSinceTopUp === 0) Last updated today @elseif ($daysSinceTopUp === 1) 1 day since last update @else {{ $daysSinceTopUp }} days since last update @endif ({{ $client->last_top_up_at->format('d M Y') }})

@else

No top up has been saved for this client yet.

@endif
OAH Partnership Programme @if ($client->logo_path) {{ $client->name }} @else @endif

Current package

@if ($errors->any())
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif @php $products = $client->resolvedProducts(); @endphp @if (count($products) > 0)
@csrf @method('PUT')

Update utilisation

Product name
Assigned
Used
Remaining
@foreach ($products as $index => $product) @php $assigned = old('products.'.$index.'.quantity', $product['quantity'] ?? ''); $used = old('products.'.$index.'.used', $product['used'] ?? '0'); $remaining = '—'; if (is_numeric($assigned) && is_numeric($used)) { $remaining = max(0, (int) $assigned - (int) $used); } @endphp
! $loop->last, ]) style="grid-template-columns: minmax(18rem, 2fr) minmax(11rem, 1fr) minmax(11rem, 1fr) minmax(11rem, 1fr);" data-row-index="{{ $index }}" >

{{ $product['name'] ?? '—' }} used since last update

{{ $remaining }}

@endforeach
Cancel
@else

No products on this client

Add products when editing the client first.

Edit client
@endif
@endsection @push('styles') @endpush @push('scripts') @endpush