|
@@ -136,6 +136,8 @@ class efactTest(unittest.TestCase):
|
|
|
# print(os.path.join(root_f, file))
|
|
|
tree = etree.parse(os.path.join(root_f, file))
|
|
|
root = tree.getroot()
|
|
|
+ inv_id = root.xpath('//cbc:ID', namespaces={'cbc': 'urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'})
|
|
|
+ inv_id = inv_id[0].text
|
|
|
parties = root.xpath('//cbc:RegistrationName', namespaces={'cbc': 'urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'})
|
|
|
for partie in parties:
|
|
|
parent_p_type = partie.getparent().getparent().getparent()
|
|
@@ -153,8 +155,8 @@ class efactTest(unittest.TestCase):
|
|
|
# print(parent_t_type)
|
|
|
if etree.QName(parent_t_type).localname == 'PartyTaxScheme' and etree.QName(parent_p_type).localname == account: # @UndefinedVariable
|
|
|
# print(partie_id.text)
|
|
|
- file_id = partie_id.text
|
|
|
- new_name = '{}_{}_{}_{}.xml'.format(file.replace('.xml', ''), file_id, file_partie, is_date)
|
|
|
+ file_partn_id = partie_id.text
|
|
|
+ new_name = '{}_{}_{}_{}.xml'.format(file.replace('.xml', ''), inv_id, file_partie, is_date)
|
|
|
current_path = os.path.join(root_f, file)
|
|
|
new_path = os.path.join(root_f, new_name)
|
|
|
#
|