pyslog 0.1.0.dev5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyslog/__init__.py +0 -0
- pyslog/eslog2/__init__.py +0 -0
- pyslog/eslog2/generator.py +495 -0
- pyslog/eslog2/models/__init__.py +18 -0
- pyslog/eslog2/models/_xml.py +250 -0
- pyslog/eslog2/models/enums/__init__.py +11 -0
- pyslog/eslog2/models/enums/business_process_type.py +20 -0
- pyslog/eslog2/models/enums/item_identification_scheme.py +6 -0
- pyslog/eslog2/models/enums/vat_category_code.py +27 -0
- pyslog/eslog2/models/enums/vat_point_date_code.py +7 -0
- pyslog/eslog2/models/invoice.py +99 -0
- pyslog/eslog2/schemas/eSLOG20_INVOIC_v200.xsd +2086 -0
- pyslog/eslog2/validator.py +16 -0
- pyslog-0.1.0.dev5.dist-info/METADATA +137 -0
- pyslog-0.1.0.dev5.dist-info/RECORD +16 -0
- pyslog-0.1.0.dev5.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
from pydantic_xml import BaseXmlModel, element, attr
|
|
2
|
+
import enum
|
|
3
|
+
|
|
4
|
+
class ESLOG_C_S009(BaseXmlModel, tag="C_S009"):
|
|
5
|
+
D_0065: str = element(name="D_0065")
|
|
6
|
+
D_0052: str = element(name="D_0052")
|
|
7
|
+
D_0054: str = element(name="D_0054")
|
|
8
|
+
D_0051: str = element(name="D_0051")
|
|
9
|
+
|
|
10
|
+
class ESLOG_S_UNH(BaseXmlModel, tag="S_UNH"):
|
|
11
|
+
D_0062: str = element(name="D_0062")
|
|
12
|
+
C_S009: ESLOG_C_S009 = element(tag="C_S009")
|
|
13
|
+
|
|
14
|
+
class ESLOG_C_C002(BaseXmlModel, tag="C_C002"):
|
|
15
|
+
D_1001: str = element(name="D_1001")
|
|
16
|
+
|
|
17
|
+
class ESLOG_C_C106(BaseXmlModel, tag="C_C106"):
|
|
18
|
+
D_1004: str = element(name="D_1004")
|
|
19
|
+
|
|
20
|
+
class ESLOG_S_BGM(BaseXmlModel, tag="S_BGM"):
|
|
21
|
+
C_C002: ESLOG_C_C002 = element(tag="C_C002")
|
|
22
|
+
C_C106: ESLOG_C_C106 = element(tag="C_C106")
|
|
23
|
+
|
|
24
|
+
class ESLOG_C_C507(BaseXmlModel, tag="C_C507", skip_empty=True):
|
|
25
|
+
D_2005: str = element(name="D_2005")
|
|
26
|
+
D_2380: str | None = element(name="D_2380", default=None)
|
|
27
|
+
|
|
28
|
+
class ESLOG_S_DTM(BaseXmlModel, tag="S_DTM"):
|
|
29
|
+
C_C507: ESLOG_C_C507 = element(tag="C_C507")
|
|
30
|
+
|
|
31
|
+
class ESLOG_C_C107(BaseXmlModel, tag="C_C107"):
|
|
32
|
+
D_4441: str = element(name="D_4441")
|
|
33
|
+
|
|
34
|
+
class ESLOG_C_C108(BaseXmlModel, tag="C_C108", skip_empty=True):
|
|
35
|
+
D_4440: str = element(name="D_4440")
|
|
36
|
+
D_4440_2: str | None = element(name="D_4440_2", default=None)
|
|
37
|
+
D_4440_3: str | None = element(name="D_4440_3", default=None)
|
|
38
|
+
D_4440_4: str | None = element(name="D_4440_4", default=None)
|
|
39
|
+
D_4440_5: str | None = element(name="D_4440_5", default=None)
|
|
40
|
+
|
|
41
|
+
class ESLOG_S_FTX(BaseXmlModel, tag="S_FTX", skip_empty=True):
|
|
42
|
+
D_4451: str = element(name="D_4451") # Text subject code qualifier
|
|
43
|
+
C_C107: ESLOG_C_C107 | None = element(tag="C_C107", default=None)
|
|
44
|
+
C_C108: ESLOG_C_C108 = element(tag="C_C108")
|
|
45
|
+
|
|
46
|
+
class ESLOG_C_C506(BaseXmlModel, tag="C_C506"):
|
|
47
|
+
D_1153: str = element(name="D_1153")
|
|
48
|
+
D_1154: str = element(name="D_1154")
|
|
49
|
+
|
|
50
|
+
class ESLOG_S_RFF(BaseXmlModel, tag="S_RFF"):
|
|
51
|
+
C_C506: ESLOG_C_C506 = element(tag="C_C506")
|
|
52
|
+
|
|
53
|
+
class ESLOG_G_SG1(BaseXmlModel, tag="G_SG1"):
|
|
54
|
+
S_RFF: ESLOG_S_RFF = element(tag="S_RFF")
|
|
55
|
+
|
|
56
|
+
class ESLOG_C_C082(BaseXmlModel, tag="C_C082", skip_empty=True):
|
|
57
|
+
D_3039: str = element(name="D_3039")
|
|
58
|
+
D_1131: str | None = element(name="D_1131", default=None)
|
|
59
|
+
|
|
60
|
+
class ESLOG_C_C080(BaseXmlModel, tag="C_C080", skip_empty=True):
|
|
61
|
+
D_3036: str = element(name="D_3036")
|
|
62
|
+
D_3036_2: str | None = element(name="D_3036_2", default=None)
|
|
63
|
+
|
|
64
|
+
class ESLOG_C_C059(BaseXmlModel, tag="C_C059", skip_empty=True):
|
|
65
|
+
D_3042: str = element(name="D_3042")
|
|
66
|
+
D_3042_2: str | None = element(name="D_3042_2", default=None)
|
|
67
|
+
D_3042_3: str | None = element(name="D_3042_3", default=None)
|
|
68
|
+
|
|
69
|
+
class ESLOG_C_C819(BaseXmlModel, tag="C_C819"):
|
|
70
|
+
D_3228: str = element(name="D_3228")
|
|
71
|
+
|
|
72
|
+
class ESLOG_S_NAD(BaseXmlModel, tag="S_NAD", skip_empty=True):
|
|
73
|
+
D_3035: str = element(name="D_3035")
|
|
74
|
+
C_C082: ESLOG_C_C082 | None = element(tag="C_C082", default=None)
|
|
75
|
+
C_C080: ESLOG_C_C080 = element(tag="C_C080")
|
|
76
|
+
C_C059: ESLOG_C_C059 | None = element(tag="C_C059", default=None)
|
|
77
|
+
D_3164: str | None = element(name="D_3164", default=None)
|
|
78
|
+
C_C819: ESLOG_C_C819 | None = element(tag="C_C819", default=None)
|
|
79
|
+
D_3251: str | None = element(name="D_3251", default=None)
|
|
80
|
+
D_3207: str = element(name="D_3207")
|
|
81
|
+
|
|
82
|
+
class ESLOG_C_C078(BaseXmlModel, tag="C_C078"):
|
|
83
|
+
D_3194: str = element(name="D_3194")
|
|
84
|
+
|
|
85
|
+
class ESLOG_C_C088(BaseXmlModel, tag="C_C088"):
|
|
86
|
+
D_3433: str = element(name="D_3433")
|
|
87
|
+
|
|
88
|
+
class ESLOG_S_FII(BaseXmlModel, tag="S_FII"):
|
|
89
|
+
D_3035: str = element(name="D_3035")
|
|
90
|
+
C_C078: ESLOG_C_C078 = element(tag="C_C078")
|
|
91
|
+
C_C088: ESLOG_C_C088 = element(tag="C_C088")
|
|
92
|
+
|
|
93
|
+
class ESLOG_G_SG3(BaseXmlModel, tag="G_SG3"):
|
|
94
|
+
S_RFF: ESLOG_S_RFF = element(tag="S_RFF")
|
|
95
|
+
|
|
96
|
+
class ESLOG_C_C056(BaseXmlModel, tag="C_C056"):
|
|
97
|
+
D_3412: str = element(name="D_3412")
|
|
98
|
+
|
|
99
|
+
class ESLOG_S_CTA(BaseXmlModel, tag="S_CTA"):
|
|
100
|
+
D_3139: str = element(name="D_3139")
|
|
101
|
+
C_C056: ESLOG_C_C056 = element(tag="C_C056")
|
|
102
|
+
|
|
103
|
+
class ESLOG_G_SG5(BaseXmlModel, tag="G_SG5"):
|
|
104
|
+
S_CTA: ESLOG_S_CTA = element(tag="S_CTA")
|
|
105
|
+
|
|
106
|
+
class ESLOG_G_SG2(BaseXmlModel, tag="G_SG2", skip_empty=True):
|
|
107
|
+
S_NAD: ESLOG_S_NAD = element(tag="S_NAD")
|
|
108
|
+
S_FII: ESLOG_S_FII | None = element(tag="S_FII", default=None)
|
|
109
|
+
G_SG3: list[ESLOG_G_SG3] | None = element(tag="G_SG3", default=None)
|
|
110
|
+
G_SG5: list[ESLOG_G_SG5] | None = element(tag="G_SG5", default=None)
|
|
111
|
+
|
|
112
|
+
class ESLOG_C_C504(BaseXmlModel, tag="C_C504"):
|
|
113
|
+
D_6347: str = element(name="D_6347")
|
|
114
|
+
D_6345: str = element(name="D_6345")
|
|
115
|
+
|
|
116
|
+
class ESLOG_S_CUX(BaseXmlModel, tag="S_CUX"):
|
|
117
|
+
C_C504: ESLOG_C_C504 = element(tag="C_C504")
|
|
118
|
+
|
|
119
|
+
class ESLOG_G_SG7(BaseXmlModel, tag="G_SG7"):
|
|
120
|
+
S_CUX: ESLOG_S_CUX = element(tag="S_CUX")
|
|
121
|
+
|
|
122
|
+
class ESLOG_C_C212(BaseXmlModel, tag="C_C212"):
|
|
123
|
+
D_7140: str = element(name="D_7140")
|
|
124
|
+
D_7143: str = element(name="D_7143")
|
|
125
|
+
|
|
126
|
+
class ESLOG_S_LIN(BaseXmlModel, tag="S_LIN"):
|
|
127
|
+
D_1082: str = element(name="D_1082")
|
|
128
|
+
C_C212: ESLOG_C_C212 = element(tag="C_C212")
|
|
129
|
+
|
|
130
|
+
class ESLOG_S_PIA(BaseXmlModel, tag="S_PIA"):
|
|
131
|
+
D_4347: str = element(name="D_4347")
|
|
132
|
+
C_C212: ESLOG_C_C212 = element(tag="C_C212")
|
|
133
|
+
|
|
134
|
+
class ESLOG_C_C273(BaseXmlModel, tag="C_C273"):
|
|
135
|
+
D_7008: str = element(name="D_7008")
|
|
136
|
+
|
|
137
|
+
class ESLOG_S_IMD(BaseXmlModel, tag="S_IMD"):
|
|
138
|
+
D_7077: str = element(name="D_7077")
|
|
139
|
+
C_C273: ESLOG_C_C273 = element(tag="C_C273")
|
|
140
|
+
|
|
141
|
+
class ESLOG_C_C186(BaseXmlModel, tag="C_C186"):
|
|
142
|
+
D_6063: str = element(name="D_6063")
|
|
143
|
+
D_6060: str = element(name="D_6060")
|
|
144
|
+
D_6411: str = element(name="D_6411")
|
|
145
|
+
|
|
146
|
+
class ESLOG_S_QTY(BaseXmlModel, tag="S_QTY"):
|
|
147
|
+
C_C186: ESLOG_C_C186 = element(tag="C_C186")
|
|
148
|
+
|
|
149
|
+
class ESLOG_S_ALI(BaseXmlModel, tag="S_ALI"):
|
|
150
|
+
D_3239: str = element(name="D_3239")
|
|
151
|
+
|
|
152
|
+
class ESLOG_C_C516(BaseXmlModel, tag="C_C516"):
|
|
153
|
+
D_5025: str = element(name="D_5025")
|
|
154
|
+
D_5004: str = element(name="D_5004")
|
|
155
|
+
|
|
156
|
+
class ESLOG_S_MOA(BaseXmlModel, tag="S_MOA"):
|
|
157
|
+
C_C516: ESLOG_C_C516 = element(tag="C_C516")
|
|
158
|
+
|
|
159
|
+
class ESLOG_G_SG27(BaseXmlModel, tag="G_SG27"):
|
|
160
|
+
S_MOA: ESLOG_S_MOA = element(tag="S_MOA")
|
|
161
|
+
|
|
162
|
+
class ESLOG_C_C509(BaseXmlModel, tag="C_C509", skip_empty=True):
|
|
163
|
+
D_5125: str = element(name="D_5125")
|
|
164
|
+
D_5118: str = element(name="D_5118")
|
|
165
|
+
D_5284: str | None = element(default=None, name="D_5284")
|
|
166
|
+
D_6411: str | None = element(default=None, name="D_6411")
|
|
167
|
+
|
|
168
|
+
class ESLOG_S_PRI(BaseXmlModel, tag="S_PRI"):
|
|
169
|
+
C_C509: ESLOG_C_C509 = element(tag="C_C509")
|
|
170
|
+
|
|
171
|
+
class ESLOG_G_SG29(BaseXmlModel, tag="G_SG29"):
|
|
172
|
+
S_PRI: ESLOG_S_PRI = element(tag="S_PRI")
|
|
173
|
+
|
|
174
|
+
class ESLOG_G_SG30(BaseXmlModel, tag="G_SG30"):
|
|
175
|
+
S_RFF: ESLOG_S_RFF = element(tag="S_RFF")
|
|
176
|
+
|
|
177
|
+
class ESLOG_C_C241(BaseXmlModel, tag="C_C241"):
|
|
178
|
+
D_5153: str = element(name="D_5153")
|
|
179
|
+
|
|
180
|
+
class ESLOG_C_C243(BaseXmlModel, tag="C_C243"):
|
|
181
|
+
D_5278: str = element(name="D_5278")
|
|
182
|
+
|
|
183
|
+
class ESLOG_S_TAX(BaseXmlModel, tag="S_TAX"):
|
|
184
|
+
D_5283: str = element(name="D_5283")
|
|
185
|
+
C_C241: ESLOG_C_C241 = element(tag="C_C241")
|
|
186
|
+
C_C243: ESLOG_C_C243 = element(tag="C_C243")
|
|
187
|
+
D_5305: str = element(name="D_5305")
|
|
188
|
+
|
|
189
|
+
class ESLOG_G_SG34(BaseXmlModel, tag="G_SG34"):
|
|
190
|
+
S_TAX: ESLOG_S_TAX = element(tag="S_TAX")
|
|
191
|
+
S_MOA: list[ESLOG_S_MOA] = element(tag="S_MOA")
|
|
192
|
+
|
|
193
|
+
class ESLOG_S_ALC(BaseXmlModel, tag="S_ALC"):
|
|
194
|
+
D_5463: str = element(name="D_5463")
|
|
195
|
+
|
|
196
|
+
class ESLOG_G_SG42(BaseXmlModel, tag="G_SG42"):
|
|
197
|
+
S_MOA: ESLOG_S_MOA = element(tag="S_MOA")
|
|
198
|
+
|
|
199
|
+
class ESLOG_G_SG39(BaseXmlModel, tag="G_SG39"):
|
|
200
|
+
S_ALC: ESLOG_S_ALC = element(tag="S_ALC")
|
|
201
|
+
G_SG42: list[ESLOG_G_SG42] = element(tag="G_SG42")
|
|
202
|
+
|
|
203
|
+
class ESLOG_G_SG26(BaseXmlModel, tag="G_SG26", skip_empty=True):
|
|
204
|
+
S_LIN: ESLOG_S_LIN = element(tag="S_LIN")
|
|
205
|
+
S_PIA: list[ESLOG_S_PIA] = element(tag="S_PIA")
|
|
206
|
+
S_IMD: list[ESLOG_S_IMD] = element(tag="S_IMD")
|
|
207
|
+
S_QTY: ESLOG_S_QTY = element(tag="S_QTY")
|
|
208
|
+
S_ALI: ESLOG_S_ALI | None = element(tag="S_ALI", default=None)
|
|
209
|
+
S_DTM: list[ESLOG_S_DTM] = element(tag="S_DTM")
|
|
210
|
+
S_FTX: list[ESLOG_S_FTX] = element(tag="S_FTX")
|
|
211
|
+
G_SG27: list[ESLOG_G_SG27] = element(tag="G_SG27")
|
|
212
|
+
G_SG29: list[ESLOG_G_SG29] = element(tag="G_SG29")
|
|
213
|
+
G_SG30: list[ESLOG_G_SG30] = element(tag="G_SG30")
|
|
214
|
+
G_SG34: list[ESLOG_G_SG34] = element(tag="G_SG34")
|
|
215
|
+
G_SG39: list[ESLOG_G_SG39] = element(tag="G_SG39")
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
class ESLOG_S_UNS(BaseXmlModel, tag="S_UNS"):
|
|
219
|
+
D_0081: str = element(name="D_0081")
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
class ESLOG_G_SG50(BaseXmlModel, tag="G_SG50"):
|
|
223
|
+
S_MOA: ESLOG_S_MOA = element(tag="S_MOA")
|
|
224
|
+
|
|
225
|
+
class ESLOG_G_SG52(BaseXmlModel, tag="G_SG52"):
|
|
226
|
+
S_TAX: ESLOG_S_TAX = element(tag="S_TAX")
|
|
227
|
+
S_MOA: list[ESLOG_S_MOA] = element(tag="S_MOA")
|
|
228
|
+
|
|
229
|
+
class ESLOG_M_INVOIC(BaseXmlModel, tag="M_INVOIC"):
|
|
230
|
+
"""
|
|
231
|
+
Invoice metadata wrapper
|
|
232
|
+
"""
|
|
233
|
+
Id: str = attr(name="Id") # Always the same? Check xsd
|
|
234
|
+
UNH: ESLOG_S_UNH = element(tag="S_UNH")
|
|
235
|
+
BGM: ESLOG_S_BGM = element(tag="S_BGM")
|
|
236
|
+
DTM: list[ESLOG_S_DTM] = element(tag="S_DTM")
|
|
237
|
+
FTX: list[ESLOG_S_FTX] = element(tag="S_FTX")
|
|
238
|
+
SG1: list[ESLOG_G_SG1] = element(tag="G_SG1")
|
|
239
|
+
SG2: list[ESLOG_G_SG2] = element(tag="G_SG2")
|
|
240
|
+
SG7: list[ESLOG_G_SG7] = element(tag="G_SG7")
|
|
241
|
+
SG26: list[ESLOG_G_SG26] = element(tag="G_SG26")
|
|
242
|
+
UNS: ESLOG_S_UNS = element(tag="S_UNS")
|
|
243
|
+
SG50: list[ESLOG_G_SG50] = element(tag="G_SG50")
|
|
244
|
+
SG52: list[ESLOG_G_SG52] = element(tag="G_SG52")
|
|
245
|
+
|
|
246
|
+
class ESLOG_Invoice(BaseXmlModel, tag="Invoice", nsmap={"": "urn:eslog:2.00", "xsi": "http://www.w3.org/2001/XMLSchema-instance"}):
|
|
247
|
+
"""
|
|
248
|
+
Base invoice class
|
|
249
|
+
"""
|
|
250
|
+
M_INVOIC: ESLOG_M_INVOIC = element(tag="M_INVOIC")
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from .vat_point_date_code import VATPointDateCode
|
|
2
|
+
from .business_process_type import BusinessProcessType
|
|
3
|
+
from .item_identification_scheme import ItemIdentificationScheme
|
|
4
|
+
from .vat_category_code import VATCategoryCode
|
|
5
|
+
|
|
6
|
+
__all__ = [
|
|
7
|
+
"VATPointDateCode",
|
|
8
|
+
"BusinessProcessType",
|
|
9
|
+
"ItemIdentificationScheme",
|
|
10
|
+
"VATCategoryCode",
|
|
11
|
+
]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class BusinessProcessType(str, Enum):
|
|
5
|
+
"""
|
|
6
|
+
Business Process Type (BT-23)
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
INVOICING_AGAINST_PURCHASE_ORDER = "P1"
|
|
10
|
+
INVOICING_BASED_ON_CONTRACT = "P2"
|
|
11
|
+
INVOICING_INCIDENTAL_PURCHASE_ORDER = "P3"
|
|
12
|
+
PRE_PAYMENT = "P4"
|
|
13
|
+
SPOT_PAYMENT = "P5"
|
|
14
|
+
PAYMENT_IN_ADVANCE = "P6"
|
|
15
|
+
INVOICING_WITH_DESPATCH_ADVICE = "P7"
|
|
16
|
+
INVOICING_WITH_DESPATCH_AND_RECEIVING_ADVICE = "P8"
|
|
17
|
+
CREDIT_NOTE = "P9"
|
|
18
|
+
CORRECTIVE_INVOICING = "P10"
|
|
19
|
+
PARTIAL_AND_FINAL_INVOICING = "P11"
|
|
20
|
+
SELF_BILLING = "P12"
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class VATCategoryCode(str, Enum):
|
|
5
|
+
"""
|
|
6
|
+
VAT Category Code
|
|
7
|
+
|
|
8
|
+
S = Standard rate
|
|
9
|
+
Z = Zero rated goods
|
|
10
|
+
E = Exempt from tax
|
|
11
|
+
AE = VAT Reverse Charge
|
|
12
|
+
K = VAT exempt for EEA intra-community supply of goods and services
|
|
13
|
+
G = Free export item, tax not charged
|
|
14
|
+
O = Services outside scope of tax
|
|
15
|
+
L = Canary Islands general indirect tax
|
|
16
|
+
M = Tax for production, services and importation in Ceuta and Melilla
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
STANDARD_RATE = "S"
|
|
20
|
+
ZERO_RATED_GOODS = "Z"
|
|
21
|
+
EXEMPT_FROM_TAX = "E"
|
|
22
|
+
VAT_REVERSE_CHARGE = "AE"
|
|
23
|
+
VAT_EXEMPT_FOR_EEA_INTRA_COMMUNITY_SUPPLY_OF_GOODS_AND_SERVICES = "K"
|
|
24
|
+
FREE_EXPORT_ITEM = "G"
|
|
25
|
+
SERVICES_OUTSIDE_SCOPE_OF_TAX = "O"
|
|
26
|
+
CANARY_ISLANDS_GENERAL_INDIRECT_TAX = "L"
|
|
27
|
+
TAX_FOR_PRODUCTION_SERVICES_AND_IMPORTATION_IN_CEUTA_AND_MELILLA = "M"
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
from pydantic import BaseModel, Field
|
|
2
|
+
from .enums import (
|
|
3
|
+
VATPointDateCode,
|
|
4
|
+
BusinessProcessType,
|
|
5
|
+
ItemIdentificationScheme,
|
|
6
|
+
VATCategoryCode,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class CEF_VAT_EXEMPTION(BaseModel):
|
|
11
|
+
VAT_EXEMPTION_REASON_CODE: str = Field(description="VAT Exemption Reason (BT-121). Use vode list CEF VATEX — VAT exemption reason code") # TODO Add validation
|
|
12
|
+
VAT_EXEMPTION_REASON_TEXT: str = Field(description="VAT Exemption Reason (BT-120)")
|
|
13
|
+
|
|
14
|
+
class BusinessEntity(BaseModel):
|
|
15
|
+
identifier: str | None = Field(default=None, description="Buyer identifier (BT-46)")
|
|
16
|
+
identifier_identification_scheme_identifier: str | None = Field(default="0088", description="Buyer identifier identification scheme identifier (BT-46-1). The identification scheme identifier of the Buyer identifier. Use code list ISO/IEC 6523 — Identifier scheme code") # Todo validation?
|
|
17
|
+
name: str = Field(description="Buyer name (BT-44). The full name of the buyer.")
|
|
18
|
+
trading_name: str | None = Field(default=None, description="Buyer trading name (BT-45). A name by which the Buyer is known, other than Buyer name (also known as Business name).")
|
|
19
|
+
address_line_1: str = Field(description="Buyer address line 1(BT-50). The main address line in an address.")
|
|
20
|
+
address_line_2: str | None = Field(default=None, description="Buyer address line 2 (BT-51). An additional address line in an address that can be used to give further details supplementing the main line.")
|
|
21
|
+
address_line_3: str | None = Field(default=None, description="Buyer address line 3 (BT-163). An additional address line in an address that can be used to give further details supplementing the main line.")
|
|
22
|
+
city: str | None = Field(default=None, description="Buyer city (BT-52). The common name of the city, town or village, where the Buyer's address is located.")
|
|
23
|
+
country_subdivision: str | None = Field(default=None, description="Buyer country subdivision (BT-54). The subdivision of a country.")
|
|
24
|
+
post_code: str | None = Field(default=None, description="Buyer post code (BT-53). The identifier for an addressable group of properties according to the relevant postal service.")
|
|
25
|
+
country_code: str = Field(description="Buyer country code (BT-55). A code that identifies the country. Use code list ISO 3166-1 — Country Codes") # TODO: Validation
|
|
26
|
+
iban: str | None = Field(default=None, description="Buyer IBAN (BT-84)")
|
|
27
|
+
account_holder_name: str | None = Field(default=None, description="Buyer account holder name (BT-85)")
|
|
28
|
+
bic: str | None = Field(default=None, description="Buyer BIC (BT-86)")
|
|
29
|
+
vat_registration_number: str | None = Field(default=None, description="Buyer VAT registration number (BT-31)")
|
|
30
|
+
maticna: str | None = Field(default=None, description="Buyer maticna (BT-30)")
|
|
31
|
+
contact_person_name: str | None = Field(default=None, description="Buyer contact person name (BT-32)")
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class Item(BaseModel):
|
|
35
|
+
standard_identifier: str = Field(description="Item standard identifier(BT-157) An item identifier based on a registered scheme.")
|
|
36
|
+
standard_identifier_identification_scheme_identifier: ItemIdentificationScheme = Field(description="Item standard identifier identification scheme identifier (BT-157-1). The identification scheme identifier of the Item standard identifier. Use code list ISO/IEC 6523 — Identifier scheme code")
|
|
37
|
+
sellers_item_identifier: str = Field(description="Item sellers item identifier (BT-155). The identifier assigned by the Seller for the item.")
|
|
38
|
+
name: str = Field(description="Item name (BT-153). The name of the item.")
|
|
39
|
+
quantity: str = Field(description="Invoiced quantity (BT-129). The quantity of items (goods or services) that is charged in the Invoice line.")
|
|
40
|
+
quantity_unit_of_measure: str = Field(description="Invoiced quantity unit of measure (BT-130). The unit of measure that applies to the invoiced quantity. Use code list UN/ECE Recommendation N°20 and UN/ECE Recommendation N°21 — Unit codes") ## TODO Validation, mapping
|
|
41
|
+
total_monetary_amount: str = Field(description="Invoice line net amount (BT-131). The total amount of the Invoice line.")
|
|
42
|
+
total_monetary_amount_including_vat: str | None = Field(default=None, description="Invoice line net amount including VAT (NBT-031). The total amount of the Invoice line including VAT.")
|
|
43
|
+
item_net_price: str = Field(description="Item net price (BT-146). The price of an item, exclusive of VAT, after subtracting item price discount.")
|
|
44
|
+
item_price_base_quantity: str | None = Field(default=None, description="Item price base quantity (BT-149). The number of item unity to which the price applies.")
|
|
45
|
+
item_price_base_quantity_unit_of_measure_code: str | None = Field(default=None, description="Item price base quantity unit of measure code (BT-150). The unit of measure that applies to the item price base quantity. Use code list UN/ECE Recommendation N°20 and UN/ECE Recommendation N°21 — Unit codes") ## TODO VALIDATING; MAPPING
|
|
46
|
+
item_gross_price: str | None = Field(default=None, description="Item gross price (BT-148). The unit price, exclusive of VAT; before subtracting item price discount.")
|
|
47
|
+
vat_rate: str = Field(description="Invoiced item VAT rate (BT-152). The VAR rate, represented as percentage that applies to the invoiced item.")
|
|
48
|
+
vat_category_code: VATCategoryCode = Field(description="Invoiced item VAT category code (BT-151). The VAT category code for the invoiced item")
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class Invoice(BaseModel):
|
|
54
|
+
invoice_number: str
|
|
55
|
+
invoice_issue_date: str
|
|
56
|
+
value_added_tax_point_date: str | None = Field(default=None, description="Value added tax point date (BT-7). The date when the VAT becomes accountable for the Seller and for the Buyer in so far as that date can be determined and differs from the date of issue of the invoice, according to the VAT directive.")
|
|
57
|
+
value_added_tax_point_date_code: VATPointDateCode | None = Field(default=None, description="Value added tax point date code (BT-8), DESC:The code of the date when the VAT becomes accountable for the Seller and for the Buyer.")
|
|
58
|
+
actual_delivery_date: str | None = Field(default=None, description="Actual delivery date (BT-72). The date on which the delivery is made.")
|
|
59
|
+
invoicing_period_start_date: str | None = Field(default=None, description="Invoicing period start date (BT-73). The date on which the invoicing period starts.")
|
|
60
|
+
invoicing_period_end_date: str | None = Field(default=None, description="Invoicing period end date (BT-74). The date on which the invoicing period ends.")
|
|
61
|
+
terms_of_payments: list[str] | None = Field(
|
|
62
|
+
default=None,
|
|
63
|
+
description="Payment terms (BT-20). A textual description of the payment terms that apply to the amount due for payment (Including description of possible penalties). Five lines of text possible.",
|
|
64
|
+
max_length=5
|
|
65
|
+
)
|
|
66
|
+
seller_additional_legal_information: str | None = Field(
|
|
67
|
+
default=None,
|
|
68
|
+
description="Seller additional legal information (BT-33). Additional legal information relevant for the Seller."
|
|
69
|
+
)
|
|
70
|
+
invoice_note: str | None = Field(
|
|
71
|
+
default=None,
|
|
72
|
+
description="Invoice note (BT-22). A textual note that gives unstructured information that is relevant to the Invoice as a whole. A group of business terms providing textual notes that are relevant for the invoice, together with an indication of the note subject."
|
|
73
|
+
)
|
|
74
|
+
business_process_type: BusinessProcessType = Field(
|
|
75
|
+
description="Business process type (BT-23). Identifies the business process context in which the transaction appears, to enable the Buyer to process the Invoice in an appropriate way."
|
|
76
|
+
)
|
|
77
|
+
payment_means_text: str | None = Field(
|
|
78
|
+
default=None,
|
|
79
|
+
description="Payment means text (BT-82). The means, expressed as text, for prepaid how a payment is expected to be or has been settled. Code AAT may be used for other than IATA."
|
|
80
|
+
)
|
|
81
|
+
vat_exemption_reason: CEF_VAT_EXEMPTION | None = Field(
|
|
82
|
+
default=None,
|
|
83
|
+
)
|
|
84
|
+
buyer: BusinessEntity = Field(description="Buyer (BT-44, BT-45, BT-46, BT-46-1)")
|
|
85
|
+
seller: BusinessEntity = Field(description="Seller")
|
|
86
|
+
reference_currency_code: str = Field(default="EUR", description="Reference currency code (BT-5). The currency in which all Invoice amounts are given, except for the Total VAT amount in accounting currency. Use code list ISO 4217 — Currency codes") # TODO validation
|
|
87
|
+
items: list[Item] = Field(description="Items to include in the invoice. Will be automatically numbered starting from 1.")
|
|
88
|
+
|
|
89
|
+
# Monetary stuff
|
|
90
|
+
sum_of_invoice_line_net_amount: str = Field(description="Sum of Invoice line net amount (BT-106). The sum of all Invoice line net amounts in the Invoice.")
|
|
91
|
+
invoice_total_amount_without_vat: str = Field(description="Invoice total amount without VAT (BT-109). The total amount of the Invoice without VAT.")
|
|
92
|
+
invoice_total_amount_with_vat: str = Field(description="Invoice total amount with VAT (BT-112). The total amount of the Invoice with VAT.")
|
|
93
|
+
amount_due_for_payment: str = Field(description="Amount due for payment (BT-115). The outstanding amount that is requested to be paid.")
|
|
94
|
+
sum_of_allowances_on_document_level: str | None = Field(default=None, description="Sum of allowances on document level (BT-107). The sum of all allowances on document level in the Invoice.")
|
|
95
|
+
sum_of_charges_on_document_level: str | None = Field(default=None, description="Sum of charges on document level (BT-108). The sum of all charges on document level in the Invoice.")
|
|
96
|
+
invoice_total_vat_amount_in_accounting_currency: str | None = Field(default=None, description="Invoice total VAT amount in accounting currency (BT-111). The VAT total amount expressed in the accounting currency accepted or required in the country of the Seller.")
|
|
97
|
+
paid_amount: str | None = Field(default=None, description="Paid amount (BT-113). The sum of amounts which have been paid in advance.")
|
|
98
|
+
rounding_amount: str | None = Field(default=None, description="Rounding amount (BT-114). The amount to be added to the invoice total to round the amount to be paid.")
|
|
99
|
+
invoice_total_vat_amount: str | None = Field(default=None, description="Invoice total VAT amount (BT-110). The total VAT amount for the Invoice.")
|