|
@@ -107,7 +107,7 @@ def get_from_xpath(root, tag, xpaths=None, namespaces=None):
|
|
result = root.xpath(xpath, namespaces=namespaces)
|
|
result = root.xpath(xpath, namespaces=namespaces)
|
|
if not result:
|
|
if not result:
|
|
return None
|
|
return None
|
|
- text_result = [e.text if isinstance(e, lxml.etree._Element) else e for e in result]
|
|
|
|
|
|
+ text_result = [e.text if isinstance(e, lxml.etree._Element) else e for e in result] # @UndefinedVariable
|
|
return ", ".join(text_result)
|
|
return ", ".join(text_result)
|
|
|
|
|
|
|
|
|
|
@@ -116,7 +116,7 @@ def get_namespaces():
|
|
"""
|
|
"""
|
|
global namespaces
|
|
global namespaces
|
|
if namespaces is None:
|
|
if namespaces is None:
|
|
- #print("loading namespace")
|
|
|
|
|
|
+ # print("loading namespace")
|
|
namespaces = en16931_namespaces()
|
|
namespaces = en16931_namespaces()
|
|
return namespaces
|
|
return namespaces
|
|
|
|
|
|
@@ -137,7 +137,7 @@ def get_xpaths():
|
|
"""
|
|
"""
|
|
global xpaths
|
|
global xpaths
|
|
if xpaths is None:
|
|
if xpaths is None:
|
|
- #print("loading xpaths")
|
|
|
|
|
|
+ # print("loading xpaths")
|
|
xpaths = en16931_xpaths()
|
|
xpaths = en16931_xpaths()
|
|
return xpaths
|
|
return xpaths
|
|
|
|
|
|
@@ -250,7 +250,7 @@ def en16931_xpaths():
|
|
xpaths["ponumber"] = "/xmlns:Invoice/cac:OrderReference/cbc:ID"
|
|
xpaths["ponumber"] = "/xmlns:Invoice/cac:OrderReference/cbc:ID"
|
|
xpaths["contract_number"] = "/xmlns:Invoice/cac:ContractDocumentReference/cbc:ID"
|
|
xpaths["contract_number"] = "/xmlns:Invoice/cac:ContractDocumentReference/cbc:ID"
|
|
# relative to invoice_lines/discounts
|
|
# relative to invoice_lines/discounts
|
|
- #xpaths["line_discount_percent"] = "cbc:MultiplierFactorNumeric"
|
|
|
|
|
|
+ # xpaths["line_discount_percent"] = "cbc:MultiplierFactorNumeric"
|
|
xpaths["line_discount_text"] = "cbc:AllowanceChargeReason"
|
|
xpaths["line_discount_text"] = "cbc:AllowanceChargeReason"
|
|
xpaths["line_discount_amount"] = "cbc:Amount"
|
|
xpaths["line_discount_amount"] = "cbc:Amount"
|
|
# relative to invoice_lines/charges
|
|
# relative to invoice_lines/charges
|