@php use App\Enums\JobPriority; use App\Enums\PasscodeType; use App\Enums\PaymentMethod; use App\Models\Customer; use App\Support\JobIntakeOptions; use App\Support\Phone; $selectedCustomer = old('customer_id') ? Customer::find(old('customer_id')) : $customer; $config = [ 'lookupUrl' => route('customers.lookup'), 'catalogue' => $catalogue, 'phoneTypeId' => $catalogue['types']->firstWhere('name', 'Phone')?->id, 'customer' => $selectedCustomer ? ['id' => $selectedCustomer->id, 'name' => $selectedCustomer->name, 'phone' => $selectedCustomer->phone_display] : null, 'phone' => old('customer_phone') ? Phone::toLocal(old('customer_phone')) : ($selectedCustomer ? Phone::toLocal($selectedCustomer->phone) : ''), 'typeId' => old('device_type_id', ''), 'brandId' => old('brand_id') ?? (old('brand_other') ? 'other' : ''), 'modelId' => old('device_model_id') ?? (old('model_other') ? 'other' : ''), 'passcodeType' => old('passcode_type', ''), 'passcode' => old('passcode', ''), 'advance' => old('advance_amount') && (float) old('advance_amount') > 0 ? old('advance_amount') : '', ]; $input = 'mt-1 block w-full min-h-12 text-base border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 rounded-lg shadow-sm'; $chip = 'flex min-h-12 cursor-pointer select-none items-center gap-2 rounded-lg border border-gray-300 bg-white px-3 text-sm font-medium text-gray-700 has-[:checked]:border-indigo-600 has-[:checked]:bg-indigo-50 has-[:checked]:text-indigo-800'; $section = 'rounded-xl bg-white p-4 shadow-sm sm:p-6 space-y-4'; $heading = 'flex items-center gap-3 text-lg font-semibold text-gray-900'; $num = 'flex h-7 w-7 items-center justify-center rounded-full bg-indigo-600 text-sm font-bold text-white'; @endphp

New job card

@csrf @if ($errors->any()) @endif {{-- ========== 1. Customer ========== --}}

1 Customer

Searching…

{{-- Found --}}

Existing customer ·

{{-- Not found: new customer --}}

New customer. They will be saved with this job.

{{-- ========== 2. Device ========== --}}

2 Device

@foreach (['Black', 'White', 'Silver', 'Gold', 'Blue', 'Green', 'Red', 'Purple', 'Pink', 'Grey', 'Space Grey', 'Midnight', 'Starlight'] as $c)
@foreach (['32GB', '64GB', '128GB', '256GB', '512GB', '1TB', '2TB'] as $s)

15 numbers. Dial *#06# to see it.

{{-- ========== 3. Problem ========== --}}

3 Problem

@foreach (JobIntakeOptions::PROBLEMS as $key => $label) @endforeach
{{-- ========== 4. Condition ========== --}}

4 Condition when received

@foreach (JobIntakeOptions::CONDITIONS as $key => $label) @endforeach
{{-- ========== 5. Accessories ========== --}}

5 Accessories received

@foreach (JobIntakeOptions::ACCESSORIES as $key => $label) @endforeach
{{-- ========== 6. Security ========== --}}

6 Screen lock

Saved encrypted. Only the admin and the assigned technician can see it.

@foreach (['' => 'None'] + collect(PasscodeType::cases())->mapWithKeys(fn ($t) => [$t->value => $t->label()])->all() as $value => $label) @endforeach
{{-- 3x3 pattern lock --}}
{{-- Written out with Blade: Alpine's x-for

{{-- ========== 7. Payment and delivery ========== --}}

7 Payment and delivery

@foreach (PaymentMethod::money() as $method) @endforeach
@foreach (['Today' => 0, 'Tomorrow' => 1, '3 days' => 3, '1 week' => 7] as $label => $days) @endforeach
@foreach (JobPriority::cases() as $p) @endforeach
{{-- ========== 8. Photos ========== --}}

8 Device photos

Optional. Take photos of the front, back and any damage. You can add more later from the job page.

@if ($errors->any())

If you added photos, please add them again.

@endif
{{-- Save (sticks to the bottom on phones, above the menu bar) --}}