@extends('layouts.dashboard') @php $editing = $customer->exists; $pageTitle = $editing ? trans('dashboard.edit_customer') : trans('dashboard.add_customer'); @endphp @section('title', $pageTitle) @section('header_title', $pageTitle) @section('content')
{{-- Breadcrumb --}}
@if($editing) {{ $customer->uuid }} @endif
@csrf @if($editing) @method('PUT') @endif {{-- SECTION 1: IDENTITY --}}

{{ trans('dashboard.cust_basic_data') }}

{{-- Errors --}} @if($errors->any())
@foreach($errors->all() as $error)
{{ $error }}
@endforeach
@endif {{-- Name + VAT --}}

{{ trans('dashboard.cust_vat_b2b_hint') }}

{{-- SECTION 2: ADDRESS --}}

{{ trans('dashboard.cust_address_title') }}

{{-- ZATCA note --}}
{{ trans('dashboard.cust_address_zatca_note') }}
{{-- Short address --}}

{{ trans('dashboard.cust_short_address_hint') }}

{{-- Address grid --}}
{{-- Country --}}
{{-- SECTION 3: CONTACT --}}
{{-- SECTION 4: CUSTOMER CARD PREVIEW --}}

{{ trans('dashboard.cust_card_preview') }}

{{ ($customer->name ? mb_substr($customer->name, 0, 1) : '?') }}
{{ $customer->name ?: trans('dashboard.cust_default_name') }}
{{ $customer->vat_number ?: trans('dashboard.cust_no_vat') }}
{{ collect([$customer->address_city, $customer->address_country ?: 'SA'])->filter()->implode(', ') ?: 'SA' }}
@if($customer->vat_number) B2B @else B2C @endif
{{-- ACTION BAR --}}
{{ trans('dashboard.cust_reusable_notice') }}
{{ trans('dashboard.cancel') }}
@endsection