@php $i = $item ?? null; $itemType = old('type', $i?->type ?? 'product'); $descMax = $descriptionMax ?? 1000; $descVal = old('description', $i?->description ?? ''); $descLen = strlen($descVal); $descPct = min(100, round(($descLen / $descMax) * 100)); @endphp
{{ $i ? 'Edit Item' : 'New Item' }}

Add a product with inventory or a service for billing

Basic details
{{ $descMax - $descLen }} / {{ $descMax }} characters left
@php $savedUnit = old('unit', $i?->unit ?? ''); $unitMeta = $savedUnit ? (collect($unitsCatalog ?? [])->firstWhere('code', $savedUnit) ?? collect($unitsCatalog ?? [])->first(fn ($u) => strcasecmp($u['code'], $savedUnit) === 0)) : null; $unitLabel = $unitMeta['label'] ?? ($savedUnit ?: 'Select unit'); @endphp
@include('partials.admin.unit-combobox', [ 'name' => 'unit', 'value' => $unitMeta['code'] ?? $savedUnit, 'label' => $unitLabel, 'size' => 'lg', 'placeholder' => 'Select unit', 'optional' => $unitOptional ?? true, 'required' => !($unitOptional ?? true), ])
Product & inventory
@if($i)Locked after creation@endif
Service codes
Pricing
Sales info
Purchase info
is_active ?? true))>
@push('scripts') @if(isset($unitsJson)) @endif @endpush