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
pyslog/__init__.py
ADDED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
from pyslog.eslog2.models import (
|
|
2
|
+
Invoice, BusinessEntity, Item, CEF_VAT_EXEMPTION,
|
|
3
|
+
VATPointDateCode, BusinessProcessType, ItemIdentificationScheme, VATCategoryCode
|
|
4
|
+
)
|
|
5
|
+
from pyslog.eslog2.models._xml import *
|
|
6
|
+
|
|
7
|
+
def generate_eslog_invoice(invoice: Invoice) -> str:
|
|
8
|
+
eslog_buyer = ESLOG_G_SG2(
|
|
9
|
+
S_NAD=ESLOG_S_NAD(
|
|
10
|
+
D_3035="BY",
|
|
11
|
+
# C_C082=ESLOG_C_C082(
|
|
12
|
+
# D_3039=invoice.buyer.identifier,
|
|
13
|
+
# D_1131=invoice.buyer.identifier_identification_scheme_identifier
|
|
14
|
+
# ),
|
|
15
|
+
C_C080=ESLOG_C_C080(
|
|
16
|
+
D_3036=invoice.buyer.name,
|
|
17
|
+
D_3036_2=invoice.buyer.trading_name
|
|
18
|
+
),
|
|
19
|
+
C_C059=ESLOG_C_C059(
|
|
20
|
+
D_3042=invoice.buyer.address_line_1,
|
|
21
|
+
D_3042_2=invoice.buyer.address_line_2,
|
|
22
|
+
D_3042_3=invoice.buyer.address_line_3
|
|
23
|
+
),
|
|
24
|
+
D_3207=invoice.buyer.country_code,
|
|
25
|
+
)
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
if invoice.buyer.address_line_2 is not None:
|
|
29
|
+
eslog_buyer.S_NAD.C_C059.D_3042_2 = invoice.buyer.address_line_2
|
|
30
|
+
if invoice.buyer.address_line_3 is not None:
|
|
31
|
+
eslog_buyer.S_NAD.C_C059.D_3042_3 = invoice.buyer.address_line_3
|
|
32
|
+
if invoice.buyer.city is not None:
|
|
33
|
+
eslog_buyer.S_NAD.D_3164 = invoice.buyer.city
|
|
34
|
+
if invoice.buyer.post_code is not None:
|
|
35
|
+
eslog_buyer.S_NAD.D_3251 = invoice.buyer.post_code
|
|
36
|
+
if invoice.buyer.country_subdivision is not None:
|
|
37
|
+
eslog_buyer.S_NAD.C_C819 = ESLOG_C_C819(
|
|
38
|
+
D_3228=invoice.buyer.country_subdivision,
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
eslog_seller = ESLOG_G_SG2(
|
|
42
|
+
S_NAD=ESLOG_S_NAD(
|
|
43
|
+
D_3035="SE",
|
|
44
|
+
# C_C082=ESLOG_C_C082(
|
|
45
|
+
# D_3039=invoice.seller.identifier,
|
|
46
|
+
# D_1131=invoice.seller.identifier_identification_scheme_identifier
|
|
47
|
+
# ),
|
|
48
|
+
C_C080=ESLOG_C_C080(
|
|
49
|
+
D_3036=invoice.seller.name,
|
|
50
|
+
D_3036_2=invoice.seller.trading_name
|
|
51
|
+
),
|
|
52
|
+
C_C059=ESLOG_C_C059(
|
|
53
|
+
D_3042=invoice.seller.address_line_1,
|
|
54
|
+
D_3042_2=invoice.seller.address_line_2,
|
|
55
|
+
D_3042_3=invoice.seller.address_line_3
|
|
56
|
+
),
|
|
57
|
+
D_3207=invoice.seller.country_code,
|
|
58
|
+
),
|
|
59
|
+
S_FII=ESLOG_S_FII(
|
|
60
|
+
D_3035="RB",
|
|
61
|
+
C_C078=ESLOG_C_C078(
|
|
62
|
+
D_3194=invoice.seller.iban
|
|
63
|
+
),
|
|
64
|
+
C_C088=ESLOG_C_C088(
|
|
65
|
+
D_3433=invoice.seller.bic
|
|
66
|
+
)
|
|
67
|
+
),
|
|
68
|
+
G_SG3=[
|
|
69
|
+
ESLOG_G_SG3(
|
|
70
|
+
S_RFF=ESLOG_S_RFF(
|
|
71
|
+
C_C506=ESLOG_C_C506(
|
|
72
|
+
D_1153="VA",
|
|
73
|
+
D_1154=invoice.seller.vat_registration_number
|
|
74
|
+
)
|
|
75
|
+
)
|
|
76
|
+
),
|
|
77
|
+
ESLOG_G_SG3(
|
|
78
|
+
S_RFF=ESLOG_S_RFF(
|
|
79
|
+
C_C506=ESLOG_C_C506(
|
|
80
|
+
D_1153="AHP",
|
|
81
|
+
D_1154=invoice.seller.vat_registration_number
|
|
82
|
+
)
|
|
83
|
+
)
|
|
84
|
+
),
|
|
85
|
+
ESLOG_G_SG3(
|
|
86
|
+
S_RFF=ESLOG_S_RFF(
|
|
87
|
+
C_C506=ESLOG_C_C506(
|
|
88
|
+
D_1153="0199",
|
|
89
|
+
D_1154=invoice.seller.maticna
|
|
90
|
+
)
|
|
91
|
+
)
|
|
92
|
+
),
|
|
93
|
+
],
|
|
94
|
+
G_SG5=[
|
|
95
|
+
ESLOG_G_SG5(
|
|
96
|
+
S_CTA=ESLOG_S_CTA(
|
|
97
|
+
D_3139="SU",
|
|
98
|
+
C_C056=ESLOG_C_C056(
|
|
99
|
+
D_3412=invoice.seller.contact_person_name
|
|
100
|
+
)
|
|
101
|
+
)
|
|
102
|
+
)
|
|
103
|
+
]
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
if invoice.seller.address_line_2 is not None:
|
|
107
|
+
eslog_seller.S_NAD.C_C059.D_3042_2 = invoice.seller.address_line_2
|
|
108
|
+
if invoice.seller.address_line_3 is not None:
|
|
109
|
+
eslog_seller.S_NAD.C_C059.D_3042_3 = invoice.seller.address_line_3
|
|
110
|
+
if invoice.seller.city is not None:
|
|
111
|
+
eslog_seller.S_NAD.D_3164 = invoice.seller.city
|
|
112
|
+
if invoice.seller.post_code is not None:
|
|
113
|
+
eslog_seller.S_NAD.D_3251 = invoice.seller.post_code
|
|
114
|
+
if invoice.seller.country_subdivision is not None:
|
|
115
|
+
eslog_seller.S_NAD.C_C819 = ESLOG_C_C819(
|
|
116
|
+
D_3228=invoice.seller.country_subdivision,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
eslog_invoice = ESLOG_Invoice(
|
|
121
|
+
M_INVOIC=ESLOG_M_INVOIC(
|
|
122
|
+
Id="data",
|
|
123
|
+
UNH=ESLOG_S_UNH(
|
|
124
|
+
D_0062=invoice.invoice_number, # TODO:
|
|
125
|
+
C_S009=ESLOG_C_S009(
|
|
126
|
+
D_0065="INVOIC",
|
|
127
|
+
D_0052="D",
|
|
128
|
+
D_0054="01B",
|
|
129
|
+
D_0051="UN"
|
|
130
|
+
)
|
|
131
|
+
),
|
|
132
|
+
BGM=ESLOG_S_BGM(
|
|
133
|
+
C_C002=ESLOG_C_C002(
|
|
134
|
+
D_1001="380" # ker je invoice
|
|
135
|
+
),
|
|
136
|
+
C_C106=ESLOG_C_C106(
|
|
137
|
+
D_1004=invoice.invoice_number
|
|
138
|
+
)
|
|
139
|
+
),
|
|
140
|
+
DTM=[
|
|
141
|
+
ESLOG_S_DTM(
|
|
142
|
+
C_C507=ESLOG_C_C507(
|
|
143
|
+
D_2005="137",
|
|
144
|
+
D_2380=invoice.invoice_issue_date
|
|
145
|
+
)
|
|
146
|
+
),
|
|
147
|
+
],
|
|
148
|
+
FTX=[
|
|
149
|
+
ESLOG_S_FTX(
|
|
150
|
+
D_4451="DOC",
|
|
151
|
+
C_C107=ESLOG_C_C107(
|
|
152
|
+
D_4441=invoice.business_process_type.value
|
|
153
|
+
),
|
|
154
|
+
C_C108=ESLOG_C_C108(
|
|
155
|
+
D_4440="urn:cen.eu:en16931:2017"
|
|
156
|
+
)
|
|
157
|
+
),
|
|
158
|
+
],
|
|
159
|
+
SG1=[],
|
|
160
|
+
SG2=[
|
|
161
|
+
eslog_buyer,
|
|
162
|
+
eslog_seller
|
|
163
|
+
],
|
|
164
|
+
SG7=[
|
|
165
|
+
ESLOG_G_SG7(
|
|
166
|
+
S_CUX=ESLOG_S_CUX(
|
|
167
|
+
C_C504=ESLOG_C_C504(
|
|
168
|
+
D_6347="2",
|
|
169
|
+
D_6345=invoice.reference_currency_code
|
|
170
|
+
)
|
|
171
|
+
)
|
|
172
|
+
)
|
|
173
|
+
],
|
|
174
|
+
SG26=[],
|
|
175
|
+
UNS=ESLOG_S_UNS(
|
|
176
|
+
D_0081="D"
|
|
177
|
+
),
|
|
178
|
+
SG50=[
|
|
179
|
+
ESLOG_G_SG50(
|
|
180
|
+
S_MOA=ESLOG_S_MOA(
|
|
181
|
+
C_C516=ESLOG_C_C516(
|
|
182
|
+
D_5025="79",
|
|
183
|
+
D_5004=invoice.sum_of_invoice_line_net_amount
|
|
184
|
+
)
|
|
185
|
+
)
|
|
186
|
+
),
|
|
187
|
+
ESLOG_G_SG50(
|
|
188
|
+
S_MOA=ESLOG_S_MOA(
|
|
189
|
+
C_C516=ESLOG_C_C516(
|
|
190
|
+
D_5025="389",
|
|
191
|
+
D_5004=invoice.invoice_total_amount_without_vat
|
|
192
|
+
)
|
|
193
|
+
)
|
|
194
|
+
),
|
|
195
|
+
ESLOG_G_SG50(
|
|
196
|
+
S_MOA=ESLOG_S_MOA(
|
|
197
|
+
C_C516=ESLOG_C_C516(
|
|
198
|
+
D_5025="388",
|
|
199
|
+
D_5004=invoice.invoice_total_amount_with_vat
|
|
200
|
+
)
|
|
201
|
+
)
|
|
202
|
+
),
|
|
203
|
+
ESLOG_G_SG50(
|
|
204
|
+
S_MOA=ESLOG_S_MOA(
|
|
205
|
+
C_C516=ESLOG_C_C516(
|
|
206
|
+
D_5025="9",
|
|
207
|
+
D_5004=invoice.amount_due_for_payment
|
|
208
|
+
)
|
|
209
|
+
)
|
|
210
|
+
),
|
|
211
|
+
|
|
212
|
+
],
|
|
213
|
+
SG52=[
|
|
214
|
+
ESLOG_G_SG52(
|
|
215
|
+
S_TAX=ESLOG_S_TAX(
|
|
216
|
+
D_5283="7",
|
|
217
|
+
C_C241=ESLOG_C_C241(
|
|
218
|
+
D_5153="VAT"
|
|
219
|
+
),
|
|
220
|
+
C_C243=ESLOG_C_C243(
|
|
221
|
+
D_5278="25" ## VAT RATE PERCENTAGE
|
|
222
|
+
),
|
|
223
|
+
D_5305="S"
|
|
224
|
+
),
|
|
225
|
+
S_MOA=[
|
|
226
|
+
ESLOG_S_MOA(
|
|
227
|
+
C_C516=ESLOG_C_C516(
|
|
228
|
+
D_5025="125",
|
|
229
|
+
D_5004="1000.00" # Taxable amount
|
|
230
|
+
)
|
|
231
|
+
),
|
|
232
|
+
ESLOG_S_MOA(
|
|
233
|
+
C_C516=ESLOG_C_C516(
|
|
234
|
+
D_5025="124",
|
|
235
|
+
D_5004="250.00" # Tax amount
|
|
236
|
+
)
|
|
237
|
+
),
|
|
238
|
+
]
|
|
239
|
+
)
|
|
240
|
+
],
|
|
241
|
+
)
|
|
242
|
+
)
|
|
243
|
+
|
|
244
|
+
for index, item in enumerate(invoice.items):
|
|
245
|
+
eslog_item = ESLOG_G_SG26(
|
|
246
|
+
S_LIN=ESLOG_S_LIN(
|
|
247
|
+
D_1082=str(index + 1),
|
|
248
|
+
C_C212=ESLOG_C_C212(
|
|
249
|
+
D_7140=item.standard_identifier,
|
|
250
|
+
D_7143=item.standard_identifier_identification_scheme_identifier,
|
|
251
|
+
),
|
|
252
|
+
),
|
|
253
|
+
S_PIA=[
|
|
254
|
+
ESLOG_S_PIA( ## ni nujno. Potem dodaj še en PIA za buyer identifier (segment 78)
|
|
255
|
+
D_4347="5",
|
|
256
|
+
C_C212=ESLOG_C_C212(
|
|
257
|
+
D_7140=item.sellers_item_identifier,
|
|
258
|
+
D_7143="SA",
|
|
259
|
+
),
|
|
260
|
+
)
|
|
261
|
+
],
|
|
262
|
+
S_IMD=[
|
|
263
|
+
ESLOG_S_IMD( # short description
|
|
264
|
+
D_7077="F",
|
|
265
|
+
C_C273=ESLOG_C_C273(
|
|
266
|
+
D_7008=item.name
|
|
267
|
+
),
|
|
268
|
+
), ## TODO You can also add long description (segment 81)
|
|
269
|
+
],
|
|
270
|
+
S_QTY=ESLOG_S_QTY(
|
|
271
|
+
C_C186=ESLOG_C_C186(
|
|
272
|
+
D_6063="47",
|
|
273
|
+
D_6060=item.quantity,
|
|
274
|
+
D_6411=item.quantity_unit_of_measure,
|
|
275
|
+
)
|
|
276
|
+
),
|
|
277
|
+
S_DTM=[],
|
|
278
|
+
S_FTX=[],
|
|
279
|
+
G_SG27=[
|
|
280
|
+
ESLOG_G_SG27(
|
|
281
|
+
S_MOA=ESLOG_S_MOA(
|
|
282
|
+
C_C516=ESLOG_C_C516(
|
|
283
|
+
D_5025="203",
|
|
284
|
+
D_5004=item.total_monetary_amount,
|
|
285
|
+
)
|
|
286
|
+
)
|
|
287
|
+
),
|
|
288
|
+
ESLOG_G_SG27(
|
|
289
|
+
S_MOA=ESLOG_S_MOA(
|
|
290
|
+
C_C516=ESLOG_C_C516(
|
|
291
|
+
D_5025="38",
|
|
292
|
+
D_5004=item.total_monetary_amount_including_vat,
|
|
293
|
+
)
|
|
294
|
+
)
|
|
295
|
+
),
|
|
296
|
+
],
|
|
297
|
+
G_SG29=[
|
|
298
|
+
ESLOG_G_SG29(
|
|
299
|
+
S_PRI=ESLOG_S_PRI(
|
|
300
|
+
C_C509=ESLOG_C_C509(
|
|
301
|
+
D_5125="AAA",
|
|
302
|
+
D_5118=item.item_net_price,
|
|
303
|
+
D_5284=item.item_price_base_quantity,
|
|
304
|
+
D_6411=item.item_price_base_quantity_unit_of_measure_code,
|
|
305
|
+
)
|
|
306
|
+
)
|
|
307
|
+
),
|
|
308
|
+
ESLOG_G_SG29(
|
|
309
|
+
S_PRI=ESLOG_S_PRI(
|
|
310
|
+
C_C509=ESLOG_C_C509(
|
|
311
|
+
D_5125="AAB",
|
|
312
|
+
D_5118=item.item_gross_price,
|
|
313
|
+
D_5284=item.item_price_base_quantity,
|
|
314
|
+
D_6411=item.item_price_base_quantity_unit_of_measure_code,
|
|
315
|
+
)
|
|
316
|
+
)
|
|
317
|
+
),
|
|
318
|
+
],
|
|
319
|
+
G_SG30=[],
|
|
320
|
+
G_SG34=[
|
|
321
|
+
ESLOG_G_SG34(
|
|
322
|
+
S_TAX=ESLOG_S_TAX(
|
|
323
|
+
D_5283="7",
|
|
324
|
+
C_C241=ESLOG_C_C241(
|
|
325
|
+
D_5153="VAT"
|
|
326
|
+
),
|
|
327
|
+
C_C243=ESLOG_C_C243(
|
|
328
|
+
D_5278=item.vat_rate
|
|
329
|
+
),
|
|
330
|
+
D_5305=item.vat_category_code.value,
|
|
331
|
+
),
|
|
332
|
+
S_MOA=[
|
|
333
|
+
|
|
334
|
+
]
|
|
335
|
+
)
|
|
336
|
+
],
|
|
337
|
+
G_SG39=[],
|
|
338
|
+
)
|
|
339
|
+
eslog_invoice.M_INVOIC.SG26.append(eslog_item)
|
|
340
|
+
|
|
341
|
+
if invoice.value_added_tax_point_date:
|
|
342
|
+
eslog_invoice.M_INVOIC.DTM.append(
|
|
343
|
+
ESLOG_S_DTM(
|
|
344
|
+
C_C507=ESLOG_C_C507(D_2005="131", D_2380=invoice.value_added_tax_point_date)
|
|
345
|
+
)
|
|
346
|
+
)
|
|
347
|
+
|
|
348
|
+
if invoice.value_added_tax_point_date_code:
|
|
349
|
+
eslog_invoice.M_INVOIC.DTM.append(
|
|
350
|
+
ESLOG_S_DTM(
|
|
351
|
+
C_C507=ESLOG_C_C507(D_2005=invoice.value_added_tax_point_date_code.value)
|
|
352
|
+
)
|
|
353
|
+
)
|
|
354
|
+
|
|
355
|
+
if invoice.actual_delivery_date:
|
|
356
|
+
eslog_invoice.M_INVOIC.DTM.append(
|
|
357
|
+
ESLOG_S_DTM(
|
|
358
|
+
C_C507=ESLOG_C_C507(D_2005="35", D_2380=invoice.actual_delivery_date)
|
|
359
|
+
)
|
|
360
|
+
)
|
|
361
|
+
|
|
362
|
+
if invoice.invoicing_period_start_date:
|
|
363
|
+
eslog_invoice.M_INVOIC.DTM.append(
|
|
364
|
+
ESLOG_S_DTM(
|
|
365
|
+
C_C507=ESLOG_C_C507(D_2005="167", D_2380=invoice.invoicing_period_start_date)
|
|
366
|
+
)
|
|
367
|
+
)
|
|
368
|
+
|
|
369
|
+
if invoice.invoicing_period_end_date:
|
|
370
|
+
eslog_invoice.M_INVOIC.DTM.append(
|
|
371
|
+
ESLOG_S_DTM(
|
|
372
|
+
C_C507=ESLOG_C_C507(D_2005="168", D_2380=invoice.invoicing_period_end_date)
|
|
373
|
+
)
|
|
374
|
+
)
|
|
375
|
+
|
|
376
|
+
if invoice.terms_of_payments:
|
|
377
|
+
eslog_invoice.M_INVOIC.FTX.append(
|
|
378
|
+
ESLOG_S_FTX(
|
|
379
|
+
D_4451="AAB",
|
|
380
|
+
C_C108=ESLOG_C_C108(
|
|
381
|
+
D_4440=invoice.terms_of_payments[0],
|
|
382
|
+
D_4440_2=invoice.terms_of_payments[1] if len(invoice.terms_of_payments) > 1 else None,
|
|
383
|
+
D_4440_3=invoice.terms_of_payments[2] if len(invoice.terms_of_payments) > 2 else None,
|
|
384
|
+
D_4440_4=invoice.terms_of_payments[3] if len(invoice.terms_of_payments) > 3 else None,
|
|
385
|
+
D_4440_5=invoice.terms_of_payments[4] if len(invoice.terms_of_payments) > 4 else None,
|
|
386
|
+
)
|
|
387
|
+
)
|
|
388
|
+
)
|
|
389
|
+
|
|
390
|
+
if invoice.seller_additional_legal_information:
|
|
391
|
+
eslog_invoice.M_INVOIC.FTX.append(
|
|
392
|
+
ESLOG_S_FTX(
|
|
393
|
+
D_4451="AAB",
|
|
394
|
+
C_C108=ESLOG_C_C108(
|
|
395
|
+
D_4440=invoice.seller_additional_legal_information
|
|
396
|
+
)
|
|
397
|
+
)
|
|
398
|
+
)
|
|
399
|
+
|
|
400
|
+
if invoice.invoice_note:
|
|
401
|
+
eslog_invoice.M_INVOIC.FTX.append(
|
|
402
|
+
ESLOG_S_FTX(
|
|
403
|
+
D_4451="GEN",
|
|
404
|
+
C_C108=ESLOG_C_C108(
|
|
405
|
+
D_4440=invoice.invoice_note
|
|
406
|
+
)
|
|
407
|
+
)
|
|
408
|
+
)
|
|
409
|
+
|
|
410
|
+
if invoice.payment_means_text:
|
|
411
|
+
eslog_invoice.M_INVOIC.FTX.append(
|
|
412
|
+
ESLOG_S_FTX(
|
|
413
|
+
D_4451="AAT",
|
|
414
|
+
C_C108=ESLOG_C_C108(
|
|
415
|
+
D_4440=invoice.payment_means_text
|
|
416
|
+
)
|
|
417
|
+
)
|
|
418
|
+
)
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
# Final sum stuff
|
|
422
|
+
if invoice.sum_of_allowances_on_document_level:
|
|
423
|
+
eslog_invoice.M_INVOIC.SG50.append(
|
|
424
|
+
ESLOG_G_SG50(
|
|
425
|
+
S_MOA=ESLOG_S_MOA(
|
|
426
|
+
C_C516=ESLOG_C_C516(
|
|
427
|
+
D_5025="260",
|
|
428
|
+
D_5004=invoice.sum_of_allowances_on_document_level
|
|
429
|
+
)
|
|
430
|
+
)
|
|
431
|
+
)
|
|
432
|
+
)
|
|
433
|
+
|
|
434
|
+
if invoice.sum_of_charges_on_document_level:
|
|
435
|
+
eslog_invoice.M_INVOIC.SG50.append(
|
|
436
|
+
ESLOG_G_SG50(
|
|
437
|
+
S_MOA=ESLOG_S_MOA(
|
|
438
|
+
C_C516=ESLOG_C_C516(
|
|
439
|
+
D_5025="259",
|
|
440
|
+
D_5004=invoice.sum_of_charges_on_document_level
|
|
441
|
+
)
|
|
442
|
+
)
|
|
443
|
+
)
|
|
444
|
+
)
|
|
445
|
+
if invoice.invoice_total_vat_amount_in_accounting_currency:
|
|
446
|
+
eslog_invoice.M_INVOIC.SG50.append(
|
|
447
|
+
ESLOG_G_SG50(
|
|
448
|
+
S_MOA=ESLOG_S_MOA(
|
|
449
|
+
C_C516=ESLOG_C_C516(
|
|
450
|
+
D_5025="2",
|
|
451
|
+
D_5004=invoice.invoice_total_vat_amount_in_accounting_currency
|
|
452
|
+
)
|
|
453
|
+
)
|
|
454
|
+
)
|
|
455
|
+
)
|
|
456
|
+
if invoice.paid_amount:
|
|
457
|
+
eslog_invoice.M_INVOIC.SG50.append(
|
|
458
|
+
ESLOG_G_SG50(
|
|
459
|
+
S_MOA=ESLOG_S_MOA(
|
|
460
|
+
C_C516=ESLOG_C_C516(
|
|
461
|
+
D_5025="113",
|
|
462
|
+
D_5004=invoice.paid_amount
|
|
463
|
+
)
|
|
464
|
+
)
|
|
465
|
+
)
|
|
466
|
+
)
|
|
467
|
+
if invoice.rounding_amount:
|
|
468
|
+
eslog_invoice.M_INVOIC.SG50.append(
|
|
469
|
+
ESLOG_G_SG50(
|
|
470
|
+
S_MOA=ESLOG_S_MOA(
|
|
471
|
+
C_C516=ESLOG_C_C516(
|
|
472
|
+
D_5025="366",
|
|
473
|
+
D_5004=invoice.rounding_amount
|
|
474
|
+
)
|
|
475
|
+
)
|
|
476
|
+
)
|
|
477
|
+
)
|
|
478
|
+
if invoice.invoice_total_vat_amount:
|
|
479
|
+
eslog_invoice.M_INVOIC.SG50.append(
|
|
480
|
+
ESLOG_G_SG50(
|
|
481
|
+
S_MOA=ESLOG_S_MOA(
|
|
482
|
+
C_C516=ESLOG_C_C516(
|
|
483
|
+
D_5025="176",
|
|
484
|
+
D_5004=invoice.invoice_total_vat_amount
|
|
485
|
+
)
|
|
486
|
+
)
|
|
487
|
+
)
|
|
488
|
+
)
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
xml_string = eslog_invoice.to_xml(
|
|
493
|
+
encoding="unicode",
|
|
494
|
+
)
|
|
495
|
+
return xml_string
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from .invoice import Invoice, Item, BusinessEntity, CEF_VAT_EXEMPTION
|
|
2
|
+
from .enums import (
|
|
3
|
+
VATPointDateCode,
|
|
4
|
+
BusinessProcessType,
|
|
5
|
+
ItemIdentificationScheme,
|
|
6
|
+
VATCategoryCode,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"Invoice",
|
|
11
|
+
"Item",
|
|
12
|
+
"BusinessEntity",
|
|
13
|
+
"CEF_VAT_EXEMPTION",
|
|
14
|
+
"VATPointDateCode",
|
|
15
|
+
"BusinessProcessType",
|
|
16
|
+
"ItemIdentificationScheme",
|
|
17
|
+
"VATCategoryCode",
|
|
18
|
+
]
|