@extends('layouts.dashboard') @section('content') @include('customers._theme')
@if(session('success'))
✅ {{ session('success') }}
@endif @if(session('error'))
⚠️ {{ session('error') }}
@endif
← Back to Customers

Import Customers

Upload XLSX, XLS, or CSV. Existing customers are updated by customer code or matching phone.

@csrf @if(auth()->user()->isAdmin()) @else
All imported customers will be assigned to {{ auth()->user()->name }}.
@endif

📄 Template

Download the recommended columns and example row.

Download CSV Template

🔎 Matching Rules

  1. Customer code
  2. Normalized phone number
  3. Exact shop name for the same salesman

Draft orders with matching customer details are linked automatically.

@if(session('import_summary')) @php $summary = session('import_summary'); @endphp

Import Result

Rows
{{ $summary['total_rows'] }}
Created
{{ $summary['created'] }}
Updated
{{ $summary['updated'] }}
Skipped
{{ $summary['skipped'] }}
Orders Linked
{{ $summary['linked_orders'] }}
@if(!empty($summary['errors']))
@foreach($summary['errors'] as $error) @endforeach
Row Error
{{ $error['row'] }} {{ $error['message'] }}
@endif
@endif
@endsection