pyslog 0.1.0.dev7__tar.gz → 0.1.0.dev8__tar.gz
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-0.1.0.dev7 → pyslog-0.1.0.dev8}/PKG-INFO +1 -1
- {pyslog-0.1.0.dev7 → pyslog-0.1.0.dev8}/pyproject.toml +1 -1
- {pyslog-0.1.0.dev7 → pyslog-0.1.0.dev8}/src/pyslog/eslog2/generator.py +49 -21
- {pyslog-0.1.0.dev7 → pyslog-0.1.0.dev8}/src/pyslog/eslog2/models/_xml.py +8 -0
- {pyslog-0.1.0.dev7 → pyslog-0.1.0.dev8}/src/pyslog/eslog2/models/invoice.py +2 -1
- {pyslog-0.1.0.dev7 → pyslog-0.1.0.dev8}/README.md +0 -0
- {pyslog-0.1.0.dev7 → pyslog-0.1.0.dev8}/src/pyslog/__init__.py +0 -0
- {pyslog-0.1.0.dev7 → pyslog-0.1.0.dev8}/src/pyslog/eslog2/__init__.py +0 -0
- {pyslog-0.1.0.dev7 → pyslog-0.1.0.dev8}/src/pyslog/eslog2/models/__init__.py +0 -0
- {pyslog-0.1.0.dev7 → pyslog-0.1.0.dev8}/src/pyslog/eslog2/models/enums/__init__.py +0 -0
- {pyslog-0.1.0.dev7 → pyslog-0.1.0.dev8}/src/pyslog/eslog2/models/enums/business_process_type.py +0 -0
- {pyslog-0.1.0.dev7 → pyslog-0.1.0.dev8}/src/pyslog/eslog2/models/enums/item_identification_scheme.py +0 -0
- {pyslog-0.1.0.dev7 → pyslog-0.1.0.dev8}/src/pyslog/eslog2/models/enums/vat_category_code.py +0 -0
- {pyslog-0.1.0.dev7 → pyslog-0.1.0.dev8}/src/pyslog/eslog2/models/enums/vat_point_date_code.py +0 -0
- {pyslog-0.1.0.dev7 → pyslog-0.1.0.dev8}/src/pyslog/eslog2/schemas/eSLOG20_INVOIC_v200.xsd +0 -0
- {pyslog-0.1.0.dev7 → pyslog-0.1.0.dev8}/src/pyslog/eslog2/validator.py +0 -0
|
@@ -4,7 +4,10 @@ from pyslog.eslog2.models import (
|
|
|
4
4
|
)
|
|
5
5
|
from pyslog.eslog2.models._xml import *
|
|
6
6
|
|
|
7
|
-
def generate_eslog_invoice(
|
|
7
|
+
def generate_eslog_invoice(
|
|
8
|
+
invoice: Invoice,
|
|
9
|
+
pretty_print: bool = False,
|
|
10
|
+
) -> str:
|
|
8
11
|
eslog_buyer = ESLOG_G_SG2(
|
|
9
12
|
S_NAD=ESLOG_S_NAD(
|
|
10
13
|
D_3035="BY",
|
|
@@ -91,7 +94,11 @@ def generate_eslog_invoice(invoice: Invoice) -> str:
|
|
|
91
94
|
)
|
|
92
95
|
),
|
|
93
96
|
],
|
|
94
|
-
G_SG5=[
|
|
97
|
+
G_SG5=[]
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
if invoice.seller.contact_person_name:
|
|
101
|
+
eslog_seller.G_SG5 = [
|
|
95
102
|
ESLOG_G_SG5(
|
|
96
103
|
S_CTA=ESLOG_S_CTA(
|
|
97
104
|
D_3139="SU",
|
|
@@ -101,7 +108,6 @@ def generate_eslog_invoice(invoice: Invoice) -> str:
|
|
|
101
108
|
)
|
|
102
109
|
)
|
|
103
110
|
]
|
|
104
|
-
)
|
|
105
111
|
|
|
106
112
|
if invoice.seller.address_line_2 is not None:
|
|
107
113
|
eslog_seller.S_NAD.C_C059.D_3042_2 = invoice.seller.address_line_2
|
|
@@ -171,6 +177,7 @@ def generate_eslog_invoice(invoice: Invoice) -> str:
|
|
|
171
177
|
)
|
|
172
178
|
)
|
|
173
179
|
],
|
|
180
|
+
SG8=[],
|
|
174
181
|
SG26=[],
|
|
175
182
|
UNS=ESLOG_S_UNS(
|
|
176
183
|
D_0081="D"
|
|
@@ -287,14 +294,6 @@ def generate_eslog_invoice(invoice: Invoice) -> str:
|
|
|
287
294
|
)
|
|
288
295
|
)
|
|
289
296
|
),
|
|
290
|
-
ESLOG_G_SG27(
|
|
291
|
-
S_MOA=ESLOG_S_MOA(
|
|
292
|
-
C_C516=ESLOG_C_C516(
|
|
293
|
-
D_5025="38",
|
|
294
|
-
D_5004=item.total_monetary_amount_including_vat,
|
|
295
|
-
)
|
|
296
|
-
)
|
|
297
|
-
),
|
|
298
297
|
],
|
|
299
298
|
G_SG29=[
|
|
300
299
|
ESLOG_G_SG29(
|
|
@@ -307,16 +306,6 @@ def generate_eslog_invoice(invoice: Invoice) -> str:
|
|
|
307
306
|
)
|
|
308
307
|
)
|
|
309
308
|
),
|
|
310
|
-
ESLOG_G_SG29(
|
|
311
|
-
S_PRI=ESLOG_S_PRI(
|
|
312
|
-
C_C509=ESLOG_C_C509(
|
|
313
|
-
D_5125="AAB",
|
|
314
|
-
D_5118=item.item_gross_price,
|
|
315
|
-
D_5284=item.item_price_base_quantity,
|
|
316
|
-
D_6411=item.item_price_base_quantity_unit_of_measure_code,
|
|
317
|
-
)
|
|
318
|
-
)
|
|
319
|
-
),
|
|
320
309
|
],
|
|
321
310
|
G_SG30=[],
|
|
322
311
|
G_SG34=[
|
|
@@ -338,8 +327,46 @@ def generate_eslog_invoice(invoice: Invoice) -> str:
|
|
|
338
327
|
],
|
|
339
328
|
G_SG39=[],
|
|
340
329
|
)
|
|
330
|
+
if item.total_monetary_amount_including_vat:
|
|
331
|
+
eslog_item.G_SG27.append(
|
|
332
|
+
ESLOG_G_SG27(
|
|
333
|
+
S_MOA=ESLOG_S_MOA(
|
|
334
|
+
C_C516=ESLOG_C_C516(
|
|
335
|
+
D_5025="38",
|
|
336
|
+
D_5004=item.total_monetary_amount_including_vat,
|
|
337
|
+
)
|
|
338
|
+
)
|
|
339
|
+
)
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
if item.item_gross_price:
|
|
343
|
+
eslog_item.G_SG29.append(
|
|
344
|
+
ESLOG_G_SG29(
|
|
345
|
+
S_PRI=ESLOG_S_PRI(
|
|
346
|
+
C_C509=ESLOG_C_C509(
|
|
347
|
+
D_5125="AAB",
|
|
348
|
+
D_5118=item.item_gross_price,
|
|
349
|
+
D_5284=item.item_price_base_quantity,
|
|
350
|
+
D_6411=item.item_price_base_quantity_unit_of_measure_code,
|
|
351
|
+
)
|
|
352
|
+
)
|
|
353
|
+
)
|
|
354
|
+
)
|
|
355
|
+
|
|
341
356
|
eslog_invoice.M_INVOIC.SG26.append(eslog_item)
|
|
342
357
|
|
|
358
|
+
if invoice.payment_due_date:
|
|
359
|
+
eslog_invoice.M_INVOIC.SG8.append(
|
|
360
|
+
ESLOG_G_SG8(
|
|
361
|
+
S_PAT=ESLOG_S_PAT(D_4279="1"),
|
|
362
|
+
S_DTM=[
|
|
363
|
+
ESLOG_S_DTM(
|
|
364
|
+
C_C507=ESLOG_C_C507(D_2005="13", D_2380=invoice.payment_due_date)
|
|
365
|
+
)
|
|
366
|
+
]
|
|
367
|
+
)
|
|
368
|
+
)
|
|
369
|
+
|
|
343
370
|
if invoice.value_added_tax_point_date:
|
|
344
371
|
eslog_invoice.M_INVOIC.DTM.append(
|
|
345
372
|
ESLOG_S_DTM(
|
|
@@ -492,6 +519,7 @@ def generate_eslog_invoice(invoice: Invoice) -> str:
|
|
|
492
519
|
|
|
493
520
|
|
|
494
521
|
xml_string = eslog_invoice.to_xml(
|
|
522
|
+
pretty_print=pretty_print,
|
|
495
523
|
encoding="unicode",
|
|
496
524
|
)
|
|
497
525
|
return xml_string
|
|
@@ -119,6 +119,13 @@ class ESLOG_S_CUX(BaseXmlModel, tag="S_CUX"):
|
|
|
119
119
|
class ESLOG_G_SG7(BaseXmlModel, tag="G_SG7"):
|
|
120
120
|
S_CUX: ESLOG_S_CUX = element(tag="S_CUX")
|
|
121
121
|
|
|
122
|
+
class ESLOG_S_PAT(BaseXmlModel, tag="S_PAT"):
|
|
123
|
+
D_4279: str = element(name="D_4279")
|
|
124
|
+
|
|
125
|
+
class ESLOG_G_SG8(BaseXmlModel, tag="G_SG8"):
|
|
126
|
+
S_PAT: ESLOG_S_PAT = element(tag="S_PAT")
|
|
127
|
+
S_DTM: list[ESLOG_S_DTM] = element(tag="S_DTM")
|
|
128
|
+
|
|
122
129
|
class ESLOG_C_C212(BaseXmlModel, tag="C_C212"):
|
|
123
130
|
D_7140: str = element(name="D_7140")
|
|
124
131
|
D_7143: str = element(name="D_7143")
|
|
@@ -238,6 +245,7 @@ class ESLOG_M_INVOIC(BaseXmlModel, tag="M_INVOIC"):
|
|
|
238
245
|
SG1: list[ESLOG_G_SG1] = element(tag="G_SG1")
|
|
239
246
|
SG2: list[ESLOG_G_SG2] = element(tag="G_SG2")
|
|
240
247
|
SG7: list[ESLOG_G_SG7] = element(tag="G_SG7")
|
|
248
|
+
SG8: list[ESLOG_G_SG8] = element(tag="G_SG8")
|
|
241
249
|
SG26: list[ESLOG_G_SG26] = element(tag="G_SG26")
|
|
242
250
|
UNS: ESLOG_S_UNS = element(tag="S_UNS")
|
|
243
251
|
SG50: list[ESLOG_G_SG50] = element(tag="G_SG50")
|
|
@@ -16,7 +16,7 @@ class VATBreakdown(BaseModel):
|
|
|
16
16
|
taxable_amount: str = Field(description="VAT category taxable amount (BT-116). The sum of all Invoice line net amounts that are subject to a specific VAT category code and VAT category rate, minus all allowances on document level, plus all charges on document level.")
|
|
17
17
|
tax_amount: str = Field(description="VAT category tax amount (BT-117). The total VAT amount for a given VAT category.")
|
|
18
18
|
vat_category_code: VATCategoryCode = Field(description="VAT category code (BT-118). The code that applies to the VAT category.")
|
|
19
|
-
vat_category_rate: str
|
|
19
|
+
vat_category_rate: str = Field(default=None, description="VAT category rate (BT-119). The VAT rate, represented as a percentage that applies for the relevant VAT category.")
|
|
20
20
|
|
|
21
21
|
class BusinessEntity(BaseModel):
|
|
22
22
|
identifier: str | None = Field(default=None, description="Buyer identifier (BT-46)")
|
|
@@ -61,6 +61,7 @@ class Invoice(BaseModel):
|
|
|
61
61
|
invoice_number: str
|
|
62
62
|
invoice_issue_date: str
|
|
63
63
|
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.")
|
|
64
|
+
payment_due_date: str | None = Field(default=None, description="Payment due date (BT-9). The date on which the payment is due.")
|
|
64
65
|
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.")
|
|
65
66
|
actual_delivery_date: str | None = Field(default=None, description="Actual delivery date (BT-72). The date on which the delivery is made.")
|
|
66
67
|
invoicing_period_start_date: str | None = Field(default=None, description="Invoicing period start date (BT-73). The date on which the invoicing period starts.")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyslog-0.1.0.dev7 → pyslog-0.1.0.dev8}/src/pyslog/eslog2/models/enums/business_process_type.py
RENAMED
|
File without changes
|
{pyslog-0.1.0.dev7 → pyslog-0.1.0.dev8}/src/pyslog/eslog2/models/enums/item_identification_scheme.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyslog-0.1.0.dev7 → pyslog-0.1.0.dev8}/src/pyslog/eslog2/models/enums/vat_point_date_code.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|