se corrige NIE021
FossilOrigin-Name: ae3eae5bc793a328a0fd65a7172f65a243ed87f1a616f390fba4d721a0864875
This commit is contained in:
parent
e13896db28
commit
ab1646f156
@ -118,10 +118,15 @@ class Proveedor:
|
||||
def post_apply(self, fexml, fragment):
|
||||
cune_xpath = fexml.xpath_from_root('/InformacionGeneral')
|
||||
cune = fexml.get_element_attribute(cune_xpath, 'CUNE')
|
||||
# TODO(bit4bit) https://catalogo‐vpfe‐hab.dian.gov.co/document/searchqr?documentkey=CUNE para habilitacion
|
||||
# https://catalogo‐vpfe.dian.gov.co/document/searchqr?documentkey=CUNE
|
||||
codigo_qr = f"https://catalogo‐vpfe-hab.dian.gov.co/document/searchqr?documentkey={cune}"
|
||||
|
||||
ambiente = fexml.get_element_attribute(fexml.xpath_from_root('/InformacionGeneral'), 'Ambiente')
|
||||
codigo_qr = f"https://catalogo-vpfe.dian.gov.co/document/searchqr?documentkey={cune}"
|
||||
|
||||
if InformacionGeneral.AMBIENTE_PRUEBAS.same(ambiente):
|
||||
codigo_qr = f"https://catalogo-vpfe-hab.dian.gov.co/document/searchqr?documentkey={cune}"
|
||||
elif ambiente is None:
|
||||
raise RuntimeError('fail to get InformacionGeneral/@Ambiente')
|
||||
|
||||
fexml.set_element('./CodigoQR', codigo_qr)
|
||||
|
||||
# NIE020
|
||||
@ -181,17 +186,29 @@ class TipoMoneda:
|
||||
|
||||
@dataclass
|
||||
class InformacionGeneral:
|
||||
@dataclass
|
||||
class TIPO_AMBIENTE:
|
||||
pass
|
||||
valor: str
|
||||
|
||||
@classmethod
|
||||
def same(cls, value):
|
||||
return cls.valor == str(value)
|
||||
|
||||
# TABLA 5.1.1
|
||||
@dataclass
|
||||
class AMBIENTE_PRODUCCION(TIPO_AMBIENTE):
|
||||
valor: str = '1'
|
||||
|
||||
def __str__(self):
|
||||
self.valor
|
||||
|
||||
@dataclass
|
||||
class AMBIENTE_PRUEBAS(TIPO_AMBIENTE):
|
||||
valor: str = '2'
|
||||
|
||||
def __str__(self):
|
||||
self.valor
|
||||
|
||||
fecha_generacion: typing.Union[str, Fecha]
|
||||
hora_generacion: str
|
||||
periodo_nomina: PeriodoNomina
|
||||
|
@ -221,7 +221,7 @@ def test_nomina_xml():
|
||||
assert xml.get_element_text_or_attribute('/fe:NominaIndividual/ProveedorXML/@SoftwareID') == 'xx'
|
||||
assert xml.get_element_text_or_attribute('/fe:NominaIndividual/ProveedorXML/@fachoSoftwareSC') == 'xx12N00001'
|
||||
assert xml.get_element_text_or_attribute('/fe:NominaIndividual/ProveedorXML/@SoftwareSC') is not None
|
||||
assert xml.get_element_text_or_attribute('/fe:NominaIndividual/CodigoQR') == f"https://catalogo‐vpfe-hab.dian.gov.co/document/searchqr?documentkey={expected_cune}"
|
||||
assert xml.get_element_text_or_attribute('/fe:NominaIndividual/CodigoQR') == f"https://catalogo-vpfe.dian.gov.co/document/searchqr?documentkey={expected_cune}"
|
||||
assert xml.get_element_text_or_attribute('/fe:NominaIndividual/Empleador/@NIT') == '700085371'
|
||||
assert xml.get_element_text_or_attribute('/fe:NominaIndividual/Trabajador/@NumeroDocumento') == '800199436'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user