Import Modes

Choose the right import strategy based on your Excel file structure for optimal data processing.

Understanding Import Modes

Import modes define how InvoisX processes your Excel file structure. Choosing the correct mode ensures accurate data extraction and proper invoice generation.

Available Import Modes

Standard (Header + Lines)

Best for: Excel files with separate header and line item sheets

When to Use

  • Your Excel has multiple sheets
  • One sheet contains invoice header information
  • Another sheet contains line item details
  • Headers and lines are linked by Invoice ID

Excel Structure Example

Sheet 1: "Invoice_Headers"
Invoice_ID | Customer_Name | Issue_Date | Total_Amount
INV001     | ABC Corp      | 2024-01-15 | 1060.00
INV002     | XYZ Ltd       | 2024-01-16 | 2120.00

Sheet 2: "Invoice_Lines"
Invoice_ID | Product      | Quantity | Unit_Price | Amount
INV001     | Product A    | 5        | 100.00     | 500.00
INV001     | Product B    | 10       | 50.00      | 500.00
INV002     | Product C    | 20       | 100.00     | 2000.00

Configuration Requirements

  • Header Sheet: Map to invoice-level fields (customer, dates, totals)
  • Lines Sheet: Map to line-item fields (products, quantities, amounts)
  • Linking Field: Both sheets must have Invoice ID for proper linking
  • Calculations: System calculates missing totals if data is provided

Mixed (Single Sheet)

Best for: All invoice data in one Excel sheet

When to Use

  • Your Excel has all data in a single sheet
  • Each row contains both header and line information
  • Header data is repeated for each line item
  • Common in accounting system exports

Excel Structure Example

Invoice_ID | Customer_Name | Issue_Date | Product   | Quantity | Unit_Price | Line_Amount
INV001     | ABC Corp      | 2024-01-15 | Product A | 5        | 100.00     | 500.00
INV001     | ABC Corp      | 2024-01-15 | Product B | 10       | 50.00      | 500.00
INV002     | XYZ Ltd       | 2024-01-16 | Product C | 20       | 100.00     | 2000.00

Processing Logic

  • Groups rows by Invoice ID
  • Extracts header data from first occurrence
  • Processes each row as a line item
  • Validates data consistency across grouped rows

Lines Only

Best for: Excel files containing only line item data

When to Use

  • Your Excel contains product/service details only
  • Header information will be generated automatically
  • Common for inventory-based invoicing
  • Suitable for bulk product imports

Excel Structure Example

Product_Code | Description | Quantity | Unit_Price | Customer_Code
PROD001      | Product A   | 5        | 100.00     | CUST001
PROD002      | Product B   | 10       | 50.00      | CUST001
PROD003      | Product C   | 20       | 100.00     | CUST002

Requirements

  • Use Fixed Defaults for header information
  • Use Conditional Defaults for customer-specific data
  • System generates Invoice IDs automatically
  • Line items are grouped by customer or other criteria

Choosing the Right Mode

Decision Matrix

Excel Structure Recommended Mode Key Benefits
Multiple sheets with headers/lines Standard Preserves original structure, accurate linking
Single sheet with repeated headers Mixed Handles duplicated data efficiently
Product catalog or inventory list Lines Only Focuses on line items, auto-generates headers
Accounting system export Standard or Mixed Depends on export format
E-commerce order export Mixed Handles order + item data together
Service billing export Mixed or Lines Only Depends on header complexity

Evaluation Questions

Ask yourself these questions to choose the right mode:

  1. How many sheets does my Excel file have?

    • One sheet → Mixed or Lines Only
    • Multiple sheets → Standard
  2. Is header information repeated for each line?

    • Yes → Mixed
    • No → Standard
  3. Do I have complete header information?

    • Yes → Standard or Mixed
    • No/Minimal → Lines Only
  4. How complex is my header data?

    • Complex (customer details, terms) → Standard or Mixed
    • Simple (just totals) → Any mode
    • Minimal/Missing → Lines Only

Mode-Specific Features

Standard Mode Features

  • Sheet Type Configuration: Assign header/lines designation to each sheet
  • Advanced Linking: Sophisticated Invoice ID matching
  • Calculation Control: Only calculates missing fields, preserves user data
  • Data Integrity: Validates consistency between header and line totals

Mixed Mode Features

  • Row Grouping: Intelligent grouping by Invoice ID
  • Header Extraction: Takes header data from first occurrence per group
  • Duplicate Handling: Manages repeated header information efficiently
  • Flexible Mapping: Single mapping configuration for all data

Lines Only Features

  • Auto-Generation: Creates invoice headers automatically
  • Default Integration: Heavy reliance on fixed and conditional defaults
  • Grouping Logic: Groups lines by customer or other criteria
  • Minimal Configuration: Focuses on line item mapping only

Advanced Configuration

Custom Strategy Selection

InvoisX automatically selects the appropriate processing strategy based on:

  • Your chosen import mode
  • Template configuration
  • Excel file structure
  • Mapping completeness

Strategy Types

  • StandardTemplateStrategy: For system-provided templates
  • CustomStandardTemplateStrategy: For user-created standard mode templates
  • MixedModeStrategy: For single-sheet custom templates

Validation Modes

Each import mode supports different validation levels:

Strict Validation

  • Enforces all LHDN requirements
  • Validates business rules strictly
  • Recommended for production use
  • May reject incomplete data

Relaxed Validation

  • More lenient rule enforcement
  • Allows minor data inconsistencies
  • Useful for testing and development
  • Provides warnings instead of errors

Best Practices by Mode

Standard Mode Best Practices

  1. Consistent Sheet Naming: Use descriptive, consistent sheet names
  2. Complete Linking: Ensure all line items have matching header records
  3. Data Validation: Verify totals match between sheets before import
  4. Field Completeness: Map all essential fields in both sheets

Mixed Mode Best Practices

  1. Consistent Headers: Ensure header data is identical across rows for same invoice
  2. Clean Grouping: Remove empty rows that might break grouping logic
  3. Complete Line Data: Each row should have complete line item information
  4. Proper Sorting: Sort by Invoice ID for better processing performance

Lines Only Best Practices

  1. Comprehensive Defaults: Set up extensive fixed and conditional defaults
  2. Customer Identification: Include customer codes or identifiers for grouping
  3. Complete Line Data: Ensure all line-level required fields are present
  4. Logical Grouping: Use consistent grouping criteria (customer, date, etc.)

Troubleshooting by Mode

Standard Mode Issues

  • Linking Failures: Check Invoice ID consistency between sheets
  • Missing Totals: Verify calculation settings and data completeness
  • Sheet Detection: Ensure proper sheet type assignment

Mixed Mode Issues

  • Grouping Problems: Check Invoice ID consistency within groups
  • Header Conflicts: Resolve conflicting header data within same invoice
  • Performance: Large files may process slowly due to grouping complexity

Lines Only Issues

  • Missing Headers: Verify default value configuration
  • Grouping Logic: Check customer identification and grouping criteria
  • Incomplete Invoices: Ensure line items provide sufficient information

Migration Between Modes

When to Change Modes

  • Excel file structure changes
  • Business process evolution
  • Data quality improvements
  • Performance optimization needs

Migration Process

  1. Backup Current Template: Save working configuration
  2. Change Import Mode: Update mode in template settings
  3. Reconfigure Mappings: Adjust mappings for new mode
  4. Update Defaults: Modify default values as needed
  5. Test Thoroughly: Validate with sample data before production use

Performance Considerations

Processing Speed by Mode

  • Lines Only: Fastest processing (simple structure)
  • Mixed: Moderate speed (grouping overhead)
  • Standard: Varied speed (depends on file size and complexity)

Memory Usage

  • Lines Only: Lowest memory usage
  • Mixed: Moderate memory usage (grouping requires buffering)
  • Standard: Depends on sheet sizes and relationships

Optimization Tips

  1. Clean Data: Remove unnecessary rows and columns
  2. Consistent Formatting: Use consistent data types throughout
  3. Proper Indexing: Ensure Invoice IDs are properly formatted
  4. Reasonable File Sizes: Split very large files for better performance

Next Steps

After choosing your import mode:

  1. Configure your template according to mode requirements
  2. Set up appropriate column mappings
  3. Configure code mappings and default values
  4. Test with sample data to verify correct processing