@extends('layouts.master') @section('title', trans('messages.import_invoices')) @section('content')
{{ trans('messages.upload_excel_file') }}
@if(session('success')) @endif @if(session('warning')) @endif @if(session('error')) @endif
@csrf
{{ trans('messages.excel_file_instructions') }} @error('file')
{{ $message }}
@enderror
@if(session('import_errors') && count(session('import_errors')) > 0)
{{ trans('messages.import_errors') }} ({{ count(session('import_errors')) }})
@foreach(session('import_errors') as $error) @endforeach
{{ trans('messages.row') }} {{ trans('messages.invoice_number') }} {{ trans('messages.error') }}
{{ $error['row'] }} {{ $error['name'] }} {{ $error['error'] }}
@endif
{{ trans('messages.required_columns') }}
{{ trans('messages.required') }}:
  • invoice_number - {{ trans('messages.invoice_number') }}
  • customer_id or customer_name - {{ trans('messages.customer') }}
{{ trans('messages.optional') }}:
  • status - {{ trans('messages.status') }} (defaults to 'draft')
  • subtotal - {{ trans('messages.subtotal') }} (defaults to 0)
  • tax - {{ trans('messages.tax') }} (defaults to 0)
  • discount - {{ trans('messages.discount') }} (defaults to 0)
  • total - {{ trans('messages.total') }} (auto-calculated if empty)
  • paid_amount - {{ trans('messages.paid_amount') }} (defaults to 0)
  • notes - {{ trans('messages.notes') }}
{{ trans('messages.note') }}:
• {{ trans('messages.invoice_number') }} must be unique.
• If customer_id is provided, it must exist in the database.
• If customer_name is provided without customer_id, it will be used as walk-in customer.
due_amount is automatically calculated as (total - paid_amount).

{{ trans('messages.download_template') }}
@endsection