Keyven commited on
Commit
8527a08
·
verified ·
1 Parent(s): 3657fe1

Upload schemas/invoice.json with huggingface_hub

Browse files
Files changed (1) hide show
  1. schemas/invoice.json +101 -0
schemas/invoice.json ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "german-ocr-3/schemas/invoice.json",
4
+ "title": "GermanOCR3 Invoice (Rechnung)",
5
+ "description": "Schema fuer deutsche Rechnungen. Pflichtangaben gemaess UStG § 14 sind beruecksichtigt; nicht erkennbare Felder bleiben null.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["document_type", "language", "invoice_number", "invoice_date", "amount_total", "currency"],
9
+ "properties": {
10
+ "document_type": {"const": "invoice"},
11
+ "language": {"type": "string", "default": "de"},
12
+
13
+ "invoice_number": {"type": ["string", "null"]},
14
+ "invoice_date": {
15
+ "description": "Rechnungsdatum YYYY-MM-DD",
16
+ "type": ["string", "null"]
17
+ },
18
+ "delivery_date": {
19
+ "description": "Liefer-/Leistungsdatum YYYY-MM-DD",
20
+ "type": ["string", "null"]
21
+ },
22
+ "due_date": {
23
+ "description": "Faelligkeitsdatum YYYY-MM-DD",
24
+ "type": ["string", "null"]
25
+ },
26
+
27
+ "sender": {
28
+ "type": ["object", "null"],
29
+ "additionalProperties": false,
30
+ "properties": {
31
+ "name": {"type": ["string", "null"]},
32
+ "address": {"type": ["string", "null"]},
33
+ "email": {"type": ["string", "null"]},
34
+ "phone": {"type": ["string", "null"]},
35
+ "tax_id": {"description": "Steuernummer", "type": ["string", "null"]},
36
+ "vat_id": {"description": "USt-IdNr / VAT ID (DE...)", "type": ["string", "null"]},
37
+ "iban": {"type": ["string", "null"]},
38
+ "bic": {"type": ["string", "null"]},
39
+ "bank": {"type": ["string", "null"]}
40
+ }
41
+ },
42
+ "recipient": {
43
+ "type": ["object", "null"],
44
+ "additionalProperties": false,
45
+ "properties": {
46
+ "name": {"type": ["string", "null"]},
47
+ "address": {"type": ["string", "null"]},
48
+ "customer_id": {"type": ["string", "null"]},
49
+ "vat_id": {"type": ["string", "null"]}
50
+ }
51
+ },
52
+
53
+ "line_items": {
54
+ "type": "array",
55
+ "default": [],
56
+ "items": {
57
+ "type": "object",
58
+ "additionalProperties": false,
59
+ "required": ["description", "amount_net"],
60
+ "properties": {
61
+ "position": {"type": ["integer", "null"]},
62
+ "article_number": {"type": ["string", "null"]},
63
+ "description": {"type": "string"},
64
+ "quantity": {"type": ["number", "null"]},
65
+ "unit": {"type": ["string", "null"]},
66
+ "unit_price_net": {"type": ["number", "null"]},
67
+ "amount_net": {"type": ["number", "null"]},
68
+ "vat_rate": {"description": "Prozent, z.B. 19 oder 7", "type": ["number", "null"]}
69
+ }
70
+ }
71
+ },
72
+
73
+ "amount_net": {"type": ["number", "null"]},
74
+ "amount_vat": {"type": ["number", "null"]},
75
+ "amount_total": {"type": ["number", "null"]},
76
+ "currency": {
77
+ "type": ["string", "null"],
78
+ "description": "ISO-4217, typisch EUR"
79
+ },
80
+
81
+ "vat_breakdown": {
82
+ "type": "array",
83
+ "default": [],
84
+ "items": {
85
+ "type": "object",
86
+ "additionalProperties": false,
87
+ "required": ["rate", "net", "vat"],
88
+ "properties": {
89
+ "rate": {"type": "number"},
90
+ "net": {"type": "number"},
91
+ "vat": {"type": "number"}
92
+ }
93
+ }
94
+ },
95
+
96
+ "payment_terms": {"type": ["string", "null"]},
97
+ "notes": {"type": "array", "items": {"type": "string"}, "default": []},
98
+ "raw_text": {"type": ["string", "null"]},
99
+ "confidence": {"type": ["number", "null"], "minimum": 0, "maximum": 1}
100
+ }
101
+ }