Automated Exports

Schedule automatic DATEV exports via Magento cron.

Configuration

Configure under: Stores >Configuration > MageB2B > DATEV Export Pro > Automatic Export Settings

The cron job is registered as datev_auto_export and uses the cron expression configured in Cron Schedule.

Screenshot placeholder: Automatic Export Settings group.

Schedule Examples

ScheduleCron Expression
Daily 2AM0 2 * * *
Weekly Monday0 2 * * 1
Monthly 1st0 2 1 * *

Export Settings

Date Range

The module supports these patterns:

  • Yesterday (yesterday only)
  • Last Week (Monday - Sunday) (last complete week)
  • Last Month (Complete Month) (last complete month)
  • Current Week (Monday - Yesterday)
  • Current Month (1st - Yesterday)

What Gets Generated

Depending on the selected format and enabled toggles:

  • CSV: var/export/datev/EXTF_Datev_*.csv
  • XML: var/export/datev/DATEV_XML_*.xml + per-document XML files in var/export/datev/
  • ZIP (when PDFs and/or master data are enabled): var/export/datev/*.zip

Note: The admin UI contains an “Export Path” field. The current exporter writes to var/export/datev/ regardless.

Send To Tax Advisor (Cron)

Cron can send generated DATEV exports by e-mail.

Required settings:

  • Automatic Export Settings >Send to Tax Advisor = enabled
  • Email Settings (DATEV + OSS) >Enable Email Export = enabled
  • Recipient configured in either:
    • Automatic Export Settings >Tax Advisor Email (Cron) (preferred for cron), or
    • Email Settings (DATEV + OSS) >Tax Advisor Email (fallback)

Attachment behavior for cron e-mail:

  • Attach PDF Documents (DATEV only) controls PDF attachment behavior
  • Attach Master Data (DATEV only) controls master-data attachment behavior

CLI Export (Technical Reference)

You can run exports without waiting for cron:

bin/magento datev:export \ --export_type=invoice \ --export_from_date=2026-01-01 \ --export_to_date=2026-01-31 \ --export_format=csv

Supported options:

  • --export_type (required): invoice or creditmemo
  • --export_from_date (required): YYYY-MM-DD
  • --export_to_date (required): YYYY-MM-DD
  • --store_id (optional): limit to one store view
  • --export_format (optional): csv, xml, both (default: csv)
  • --download_documents (flag): include PDFs
  • --export_master_data (flag): include customer master data export

Found an issue with this documentation? Let us know