Codeunit 18006504 EOS020 VAT Mon Plaf Excel Imp

Codeunit 18006504 EOS020 VAT Mon Plaf Excel Imp

Codeunit EOS020 VAT Mon Plaf Excel Imp (ID 18006504).

This codeunit provides functionality to import VAT Monthly Plafond Period data from Excel files. The Excel file structure matches the page “EOS020 VAT Mon. Plaf. Periods” (18006501).

Excel File Structure:

The Excel file must contain the following columns in the first row (headers):

ColumnField NameTypeRequiredDescription
AYearIntegerYesYear for the VAT plafond period (e.g., 2024, 2025)
BMonthIntegerYesMonth number (1-12)
CMonth NameTextNoName of the month (auto-calculated if empty)
DExports of the MonthDecimalNoTotal exports for the month
EExports Last 12 MonthsDecimalNoTotal exports for the last 12 months
FPlafond Usage of the MonthDecimalNoTotal VAT plafond usage for the month
GPlafond Usage Last 12 MonthsDecimalNoTotal VAT plafond usage for the last 12 months
HPlafond Usage ProgressiveDecimalNoProgressive VAT plafond usage
IPlafond Avail Early Next MonthDecimalNoAvailable VAT plafond for early next month
JPlafond Avail Current MonthDecimalNoAvailable VAT plafond for the current month

Import Behavior:

  • The first row must contain headers (column names)
  • Data starts from row 2
  • Year and Month are the primary key fields and are required
  • Existing records with matching Year/Month are updated with new values
  • New records are created for Year/Month combinations that don’t exist
  • Decimal values should use the system’s number format
  • Empty numeric cells are treated as zero
  • The “Month Name” field is automatically calculated based on the Month value if not provided
  • A confirmation dialog is shown before starting the import
  • A summary message displays the number of imported/updated/skipped records

Usage:

Call ImportFromExcel() from a page action to start the import process. The user will be prompted to select an Excel file and confirm the import operation.

Error Handling:

  • Invalid Year or Month values (Year ≤ 0 or Month not in 1-12): row is skipped
  • No data in Excel file (only headers): error is displayed
  • Invalid numeric values: treated as zero without stopping the import

EOS Labs -