facho/fe/fe.py (DianXMLExtensionSoftwareSecurityCode): nuevo extension para adicion de codigo de seguridad

FossilOrigin-Name: 947190c281ca816b6802654d91ca8480a4e7e3afac477997f8ccb2377d08f52a
This commit is contained in:
2020-05-23 20:47:32 +00:00
parent 33cc210ad4
commit 24b227710e
5 changed files with 48 additions and 4 deletions

View File

@@ -118,9 +118,12 @@ class FachoXML:
# construir las extensiones o adicionar en caso de indicar
for extension in self.extensions:
xpath, elements = extension.build(self)
for new_element in elements:
elem = self.find_or_create_element('/'+ root_tag + xpath)
self.builder.append(elem, new_element)
if isinstance(elements, str):
elem = self.set_element('/'+ root_tag + xpath, elements)
else:
for new_element in elements:
elem = self.find_or_create_element('/'+ root_tag + xpath)
self.builder.append(elem, new_element)
def fragment(self, xpath, append=False):
parent = self.find_or_create_element(xpath, append=append)