mikrowerk-edi-invoicing 0.3.0__tar.gz → 0.3.2__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.
- {mikrowerk_edi_invoicing-0.3.0/mikrowerk_edi_invoicing.egg-info → mikrowerk_edi_invoicing-0.3.2}/PKG-INFO +3 -2
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/cii_dom_parser/models/elements.py +2 -1
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/tests/test_parse_x_rechnung.py +2 -1
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/ubl_sax_parser/xml_ubl_sax_parser.py +19 -10
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2/mikrowerk_edi_invoicing.egg-info}/PKG-INFO +3 -2
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/setup.py +1 -1
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/LICENSE +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/README.md +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/__init__.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/cii_dom_parser/__init__.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/cii_dom_parser/dom_elements_helper.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/cii_dom_parser/models/__init__.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/cii_dom_parser/models/accounting.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/cii_dom_parser/models/container.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/cii_dom_parser/models/delivery.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/cii_dom_parser/models/document.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/cii_dom_parser/models/fields.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/cii_dom_parser/models/note.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/cii_dom_parser/models/party.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/cii_dom_parser/models/payment.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/cii_dom_parser/models/product.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/cii_dom_parser/models/references.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/cii_dom_parser/models/trade.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/cii_dom_parser/models/tradelines.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/cii_dom_parser/pdf.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/cii_dom_parser/utils.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/cii_dom_parser/xml_cii_dom_parser.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/cii_dom_parser/xmp_schema.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/cross_industry_invoice_mapper.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/model/__init__.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/model/x_rechnung.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/model/xml_abstract_x_rechnung_parser.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/tests/__init__.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/tests/test_iban_handling.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/ubl_sax_parser/__init__.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/util/__init__.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/util/file_helper.py +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/mikrowerk_edi_invoicing.egg-info/SOURCES.txt +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/mikrowerk_edi_invoicing.egg-info/dependency_links.txt +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/mikrowerk_edi_invoicing.egg-info/requires.txt +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/mikrowerk_edi_invoicing.egg-info/top_level.txt +0 -0
- {mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: mikrowerk_edi_invoicing
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Parser for EDI invoices in CII or UBL format
|
|
5
5
|
Author: Mikrowerk a Gammadata Division
|
|
6
6
|
Author-email: info@mikrowerk.com
|
|
@@ -28,6 +28,7 @@ Dynamic: classifier
|
|
|
28
28
|
Dynamic: description
|
|
29
29
|
Dynamic: description-content-type
|
|
30
30
|
Dynamic: license
|
|
31
|
+
Dynamic: license-file
|
|
31
32
|
Dynamic: requires-dist
|
|
32
33
|
Dynamic: summary
|
|
33
34
|
|
|
@@ -356,7 +356,8 @@ class DateTimeElement(StringElement):
|
|
|
356
356
|
if len(root) != 1:
|
|
357
357
|
raise TypeError("Date containers should have one child")
|
|
358
358
|
if root[0].tag != "{%s}%s" % (self._date_time_namespace, "DateTimeString"):
|
|
359
|
-
raise TypeError("Tag %s not recognized" % root[0].tag)
|
|
359
|
+
# raise TypeError("Tag %s not recognized" % root[0].tag)
|
|
360
|
+
print("TypeError: Tag %s not recognized" % root[0].tag)
|
|
360
361
|
self._format = root[0].attrib["format"]
|
|
361
362
|
if self._format == "102":
|
|
362
363
|
self._value = datetime.strptime(root[0].text, "%Y%m%d").date()
|
|
@@ -38,7 +38,8 @@ class XRechnungEinfachTestCase(unittest.TestCase):
|
|
|
38
38
|
('pdf', 'zugferd/BASIC-WL_Einfach/BASIC-WL_Einfach.pdf'),
|
|
39
39
|
# ('pdf', 'zugferd/XRECHNUNG_Einfach/XRECHNUNG_Einfach.pdf'), # needs some checks, why test failed
|
|
40
40
|
# ("pdf", "zugferd/XRECHNUNG_Elektron/XRECHNUNG_Elektron.pdf"), # needs some checks, why test failed
|
|
41
|
-
('pdf', 'odoo_generated/INV_2025_00001.pdf')
|
|
41
|
+
('pdf', 'odoo_generated/INV_2025_00001.pdf'),
|
|
42
|
+
|
|
42
43
|
])
|
|
43
44
|
def test_x_rechnung_files(self, file_type, file_path):
|
|
44
45
|
print(f"start testing with file: {file_path}")
|
|
@@ -29,11 +29,14 @@ class UblSaxHandler(sax.ContentHandler):
|
|
|
29
29
|
self.trade_line_list: [XRechnungTradeLine] = []
|
|
30
30
|
self.current_trade_tax: XRechnungAppliedTradeTax | None = None
|
|
31
31
|
self.applicable_trade_taxes: [XRechnungAppliedTradeTax] = []
|
|
32
|
+
self.allowance_line_count = 99900
|
|
33
|
+
self.allowance_line_count_incr = 10
|
|
32
34
|
|
|
33
35
|
def startDocument(self):
|
|
34
36
|
print("------------------------------ Start ---------------------------------------------------")
|
|
35
37
|
self.x_rechnung = XRechnung()
|
|
36
38
|
self.stack = deque()
|
|
39
|
+
self.allowance_line_count = 99900
|
|
37
40
|
|
|
38
41
|
def endDocument(self):
|
|
39
42
|
self.x_rechnung.name = (
|
|
@@ -45,6 +48,7 @@ class UblSaxHandler(sax.ContentHandler):
|
|
|
45
48
|
_ns, _tag_name = name
|
|
46
49
|
self.current_attributes = attrs
|
|
47
50
|
self.stack.append((_tag_name, attrs))
|
|
51
|
+
_path = '/'.join([tag for tag, _attrs in self.stack])
|
|
48
52
|
self.content = ""
|
|
49
53
|
match _tag_name:
|
|
50
54
|
case "Party":
|
|
@@ -59,15 +63,14 @@ class UblSaxHandler(sax.ContentHandler):
|
|
|
59
63
|
case "InvoiceLine":
|
|
60
64
|
self.current_trade_line = XRechnungTradeLine()
|
|
61
65
|
self.current_trade_tax = None
|
|
62
|
-
case "AllowanceCharge":
|
|
63
|
-
self.current_trade_line = XRechnungTradeLine()
|
|
64
|
-
self.current_trade_tax = None
|
|
65
66
|
case "TaxSubtotal":
|
|
66
67
|
self.current_trade_tax = XRechnungAppliedTradeTax()
|
|
67
68
|
case "ClassifiedTaxCategory":
|
|
68
69
|
self.current_trade_tax = XRechnungAppliedTradeTax()
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
case "AllowanceCharge":
|
|
71
|
+
if _path.endswith('Invoice/AllowanceCharge'):
|
|
72
|
+
self.current_trade_line = XRechnungTradeLine()
|
|
73
|
+
self.current_trade_tax = None
|
|
71
74
|
|
|
72
75
|
if _path.endswith('/AllowanceCharge/TaxCategory'):
|
|
73
76
|
self.current_trade_tax = XRechnungAppliedTradeTax()
|
|
@@ -90,7 +93,7 @@ class UblSaxHandler(sax.ContentHandler):
|
|
|
90
93
|
self.handle_payment_means(_path, _tag_name, _content, attrs)
|
|
91
94
|
if "/InvoiceLine" in _path:
|
|
92
95
|
self.handle_invoice_line(_path, _tag_name, _content, attrs)
|
|
93
|
-
if "/AllowanceCharge" in _path:
|
|
96
|
+
if "Invoice/AllowanceCharge" in _path:
|
|
94
97
|
self.handle_allowance_charge(_path, _tag_name, _content, attrs)
|
|
95
98
|
if "/ClassifiedTaxCategory" in _path:
|
|
96
99
|
self.handle_trade_tax(_path, _tag_name, _content, attrs)
|
|
@@ -114,8 +117,10 @@ class UblSaxHandler(sax.ContentHandler):
|
|
|
114
117
|
if _path.endswith("Invoice/TaxTotal/TaxSubtotal"):
|
|
115
118
|
self.applicable_trade_taxes.append(self.current_trade_tax)
|
|
116
119
|
elif _path.endswith('Invoice/AllowanceCharge'):
|
|
117
|
-
self.current_trade_line
|
|
118
|
-
|
|
120
|
+
if hasattr(self.current_trade_line, "trade_tax"):
|
|
121
|
+
self.current_trade_line.trade_tax = self.current_trade_tax
|
|
122
|
+
self.current_trade_line.line_id = f"{self.allowance_line_count}"
|
|
123
|
+
self.allowance_line_count += self.allowance_line_count_incr
|
|
119
124
|
self.current_trade_line.seller_assigned_id = "AllowanceCharge"
|
|
120
125
|
self.current_trade_line.total_amount_net = (
|
|
121
126
|
self.current_trade_line.price_unit * self.current_trade_line.quantity_billed)
|
|
@@ -139,6 +144,8 @@ class UblSaxHandler(sax.ContentHandler):
|
|
|
139
144
|
self.x_rechnung.doc_id = content
|
|
140
145
|
case "Invoice/IssueDate":
|
|
141
146
|
self.x_rechnung.issued_date_time = datetime.fromisoformat(content)
|
|
147
|
+
case "Invoice/Delivery/ActualDeliveryDate":
|
|
148
|
+
self.x_rechnung.delivered_date_time = datetime.fromisoformat(content)
|
|
142
149
|
case "Invoice/InvoiceTypeCode":
|
|
143
150
|
self.x_rechnung.doc_type_code = content
|
|
144
151
|
case "Invoice/DocumentCurrencyCode":
|
|
@@ -160,8 +167,8 @@ class UblSaxHandler(sax.ContentHandler):
|
|
|
160
167
|
self.x_rechnung.payment_means = self.current_payment_means_list[0]
|
|
161
168
|
case "Invoice/PaymentTerms/Note":
|
|
162
169
|
self.x_rechnung.payment_terms = content
|
|
163
|
-
case "Invoice/AllowanceCharge/Amount":
|
|
164
|
-
|
|
170
|
+
# case "Invoice/AllowanceCharge/Amount":
|
|
171
|
+
# self.x_rechnung.allowance_total_amount = Decimal(content)
|
|
165
172
|
case "Invoice/TaxTotal/TaxAmount":
|
|
166
173
|
self.x_rechnung.tax_total_amount = [XRechnungCurrency(Decimal(content),
|
|
167
174
|
attrs.get('currencyID', 'EUR'))]
|
|
@@ -244,6 +251,8 @@ class UblSaxHandler(sax.ContentHandler):
|
|
|
244
251
|
self.current_trade_line.total_amount_net = float(content)
|
|
245
252
|
elif path.endswith("/InvoiceLine/Item/Description"):
|
|
246
253
|
self.current_trade_line.description = content
|
|
254
|
+
elif path.endswith("/InvoiceLine/Note"):
|
|
255
|
+
self.current_trade_line.description += f", {content}" if len(content) > 0 else content
|
|
247
256
|
elif path.endswith("/InvoiceLine/Item/Name"):
|
|
248
257
|
self.current_trade_line.name = content
|
|
249
258
|
elif path.endswith("/InvoiceLine/Item/SellersItemIdentification/ID"):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: mikrowerk_edi_invoicing
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Parser for EDI invoices in CII or UBL format
|
|
5
5
|
Author: Mikrowerk a Gammadata Division
|
|
6
6
|
Author-email: info@mikrowerk.com
|
|
@@ -28,6 +28,7 @@ Dynamic: classifier
|
|
|
28
28
|
Dynamic: description
|
|
29
29
|
Dynamic: description-content-type
|
|
30
30
|
Dynamic: license
|
|
31
|
+
Dynamic: license-file
|
|
31
32
|
Dynamic: requires-dist
|
|
32
33
|
Dynamic: summary
|
|
33
34
|
|
|
File without changes
|
|
File without changes
|
{mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/model/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/tests/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mikrowerk_edi_invoicing-0.3.0 → mikrowerk_edi_invoicing-0.3.2}/edi_invoice_parser/util/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|