From c50f1df1e709e697b616df2796ddfdde9579ad17 Mon Sep 17 00:00:00 2001 From: bit4bit Date: Mon, 30 May 2022 19:26:44 +0000 Subject: [PATCH] se usa __eq__ en vez de same FossilOrigin-Name: 96875a241ba61f2072f531e8845ae7dd981c9739c5d322555035243214204e4f --- facho/fe/nomina/__init__.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/facho/fe/nomina/__init__.py b/facho/fe/nomina/__init__.py index aa03fb1..a1f523a 100644 --- a/facho/fe/nomina/__init__.py +++ b/facho/fe/nomina/__init__.py @@ -144,7 +144,7 @@ class Proveedor: ambiente = fexml.get_element_attribute(scopexml.xpath_from_root('/InformacionGeneral'), 'Ambiente') codigo_qr = f"https://catalogo-vpfe.dian.gov.co/document/searchqr?documentkey={cune}" - if InformacionGeneral.AMBIENTE_PRUEBAS.same(ambiente): + if InformacionGeneral.AMBIENTE_PRUEBAS == 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') @@ -219,9 +219,8 @@ class InformacionGeneral: class TIPO_AMBIENTE: valor: str - @classmethod - def same(cls, value): - return cls.valor == str(value) + def __eq__(self, other): + return self.valor == str(other) # TABLA 5.1.1 @dataclass @@ -243,9 +242,8 @@ class InformacionGeneral: class TIPO_XML: valor: str - @classmethod - def same(cls, value): - return cls.valor == str(value) + def __eq__(self, other): + return self.valor == str(other) @dataclass class TIPO_XML_NORMAL(TIPO_XML):