File size: 3,482 Bytes
8527a08
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "german-ocr-3/schemas/invoice.json",
  "title": "GermanOCR3 Invoice (Rechnung)",
  "description": "Schema fuer deutsche Rechnungen. Pflichtangaben gemaess UStG § 14 sind beruecksichtigt; nicht erkennbare Felder bleiben null.",
  "type": "object",
  "additionalProperties": false,
  "required": ["document_type", "language", "invoice_number", "invoice_date", "amount_total", "currency"],
  "properties": {
    "document_type": {"const": "invoice"},
    "language": {"type": "string", "default": "de"},

    "invoice_number": {"type": ["string", "null"]},
    "invoice_date": {
      "description": "Rechnungsdatum YYYY-MM-DD",
      "type": ["string", "null"]
    },
    "delivery_date": {
      "description": "Liefer-/Leistungsdatum YYYY-MM-DD",
      "type": ["string", "null"]
    },
    "due_date": {
      "description": "Faelligkeitsdatum YYYY-MM-DD",
      "type": ["string", "null"]
    },

    "sender": {
      "type": ["object", "null"],
      "additionalProperties": false,
      "properties": {
        "name": {"type": ["string", "null"]},
        "address": {"type": ["string", "null"]},
        "email": {"type": ["string", "null"]},
        "phone": {"type": ["string", "null"]},
        "tax_id": {"description": "Steuernummer", "type": ["string", "null"]},
        "vat_id": {"description": "USt-IdNr / VAT ID (DE...)", "type": ["string", "null"]},
        "iban": {"type": ["string", "null"]},
        "bic": {"type": ["string", "null"]},
        "bank": {"type": ["string", "null"]}
      }
    },
    "recipient": {
      "type": ["object", "null"],
      "additionalProperties": false,
      "properties": {
        "name": {"type": ["string", "null"]},
        "address": {"type": ["string", "null"]},
        "customer_id": {"type": ["string", "null"]},
        "vat_id": {"type": ["string", "null"]}
      }
    },

    "line_items": {
      "type": "array",
      "default": [],
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["description", "amount_net"],
        "properties": {
          "position": {"type": ["integer", "null"]},
          "article_number": {"type": ["string", "null"]},
          "description": {"type": "string"},
          "quantity": {"type": ["number", "null"]},
          "unit": {"type": ["string", "null"]},
          "unit_price_net": {"type": ["number", "null"]},
          "amount_net": {"type": ["number", "null"]},
          "vat_rate": {"description": "Prozent, z.B. 19 oder 7", "type": ["number", "null"]}
        }
      }
    },

    "amount_net": {"type": ["number", "null"]},
    "amount_vat": {"type": ["number", "null"]},
    "amount_total": {"type": ["number", "null"]},
    "currency": {
      "type": ["string", "null"],
      "description": "ISO-4217, typisch EUR"
    },

    "vat_breakdown": {
      "type": "array",
      "default": [],
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["rate", "net", "vat"],
        "properties": {
          "rate": {"type": "number"},
          "net": {"type": "number"},
          "vat": {"type": "number"}
        }
      }
    },

    "payment_terms": {"type": ["string", "null"]},
    "notes": {"type": "array", "items": {"type": "string"}, "default": []},
    "raw_text": {"type": ["string", "null"]},
    "confidence": {"type": ["number", "null"], "minimum": 0, "maximum": 1}
  }
}