Use DATEV mapping functions

Mapping functions contain business logic that would be awkward to repeat in JSON. Call them with the function: prefix.

The extension registers three functions:

Function Result
function:getRevenueAccount Account number from the configured domestic, EU, or third-country revenue mapping
function:getTaxRate Tax rate from the same matching revenue row
function:getEuCountryAndVatId Combined EU country and VAT ID value for the document's order

Example:

{
  "Gegenkonto (ohne BU-Schlüssel)": "function:getRevenueAccount",
  "EU-Land u. UStID": "function:getEuCountryAndVatId",
  "EU-Steuersatz": "function:getTaxRate"
}

getRevenueAccount and getTaxRate depend on Revenue Account Mapping. If the result is unexpected, check the destination country, Magento's EU country list, and the matching configuration row.

Use Validate Mapping after changing a function call. An unknown or misspelled function stops the export.

Project-specific functions

A Magento developer can register another function provider for project-specific logic. Keep that code in a separate integration module. Document its input and output, add tests for each accounting case, and validate the final export with the receiving team.