{
  "name": "Buchungsliste als CSV für Steuerbüro, DATEV oder Lexware Office vorbereiten",
  "nodes": [
    {
      "parameters": {
        "content": "## Buchungsliste als CSV für Steuerbüro, DATEV oder Lexware Office vorbereiten\n\n**Zweck:** Liest am 2. jedes Monats die Belege des Vormonats aus einer Tabelle, bringt Datum und Beträge ins deutsche Format, erzeugt eine CSV mit Semikolon und schickt sie per Mail an dich oder dein Steuerbüro.\n\n**Zugangsdaten (Credentials):**\n- Google Sheets: Google OAuth2\n- E-Mail senden: SMTP-Zugang\n\n**Anpassen:**\n- Tabellen-URL und Blatt „Belege“ (Spalten Datum JJJJ-MM-TT, Belegnummer, Text, Betrag, Konto, Gegenkonto)\n- Spaltennamen in „Spalten zuordnen“ an das Importformat des Zielsystems anpassen\n- Kein offizielles DATEV-Format (EXTF); Import mit dem Steuerbüro abstimmen\n\nValidiert am 09.11.2026 gegen das n8n-Node-Schema, nicht in Produktion ausgeführt.\nQuelle: automationskompass.de/n8n-templates/",
        "height": 520,
        "width": 420,
        "color": 7
      },
      "id": "f4f735d4-f44a-49b9-a515-5ecc9c7b82d5",
      "name": "Notiz",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -520,
        120
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "months",
              "triggerAtDayOfMonth": 2,
              "triggerAtHour": 8
            }
          ]
        }
      },
      "id": "4dda8d08-48c7-43a4-805b-69b491bea60f",
      "name": "Monatlich am 2.",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        0,
        300
      ]
    },
    {
      "parameters": {
        "operation": "read",
        "documentId": {
          "__rl": true,
          "value": "https://docs.google.com/spreadsheets/d/DEINE-TABELLEN-ID/edit",
          "mode": "url"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Belege"
        },
        "options": {}
      },
      "id": "ca392696-7de2-49d0-bc65-98fd890a8915",
      "name": "Belege lesen",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose",
            "version": 2
          },
          "conditions": [
            {
              "id": "e9af135c-dcc9-4906-88ba-1791144a5831",
              "leftValue": "={{ String($json.Datum).slice(0, 7) }}",
              "rightValue": "={{ $now.minus({ months: 1 }).toFormat('yyyy-MM') }}",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "10c3b1a7-9e08-45dc-b709-7edbcce9941f",
      "name": "Nur Vormonat",
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.3,
      "position": [
        480,
        300
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "8ba9c257-729f-47bb-815b-40d8b80fff5c",
              "name": "Belegdatum",
              "value": "={{ DateTime.fromISO(String($json.Datum)).toFormat('dd.MM.yyyy') }}",
              "type": "string"
            },
            {
              "id": "6a51de9f-e831-4e2c-b4be-a86310b35b55",
              "name": "Belegnummer",
              "value": "={{ $json.Belegnummer }}",
              "type": "string"
            },
            {
              "id": "69a3eef9-7791-4925-9468-6ef286803a8c",
              "name": "Buchungstext",
              "value": "={{ String($json.Text).slice(0, 60) }}",
              "type": "string"
            },
            {
              "id": "c55040c9-607e-4cd1-8e9f-dafb6312fe53",
              "name": "Betrag",
              "value": "={{ Number($json.Betrag).toFixed(2).replace(\".\", \",\") }}",
              "type": "string"
            },
            {
              "id": "a032cc81-7662-4f3a-a809-e53ea2981ac1",
              "name": "Konto",
              "value": "={{ $json.Konto }}",
              "type": "string"
            },
            {
              "id": "8382d306-80c4-48aa-9189-2ba1ee585dde",
              "name": "Gegenkonto",
              "value": "={{ $json.Gegenkonto }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "34288f8f-b5d1-4117-bbe7-52af20bf11c0",
      "name": "Spalten zuordnen",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        720,
        300
      ]
    },
    {
      "parameters": {
        "operation": "csv",
        "binaryPropertyName": "data",
        "options": {
          "fileName": "=buchungen-{{ $now.minus({ months: 1 }).toFormat('yyyy-MM') }}.csv",
          "delimiter": ";"
        }
      },
      "id": "caba1a53-3fb9-4a17-9ea0-b33b8a6a2719",
      "name": "CSV erzeugen",
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        960,
        300
      ]
    },
    {
      "parameters": {
        "fromEmail": "buchhaltung@deine-firma.de",
        "toEmail": "buchhaltung@deine-firma.de",
        "subject": "=Buchungsliste {{ $now.minus({ months: 1 }).toFormat('MM/yyyy') }}",
        "emailFormat": "text",
        "text": "=Im Anhang die Buchungsliste des Vormonats als CSV (Trennzeichen Semikolon).",
        "options": {
          "appendAttribution": false,
          "attachments": "data"
        }
      },
      "id": "f9f4b9b4-bbb1-457a-85a7-9c5b781f4ef8",
      "name": "An Steuerbüro senden",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        1200,
        300
      ]
    }
  ],
  "connections": {
    "Monatlich am 2.": {
      "main": [
        [
          {
            "node": "Belege lesen",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Belege lesen": {
      "main": [
        [
          {
            "node": "Nur Vormonat",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Nur Vormonat": {
      "main": [
        [
          {
            "node": "Spalten zuordnen",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Spalten zuordnen": {
      "main": [
        [
          {
            "node": "CSV erzeugen",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CSV erzeugen": {
      "main": [
        [
          {
            "node": "An Steuerbüro senden",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1",
    "timezone": "Europe/Berlin"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  }
}
