{{ __('Import and Preview Excel Data') }}

@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
{{ __('Data Import Instructions') }}

{{ __('First, add and sync your Mikrotik router to generate the PPPoE secret records in the system. Then upload an Excel/CSV file with the following column headers to update customer profiles:') }}

{{ __('Excel Column Header (Any of these)') }} {{ __('Description') }} {{ __('Status') }}
username / pppoe_username / pppoe_user / user {{ __('PPPoE Secret Username on Mikrotik (Used to map to the synced user)') }} {{ __('Required') }}
customer_unique_id / customer_id / unique_id / id {{ __('Optional: Customer Unique ID. If provided, the system will update the ID in all related tables to match this old ID.') }} {{ __('Optional') }}
name / customer_name {{ __('Full Name of the Customer') }} {{ __('Optional') }}
address / customer_address / location {{ __('Physical Address of the Customer') }} {{ __('Optional') }}
phone / mobile / mobile_no / contact {{ __('Primary Phone Number') }} {{ __('Optional') }}
alternative_phone / alternative_mobile / alt_phone {{ __('Alternative Phone Number') }} {{ __('Optional') }}

{{ __('Upload an Excel/CSV file to record bill collections. The system will match payments using the customer unique ID or PPPoE username:') }}

{{ __('Excel Column Header (Any of these)') }} {{ __('Description') }} {{ __('Status') }}
customer_id / customer_unique_id / username / pppoe_username {{ __('Identifies the customer (matches either Customer Unique ID or Mikrotik PPPoE username)') }} {{ __('Required') }}
amount / collection_amount / paid {{ __('The payment amount collected (must be greater than 0)') }} {{ __('Required') }}
date / collection_date {{ __('Date of payment (defaults to current date if missing or invalid)') }} {{ __('Optional') }}
payment_method / method {{ __('e.g., Cash, Bkash, Nagad, Rocket, Bank (defaults to Cash)') }} {{ __('Optional') }}
bill_month / month {{ __('The bill month billing cycle (format: YYYY-MM, defaults to current month)') }} {{ __('Optional') }}
transaction_id / txid {{ __('MFS or Bank Transaction Reference ID') }} {{ __('Optional') }}

{{ __('Upload an Excel/CSV file to generate monthly rent invoices. The system will match billing profiles using the customer unique ID or PPPoE username:') }}

{{ __('Excel Column Header (Any of these)') }} {{ __('Description') }} {{ __('Status') }}
customer_id / customer_unique_id / username / pppoe_username {{ __('Identifies the customer (matches either Customer Unique ID or Mikrotik PPPoE username)') }} {{ __('Required') }}
rent / monthly_rent / bill_amount {{ __('Monthly package price (defaults to the customer\'s active package price if left blank)') }} {{ __('Optional') }}
date / summary_date {{ __('Invoice generation date (defaults to current date if missing or invalid)') }} {{ __('Optional') }}
additional_charge / discount / vat / previous_due {{ __('Numerical adjustments to the invoice total (default to 0)') }} {{ __('Optional') }}
{{-- @if($errors->has('duplicates'))
Warning! Some records were duplicates and were not imported.
    @foreach(session('duplicates', []) as $duplicate)
  • SSN: {{ $duplicate['user'] }}
  • @endforeach

Total Skipped Rows: {{ session('skippedRows') }}

@endif --}}
@csrf
{{-- --}}
{{-- @if (isset($data) && !empty($data))

Preview Data

@foreach ($data as $row) @endforeach
First Name Last Name Address City State Zip Country SSN DOB Email Phone Price
{{ $row['first_name'] ?? 'N/A' }} {{ $row['last_name'] ?? 'N/A' }} {{ $row['address'] ?? 'N/A' }} {{ $row['city'] ?? 'N/A' }} {{ $row['state'] ?? 'N/A' }} {{ $row['zip'] ?? 'N/A' }} {{ $row['country'] ?? 'N/A' }} {{ $row['ssn'] ?? 'N/A' }} {{ excelDateToDate($row['dob'] ?? 'N/A') }} {{ $row['email'] ?? 'N/A' }} {{ $row['phone'] ?? 'N/A' }} {{ $row['price'] ?? 'N/A' }}
@elseif(isset($data))

No data found in the file.

@else

Preview Data

First Name Last Name Address City State Zip Country SSN DOB Email Phone Price
@endif --}}
@push('scripts') @endpush