ED06 - Documents, DMS, E-Invoice: Organization, Backward/Forward Traceability

Problem

A business owner starts with document filing - and faces the question: How do I file documents in a GoBD-compliant manner, and how do I make them traceable?

Current practice in the SME sector:

Core Message

GoBD-compliant document filing means:

  1. Every document has a unique identity (DocID) - the uuidV7 (Object ID) is already by itself the unique identity of the document, regardless of the filename. Additionally, every document receives a SHA-256 hash as a cryptographic integrity check. The Composite Key V7GUID:uuidV7 is used for filing organization (e.g. by document type) and DB queries (e.g. with EF Core in a vertical application) - not for the identity itself.
  2. Every document has a sidecar - .v7g.md with classification (V7GUID), object identity (uuidV7), taxonomy, obsolescence status, and capture time (in uuidV7 as a 48-bit timestamp). Exception (from 261011): documents that are incorporated into a signing process (digital self-issued document, e.g. meal receipt) carry their sidecar metadata entirely in the *.gcsig.md (integrated source block, schema gcsig-1.4); a separate .v7g.md is omitted — no competing sidecars.
  3. Every journal entry references its document - source_sha256 in the journal record → document
  4. Backward traceability - the journal entry → document → journal record → uuidV7 path can be resolved
  5. Forward traceability - the document → journal entry → general ledger → opening balance sheet path can be resolved
  6. E-invoice: XML is the original document - not the PDF (since 2025, § 14 UStG, EN 16931)

Compliance by Design: Document organization is not created through retrospective sorting, but through mandatory structural fields (SHA-256, V7GUID, sidecar) and pre-commit hooks that check every journal entry for a document reference.

Document Types and Their GoBD-Specific Features

%%{init: {'theme':'base','themeVariables':{'primaryColor':'#FBFAF7','primaryTextColor':'#0F1B33','primaryBorderColor':'#6B7280','lineColor':'#6B7280'}}}%% flowchart TD B["Beleg"] B --> P["Papierbeleg
(Scan erforderlich)"] B --> PDF["PDF-Beleg
(sonstige Rechnung)"] B --> EML["E-Mail
(EML + Anhang)"] B --> XML["E-Rechnung
(XML - Ur-Dokument)"] P --> S["Scan → SHA-256
+ Sidecar"] PDF --> SH["SHA-256
+ Sidecar"] EML --> EM["EML archiviert
+ Anhang extrahiert
+ Sidecar"] XML --> XV["XML unverändert
+ Sidecar
+ Validierung (EN 16931)"] style B fill:#0F1B33,stroke:#0F1B33,color:#FBFAF7 style P fill:#FDBA74,stroke:#C2410C,color:#0F1B33 style PDF fill:#FDBA74,stroke:#C2410C,color:#0F1B33 style EML fill:#FDBA74,stroke:#C2410C,color:#0F1B33 style XML fill:#DBEAFE,stroke:#1D4ED8,color:#0F1B33 style S fill:#D1FAE5,stroke:#0A7F5C,color:#0F1B33 style SH fill:#D1FAE5,stroke:#0A7F5C,color:#0F1B33 style EM fill:#D1FAE5,stroke:#0A7F5C,color:#0F1B33 style XV fill:#D1FAE5,stroke:#0A7F5C,color:#0F1B33
Document type GoBD-specific feature Retention period
Paper document A scan is required (§ 147 Abs. 2 AO); the original may be destroyed if the scan is GoBD-compliant 8 years (§ 147 Abs. 3 AO)
PDF document ("other invoice") No longer an "e-invoice" since 2025; SHA-256 + sidecar; machine-readable? No - PDF is unstructured 8 years
Email (EML + attachment) An email inbox is not an archive; the EML must be archived with the attachment; sender verification 6 years (§ 147 Abs. 1 Nr. 2/3 AO)
E-invoice (XML) XML is the original document (since 2025, § 14 UStG); retain unchanged; EN 16931 validation; machine-readable 8 years

Important - E-invoices since 2025: Since 1 January 2025, e-invoices have been mandatory for B2B transactions between domestic companies (§ 14 UStG). A simple PDF is no longer an e-invoice - it is an "other invoice." An e-invoice exists only if it is issued, transmitted and received in a structured electronic format (XML, EN 16931). See ED01 "E-invoice: XML Formats Are Original Documents in the AO".

Document Classification in the Git Repository

Directory Structure

ORG-1/sources/                    # Belegarchiv (Tenant: ORG-1)
├── eingangsrechnungen/           # Eingangsrechnungen (Lieferanten)
│   ├── 260815/                   # Nach Datum (YYMMDD)
│   │   ├── rechnung_001.xml      # E-Rechnung (XRechnung)
│   │   ├── rechnung_001.xml.v7g.md  # Sidecar
│   │   └── rechnung_002.pdf      # Sonstige Rechnung (PDF)
│   │   └── rechnung_002.pdf.v7g.md  # Sidecar
├── ausgangsrechnungen/           # Ausgangsrechnungen (Kunden)
├── lohnbelege/                   # Lohnabrechnungen
├── sv-bescheide/                 # SV-Bescheide, VBG-Bescheide
├── vertraege/                    # Verträge (periodenübergreifend)
├── korrespondenz/                # E-Mails, Briefe
└── sonstige/                     # Sonstige Belege

Sidecar per Document (Mandatory)

Every document receives a .v7g.md sidecar with the Composite Key V7GUID:uuidV7:

{
  "$schema": "https://gitcover.org/schemas/v7g-sidecar-1.0.schema.json",
  "V7GUID": "<V7GUID-Class-aus-Registry>",
  "docUid": "019f2c6f-0900-7001-8000-000000000001",
  "sha256": "ab94670c0dd8499c27ef2feddd1d9c5925977d55a52150a6fca0f6567d2e5e79",
  "title": "260815_Rechnung_001.xml",
  "original_filename": "Rechnung_001.xml",
  "locations": [
    {
      "unc_path": "./ORG-1/sources/eingangsrechnungen/260815/rechnung_001.xml",
      "from": "260815",
      "to": null,
      "note": "Primärspeicherort"
    }
  ],
  "v7g_taxonomy": [
    {
      "v7guid": "019f2c6f-0900-7000-8000-000000000000",
      "taxonomy": "ORG-1/Eingangsrechnung",
      "valid_from": "260815",
      "valid_to": null,
      "note": "Tenant: ORG-1, Category: Eingangsrechnung, Sphäre: wirtschaftlich"
    }
  ],
  "gcpn": {
    "prima_nota_ref": "GB-2026-08-001",
    "journal_entry_ref": "J-2026-08-001"
  },
  "obsolescence": {
    "status": "active",
    "superseded_by": null,
    "superseded_at": null
  }
}

Composite Key V7GUID:uuidV7 - Filing Organization and Query:

  • uuidV7 (Object ID) - is already by itself the unique identity (DocID) of the document, generated with a specified timestamp, with the 48-bit timestamp embedded in the GUID
  • V7GUID (Class) - classifies the document type from the .gitcover registry (document type, filing organization, DB query in a vertical application with EF Core)
  • v7g_taxonomy[].v7guid - Object ID of the classified document
  • gcpn.prima_nota_ref / journal_entry_ref - cross-reference to the general ledger/journal (forward traceability)
  • The Composite Key V7GUID:uuidV7 is used for filing organization and query - the identity of the document is the uuidV7 alone
  • No separate datetime field - the time is contained in uuidV7

Backward and Forward Traceability

%%{init: {'theme':'base','themeVariables':{'primaryColor':'#FBFAF7','primaryTextColor':'#0F1B33','primaryBorderColor':'#6B7280','lineColor':'#6B7280'}}}%% flowchart LR subgraph RET["Retrograd (Prüfer vom Buchungssatz rückwärts)"] direction LR BS["Buchungssatz
SKR04 6000 an 1600"] BS --> SR["source_sha256
im Tagebucheintrag"] SR --> BE["Beleg
(SHA-256 match)"] BE --> SC["Sidecar .v7g.md
V7GUID:uuidV7"] SC --> DE["Tagebucheintrag
uuidV7"] end subgraph PRO["Progressiv (Prüfer vom Beleg vorwärts)"] direction LR BE2["Beleg
(SHA-256)"] BE2 --> SC2["Sidecar .v7g.md
gcpn.journal_entry_ref"] SC2 --> BS2["Buchungssatz
SKR04"] BS2 --> GB["Grundbuch
(JSON)"] GB --> EB["Eröffnungsbilanz"] end style BS fill:#DBEAFE,stroke:#1D4ED8,color:#0F1B33 style SR fill:#DBEAFE,stroke:#1D4ED8,color:#0F1B33 style BE fill:#FDBA74,stroke:#C2410C,color:#0F1B33 style SC fill:#D1FAE5,stroke:#0A7F5C,color:#0F1B33 style DE fill:#0F1B33,stroke:#0F1B33,color:#FBFAF7 style BE2 fill:#FDBA74,stroke:#C2410C,color:#0F1B33 style SC2 fill:#D1FAE5,stroke:#0A7F5C,color:#0F1B33 style BS2 fill:#DBEAFE,stroke:#1D4ED8,color:#0F1B33 style GB fill:#DBEAFE,stroke:#1D4ED8,color:#0F1B33 style EB fill:#D1FAE5,stroke:#0A7F5C,color:#0F1B33
Direction Starting point Resolution via Target GoBD reference
Backward Journal entry (SKR04) source_sha256 → document → sidecar uuidV7 Journal record Rz. 146 (traceability)
Forward Document (SHA-256) Sidecar gcpn.journal_entry_ref → journal entry → general ledger Opening balance sheet Rz. 147 (verifiability)

GoBD reference: Backward traceability corresponds to GoBD Rz. 146 (traceability - "qualified third party within a reasonable period of time"). Forward traceability corresponds to GoBD Rz. 147 (verifiability). Both are guaranteed by design through SHA-256 + V7GUID + sidecar - not through manual cross-references.

E-Invoice: XML Is the Original Document

%%{init: {'theme':'base','themeVariables':{'primaryColor':'#FBFAF7','primaryTextColor':'#0F1B33','primaryBorderColor':'#6B7280','lineColor':'#6B7280'}}}%% flowchart TD ER["E-Rechnung empfangen
(XML oder ZUGFeRD)"] ER --> V["Validierung
EN 16931 / XRechnung-Schema"] V -->|gültig| A["Ablage im Git-Repo
XML unverändert"] V -->|ungültig| R["Fehler-Logging
+ manuelle Prüfung"] A --> S["Sidecar .v7g.md
SHA-256 + V7GUID:uuidV7"] S --> B["Buchungssatz
source_sha256 → XML"] B --> N["Nachverfolgbarkeit
retrograd + progressiv"] style ER fill:#0F1B33,stroke:#0F1B33,color:#FBFAF7 style V fill:#DBEAFE,stroke:#1D4ED8,color:#0F1B33 style A fill:#D1FAE5,stroke:#0A7F5C,color:#0F1B33 style R fill:#FDBA74,stroke:#C2410C,color:#0F1B33 style S fill:#D1FAE5,stroke:#0A7F5C,color:#0F1B33 style B fill:#DBEAFE,stroke:#1D4ED8,color:#0F1B33 style N fill:#D1FAE5,stroke:#0A7F5C,color:#0F1B33

XRechnung vs. ZUGFeRD

Format Structure Original document Visualization
XRechnung Pure XML (EN 16931) XML file XML viewer required (e.g. ELSTER (e-rechnung.elster.de)[https://e-rechnung.elster.de]
ZUGFeRD Hybrid: PDF + embedded XML XML part (authoritative since 2025, BMF FAQ 12a) PDF image (display aid only)

Important - ZUGFeRD since 2025: In the event of discrepancies between the XML part and the PDF image part, the structured (XML) part is authoritative since 2025 (BMF FAQ question 12a). The PDF image no longer takes precedence. The sidecar must reference the XML as the original document, not the PDF.

Pre-Commit Hook for E-Invoices

The pre-commit hook checks e-invoices for the following:

Check Error if
XML file has a valid XRechnung/ZUGFeRD structure Invalid XML structure
Sidecar .v7g.md present Missing sidecar
sha256 in the sidecar matches the XML file Hash mismatch (file modified)
v7g_taxonomy classifies it as an e-invoice Missing classification
No datetime/date field in the sidecar (time in uuidV7) Redundant field

Email Archiving

Emails are commercial or business letters within the meaning of § 147 Abs. 1 Nr. 2/3 AO and must therefore be retained for 6 years. Many business owners do not archive emails - that is a GoBD violation.

%%{init: {'theme':'base','themeVariables':{'primaryColor':'#FBFAF7','primaryTextColor':'#0F1B33','primaryBorderColor':'#6B7280','lineColor':'#6B7280'}}}%% flowchart LR EM["E-Mail empfangen
(EML/MBOX)"] EM --> EX["Anhang extrahiert
(PDF, XML)"] EM --> AR["EML archiviert
(unverändert)"] EX --> SH["SHA-256 pro Anhang"] AR --> SH2["SHA-256 der EML"] SH --> SC["Sidecar .v7g.md
pro Beleg"] SH2 --> SC2["Sidecar .v7g.md
für E-Mail"] style EM fill:#0F1B33,stroke:#0F1B33,color:#FBFAF7 style EX fill:#DBEAFE,stroke:#1D4ED8,color:#0F1B33 style AR fill:#DBEAFE,stroke:#1D4ED8,color:#0F1B33 style SH fill:#FDBA74,stroke:#C2410C,color:#0F1B33 style SH2 fill:#FDBA74,stroke:#C2410C,color:#0F1B33 style SC fill:#D1FAE5,stroke:#0A7F5C,color:#0F1B33 style SC2 fill:#D1FAE5,stroke:#0A7F5C,color:#0F1B33
Step Action GoBD reference
Receive email Save the EML file unchanged § 147 Abs. 1 Nr. 2 AO (received commercial letters)
Extract attachment Store the PDF/XML attachment separately + SHA-256 Machine readability (§ 147 Abs. 6 AO)
Sidecar per document .v7g.md for the EML and for each attachment Traceability (Rz. 146)
Sender verification DKIM/SPF headers documented in the sidecar Evidentiary value of the email

Practical tip: A Git repository can archive emails (EML/MBOX) and attachments (PDF, XML) in parallel - with clear separation by document type in the sidecar (v7g_taxonomy). The pre-commit hook checks that each EML has a sidecar and that each attachment is classified separately.

Document Completeness (Pre-Commit Hook)

%%{init: {'theme':'base','themeVariables':{'primaryColor':'#FBFAF7','primaryTextColor':'#0F1B33','primaryBorderColor':'#6B7280','lineColor':'#6B7280'}}}%% flowchart TD C["Commit mit Buchungssatz"] C --> H["Pre-Commit-Hook"] H --> P1{"source_sha256
vorhanden?"} P1 -->|nein| R1["Commit abgelehnt
Belegreferenz fehlt"] P1 -->|ja| P2{"Beleg existiert
im Repo?"} P2 -->|nein| R2["Commit abgelehnt
Beleg nicht gefunden"] P2 -->|ja| P3{"Sidecar .v7g.md
vorhanden?"} P3 -->|nein| R3["Commit abgelehnt
Sidecar fehlt"] P3 -->|ja| P4{"SHA-256 match?"} P4 -->|nein| R4["Commit abgelehnt
Beleg verändert"] P4 -->|ja| OK["Commit akzeptiert
Beleg-Vollständigkeit OK"] style C fill:#0F1B33,stroke:#0F1B33,color:#FBFAF7 style H fill:#DBEAFE,stroke:#1D4ED8,color:#0F1B33 style P1 fill:#DBEAFE,stroke:#1D4ED8,color:#0F1B33 style P2 fill:#DBEAFE,stroke:#1D4ED8,color:#0F1B33 style P3 fill:#DBEAFE,stroke:#1D4ED8,color:#0F1B33 style P4 fill:#DBEAFE,stroke:#1D4ED8,color:#0F1B33 style R1 fill:#FDBA74,stroke:#C2410C,color:#0F1B33 style R2 fill:#FDBA74,stroke:#C2410C,color:#0F1B33 style R3 fill:#FDBA74,stroke:#C2410C,color:#0F1B33 style R4 fill:#FDBA74,stroke:#C2410C,color:#0F1B33 style OK fill:#D1FAE5,stroke:#0A7F5C,color:#0F1B33
Check Error if GoBD reference
source_sha256 present Missing document reference Rz. 146 (traceability)
Document exists in the repository Document not archived § 147 Abs. 1 Nr. 4 AO (booking document)
Sidecar present Missing classification Rz. 146 (traceability)
SHA-256 matches Document modified after the fact Rz. 146 (immutability)

Risk Leverage

Today (cheap) Tomorrow (audit-proof) Risk mitigated
SHA-256 per document Unique document ID, independent of the filename Contestation of the document's authenticity
Sidecar with composite key V7GUID:uuidV7 Classification action is traceable Contestation of the classification
source_sha256 per journal entry Backward traceability Contestation of the document assignment
gcpn.journal_entry_ref in the sidecar Forward traceability Contestation of the posting
E-invoice XML unchanged + sidecar § 14b UStG compliant (integrity) Non-deductibility of input tax
Email EML archived + sidecar § 147 Abs. 1 Nr. 2 AO compliant Loss of evidence in a dispute with the authorities
Pre-commit hook checks document completeness No journal entry without a document GoBD violation "incomplete"

Harness Requirement (Preview)

Derivable from ED06:

ID Requirement Priority
FA-2.1 SHA-256 as document ID MUST
FA-2.2 Sidecar per document — *.v7g.md or (for signed documents/self-issued documents) integrated into *.gcsig.md MUST
FA-2.3 Sidecar with composite key V7GUID:uuidV7 MUST
FA-2.8 DMS functionality: document classification MUST
FA-2.9 E-invoice integration: XRechnung/ZUGFeRD import, validation SHOULD
FA-2.10 Email archiving: EML + SHA-256 + sidecar MUST
FA-2.11 GoBD organization: index per fiscal year MUST
FA-2.12 Backward traceability MUST
FA-2.13 Forward traceability MUST
FA-2.14 Pre-commit hook: check document completeness MUST
FA-2.15 Scan workflow: paper → scan → SHA-256 → sidecar SHOULD

The complete requirements list is in Harness-Anforderungen.md.

Sources

Role Location Purpose
Primary / SSoT git.gitcover.org/GCC Canonical repository (GPG-signed, versioned)
Public OSS Mirror / CDN codeberg.org/gitcover-commons Read-only mirror; FLOSS discovery
Community Hub github.com/gitcover-commons Issues & Discussions; source code reference on Codeberg

Note: This mapping of sources, mirror and community hub reflects the current state and may change. Please check the respective canonical source on gitcover.org for the current status.