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
| Schedule | Cron Expression |
|---|---|
| Daily 2AM | 0 2 * * * |
| Weekly Monday | 0 2 * * 1 |
| Monthly 1st | 0 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 invar/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= enabledEmail Settings (DATEV + OSS) >Enable Email Export= enabled- Recipient configured in either:
Automatic Export Settings >Tax Advisor Email (Cron)(preferred for cron), orEmail Settings (DATEV + OSS) >Tax Advisor Email(fallback)
Attachment behavior for cron e-mail:
Attach PDF Documents (DATEV only)controls PDF attachment behaviorAttach 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=csvSupported options:
--export_type(required):invoiceorcreditmemo--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
