Skip to main content

Accounting and DATEV

billing:datev:export writes a period of issued invoices as a DATEV EXTF "Buchungsstapel" (the booking batch a German tax advisor imports). With no --from/--to it exports the previous calendar month, so a monthly cron hands last month's bookings to the Steuerberater:

php artisan billing:datev:export # a period of invoices as a DATEV EXTF booking batch (defaults to last month)

The account numbers come from config('billing.datev') and must be confirmed with the advisor — left unset the file is structurally valid with blank account fields. Each business transaction resolves to the account that carries its own tax logic through a DatevAccountResolver, so a fan-revenue rate, an OSS country or a §13b input each land on their own account rather than one revenue account for everything. With no chart selected the export is the single-seller revenue account, byte-for-byte unchanged.

From the admin console, without a shell

The same batch is downloadable from the admin console, for whoever holds the billing.admin.ability Gate. Pick a period, get the file. It is the same assembly the command runs, deliberately: this export has twice shipped a batch that was structurally valid, imported cleanly, and was missing an entire category of bookings, so a second implementation is the one thing not on offer.

Two things behave differently from a download you might expect:

  • Nothing is written to the server. The file is streamed straight to the browser. A booking batch is your complete revenue history for the period in one file, and a copy left in storage is a second place it has to be protected, retained and erased from.
  • A refusal downloads nothing at all. Where the writer refuses — a document reference the format cannot carry, a period spanning two posting months — the screen shows you which, and no partial file is produced. That asymmetry is the point: the import does not argue, so a truncated batch surfaces months later as a reconciliation that does not close, with nothing to point at.

The EXTF header's field 21 (Festschreibekennzeichen) is emitted as 1, marking each booking batch as locked against alteration after import, as GoBD requires. A correction is booked as a Haben (credit) against the invoice it corrects; see Invoices and e-invoicing for the document side.


← Back to the documentation index