Compare commits
	
		
			54 Commits
		
	
	
		
			master
			...
			NominaHabi
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| e539f1e0a7 | |||
| 7972a3f59c | |||
| 20d8f4284f | |||
| c49e67b8a6 | |||
| 7672ae4b7f | |||
| 25c5fda3f0 | |||
| a758b8678b | |||
| 3a385c63e3 | |||
| 9b33b4486c | |||
| 612aae1f86 | |||
| 4fe82daac6 | |||
| e237d1b45f | |||
| 8cc6146be2 | |||
| f98ab98c9c | |||
| d04596ed3a | |||
| 9297be22e0 | |||
|  | 30773e042b | ||
|  | c919d8e36c | ||
| fb44498e53 | |||
| 9f7349ccee | |||
| 9cc41e1c5d | |||
| fc75126ca0 | |||
| d061077b30 | |||
| a3d2176068 | |||
| 98677bc162 | |||
| 398d27d049 | |||
| 8765a3d2c8 | |||
| 1935ed3048 | |||
| 097cf97fc3 | |||
| de99633211 | |||
|  | 028cf8b687 | ||
| e7a3976b14 | |||
| f08954ee43 | |||
| a0321020c7 | |||
| dde24b9739 | |||
| 6e5d358c73 | |||
| c12d985f76 | |||
| 9c126d961b | |||
| 95f16b2842 | |||
| 8f327f7abc | |||
|  | b7c9f2b201 | ||
| 7f974b7077 | |||
| 78477de2c2 | |||
|   | 75b41379c4 | ||
|   | d26cc2bef7 | ||
|   | 1abf34d4f0 | ||
|  | 3862b3e934 | ||
|   | 5cf929cca9 | ||
|   | 7e51726a0d | ||
|  | f05eb61d6e | ||
|  | 5a045ccdef | ||
|   | bd0fe70f33 | ||
|   | 7c4c9648fe | ||
|  | 5eecae0740 | 
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -215,3 +215,4 @@ tags | ||||
| pyvenv.cfg | ||||
| .venv | ||||
| pip-selfcheck.json | ||||
| invoice.xml | ||||
| @@ -57,17 +57,6 @@ If you are proposing a feature: | ||||
| Get Started! | ||||
| ------------ | ||||
|  | ||||
| Using docker | ||||
| ------------ | ||||
|  | ||||
| 1. make -f Makefile.dev dev-setup | ||||
|    1. make -f Makefile.dev dev-shell | ||||
| 2. make -f Makefile.dev test | ||||
| 3. make -f Makefile.dev tox | ||||
|  | ||||
| From Source Code | ||||
| ----------- | ||||
|  | ||||
| Ready to contribute? Here's how to set up `facho` for local development. | ||||
|  | ||||
| 1. Fork the `facho` repo . | ||||
| @@ -105,7 +94,6 @@ Ready to contribute? Here's how to set up `facho` for local development. | ||||
|  | ||||
| 7. Submit a pull request through the GitHub website. | ||||
|  | ||||
|  | ||||
| Pull Request Guidelines | ||||
| ----------------------- | ||||
|  | ||||
|   | ||||
							
								
								
									
										19
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								Dockerfile
									
									
									
									
									
								
							| @@ -2,23 +2,16 @@ | ||||
| FROM ubuntu:18.04 | ||||
|  | ||||
| RUN apt-get -qq update | ||||
|  | ||||
| RUN apt install software-properties-common -y \ | ||||
|     && add-apt-repository ppa:deadsnakes/ppa | ||||
|  | ||||
| RUN apt-get install -y --no-install-recommends \ | ||||
|   python3.7 python3.7-distutils python3.7-dev \ | ||||
|   python3.8 python3.8-distutils python3.8-dev \ | ||||
|   python3.9 python3.9-distutils python3.9-dev \ | ||||
|   python3.10 python3.10-distutils python3.10-dev \ | ||||
|   wget \ | ||||
|   ca-certificates | ||||
|  | ||||
| RUN wget https://bootstrap.pypa.io/get-pip.py \ | ||||
|   && python3.7 get-pip.py pip==22.2.2 \ | ||||
|   && python3.8 get-pip.py pip==22.2.2 \ | ||||
|   && python3.9 get-pip.py pip==22.2.2 \ | ||||
|   && python3.10 get-pip.py pip==22.2.2 \ | ||||
|   && python3 get-pip.py pip==21.3 \ | ||||
|   && python3.7 get-pip.py pip==21.3 \ | ||||
|   && python3.8 get-pip.py pip==21.3 \ | ||||
|   && rm get-pip.py | ||||
|  | ||||
| RUN apt-get install -y --no-install-recommends \ | ||||
| @@ -27,14 +20,12 @@ RUN apt-get install -y --no-install-recommends \ | ||||
|         build-essential \ | ||||
|         zip | ||||
|  | ||||
| RUN python3.6 --version | ||||
| RUN python3.7 --version | ||||
| RUN python3.8 --version | ||||
| RUN python3.9 --version | ||||
| RUN python3.10 --version | ||||
|  | ||||
| RUN pip3.6 install setuptools setuptools-rust | ||||
| RUN pip3.7 install setuptools setuptools-rust | ||||
| RUN pip3.8 install setuptools setuptools-rust | ||||
| RUN pip3.9 install setuptools setuptools-rust | ||||
| RUN pip3.10 install setuptools setuptools-rust | ||||
|  | ||||
| RUN pip3 install tox pytest | ||||
|   | ||||
| @@ -11,6 +11,9 @@ | ||||
| dev-setup: | ||||
| 	docker build -t facho . | ||||
|  | ||||
| py-develop: | ||||
| 	docker run -t -v $(PWD):/app -w /app facho sh -c 'python3.7 setup.py develop --user' | ||||
|  | ||||
| dev-shell: | ||||
| 	docker run --rm -ti -v "$(PWD):/app" -w /app --name facho-cli facho bash | ||||
|  | ||||
|   | ||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										123
									
								
								examples/habilitacion/N000001.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										123
									
								
								examples/habilitacion/N000001.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,123 @@ | ||||
|  | ||||
| from facho import fe | ||||
|  | ||||
| SOFTWARE_PIN='20234' | ||||
| SOFTWARE_ID='100b0d10-0ca0-4ad4-a894-b704a568cbf3' | ||||
| NIT='901575528' | ||||
| DV='2' | ||||
|  | ||||
| def extensions(nomina): | ||||
|     return [] | ||||
|  | ||||
| def nomina(): | ||||
|     nomina = fe.nomina.DIANNominaIndividual() | ||||
|  | ||||
|     nomina.asignar_fecha_pago('2024-04-30') | ||||
|  | ||||
|     nomina.asignar_metadata(fe.nomina.Metadata( | ||||
|     novedad=fe.nomina.Novedad(value='false'), | ||||
|         secuencia=fe.nomina.NumeroSecuencia( | ||||
|             prefijo='N', | ||||
|             consecutivo='000001' | ||||
|         ), | ||||
|         lugar_generacion=fe.nomina.Lugar( | ||||
|             pais = fe.nomina.Pais( | ||||
|                 code = 'CO' | ||||
|             ), | ||||
|             departamento = fe.nomina.Departamento( | ||||
|                 code = '05' | ||||
|             ), | ||||
|             municipio = fe.nomina.Municipio( | ||||
|                 code = '05001' | ||||
|             ), | ||||
|         ), | ||||
|         proveedor=fe.nomina.Proveedor( | ||||
| 	    razon_social='BICI PIZZA S.A.S', | ||||
|             nit=NIT, | ||||
|             dv=DV, | ||||
|             software_id=SOFTWARE_ID, | ||||
|             software_pin=SOFTWARE_PIN | ||||
|         ) | ||||
|     )) | ||||
|  | ||||
|     nomina.asignar_periodo(fe.nomina.Periodo( | ||||
|         fecha_ingreso= '2022-01-05', | ||||
|         fecha_liquidacion_inicio='2024-04-01', | ||||
|         fecha_liquidacion_fin='2024-04-30', | ||||
|         fecha_generacion='2024-04-30' | ||||
|     )) | ||||
|  | ||||
|     nomina.asignar_informacion_general(fe.nomina.InformacionGeneral( | ||||
|         fecha_generacion = '2024-04-30', | ||||
|         hora_generacion = '08:01:00-05:00', | ||||
|         tipo_ambiente = fe.nomina.InformacionGeneral.AMBIENTE_PRUEBAS, | ||||
|         software_pin = SOFTWARE_PIN, | ||||
|         periodo_nomina = fe.nomina.PeriodoNomina(code='1'), | ||||
|         tipo_moneda = fe.nomina.TipoMoneda(code='COP') | ||||
|     )) | ||||
|  | ||||
|     nomina.asignar_pago(fe.nomina.Pago( | ||||
|         forma=fe.nomina.FormaPago( | ||||
|             code='1', | ||||
|         ), | ||||
|         metodo=fe.nomina.MetodoPago( | ||||
|             code='10' | ||||
|         ) | ||||
|     )) | ||||
|     nomina.asignar_empleador(fe.nomina.Empleador( | ||||
| 	razon_social='BICI PIZZA S.A.S', | ||||
|         nit = NIT, | ||||
|         dv = DV, | ||||
|         pais = fe.nomina.Pais( | ||||
|             code = 'CO' | ||||
|         ), | ||||
|         departamento = fe.nomina.Departamento( | ||||
|             code = '05' | ||||
|         ), | ||||
|         municipio = fe.nomina.Municipio( | ||||
|             code = '05001' | ||||
|         ), | ||||
|         direccion = 'calle etrivial' | ||||
|     )) | ||||
|  | ||||
|     nomina.asignar_trabajador(fe.nomina.Trabajador( | ||||
|         tipo_contrato = fe.nomina.TipoContrato( | ||||
|             code = '1' | ||||
|         ), | ||||
|         alto_riesgo = False, | ||||
|         tipo_documento = fe.nomina.TipoDocumento( | ||||
|             code = '11' | ||||
|         ), | ||||
|         primer_apellido = 'GONZALEZ', | ||||
|         segundo_apellido = '', | ||||
|         primer_nombre = 'JUAN', | ||||
|         lugar_trabajo = fe.nomina.LugarTrabajo( | ||||
|             pais = fe.nomina.Pais(code='CO'), | ||||
|             departamento = fe.nomina.Departamento(code='05'), | ||||
|             municipio = fe.nomina.Municipio(code='05001'), | ||||
|             direccion = 'CL 35C 102-17 BL 7 AP 101' | ||||
|         ), | ||||
|         numero_documento = NIT, | ||||
|         tipo = fe.nomina.TipoTrabajador( | ||||
|             code = '01' | ||||
|         ), | ||||
|         salario_integral = False, | ||||
|         sueldo = fe.nomina.Amount(2400000) | ||||
|     )) | ||||
|  | ||||
|     nomina.adicionar_devengado(fe.nomina.DevengadoBasico( | ||||
|         dias_trabajados = 30, | ||||
|         sueldo_trabajado = fe.nomina.Amount(2400000) | ||||
|     )) | ||||
|  | ||||
|     nomina.adicionar_deduccion(fe.nomina.DeduccionSalud( | ||||
|         porcentaje = fe.nomina.Amount(4), | ||||
|         deduccion = fe.nomina.Amount(96000) | ||||
|     )) | ||||
|  | ||||
|     nomina.adicionar_deduccion(fe.nomina.DeduccionFondoPension( | ||||
|         porcentaje=fe.nomina.Amount(4), | ||||
|         deduccion = fe.nomina.Amount(96000) | ||||
|     )) | ||||
|     return nomina | ||||
|      | ||||
							
								
								
									
										89
									
								
								examples/habilitacion/N000001.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										89
									
								
								examples/habilitacion/N000001.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,89 @@ | ||||
| <?xml version='1.0' encoding='UTF-8'?> | ||||
| <NominaIndividual xmlns:atd="urn:oasis:names:specification:ubl:schema:xsd:AttachedDocument-2" xmlns="dian:gov:co:facturaelectronica:NominaIndividual" xmlns:fe="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cdt="urn:DocumentInformation:names:specification:ubl:colombia:schema:xsd:DocumentInformationAggregateComponents-1" xmlns:clm54217="urn:un:unece:uncefact:codelist:specification:54217:2001" xmlns:clmIANAMIMEMediaType="urn:un:unece:uncefact:codelist:specification:IANAMIMEMediaType:2003" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:sts="dian:gov:co:facturaelectronica:Structures-2-1" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" xmlns:xades141="http://uri.etsi.org/01903/v1.4.1#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:sig="http://www.w3.org/2000/09/xmldsig#" SchemaLocation="" xsi:schemaLocation="dian:gov:co:facturaelectronica:NominaIndividual NominaIndividualElectronicaXSD.xsd"><ext:UBLExtensions><ext:UBLExtension><ext:ExtensionContent><ds:Signature Id="xmlsig-2e62ccd5-82d2-4922-90a0-31af30fc44c0"> | ||||
| <ds:SignedInfo> | ||||
| <ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/> | ||||
| <ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/> | ||||
| <ds:Reference Id="xmldsig-2e62ccd5-82d2-4922-90a0-31af30fc44c0-ref0" URI=""> | ||||
| <ds:Transforms> | ||||
| <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> | ||||
| </ds:Transforms> | ||||
| <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> | ||||
| <ds:DigestValue>HS3rmJgPKyCNLNO3TXfP0s1zIGvJTjq40JfMm/muHLA=</ds:DigestValue> | ||||
| </ds:Reference> | ||||
| <ds:Reference Id="xmldsig-2e62ccd5-82d2-4922-90a0-31af30fc44c0-ref1" URI="#xmldsig-2e62ccd5-82d2-4922-90a0-31af30fc44c0-KeyInfo"> | ||||
| <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> | ||||
| <ds:DigestValue>88R+0zjb6NIUiHhT8EE1ale8bO+TR6SSQBtVQUYkZ6c=</ds:DigestValue> | ||||
| </ds:Reference> | ||||
| <ds:Reference URI="#xmldsig-2e62ccd5-82d2-4922-90a0-31af30fc44c0-signedprops" Type="http://uri.etsi.org/01903#SignedProperties"> | ||||
| <ds:Transforms> | ||||
| <ds:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/> | ||||
| </ds:Transforms> | ||||
| <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> | ||||
| <ds:DigestValue>QF0d+RznylwnbFaGclqPWLndUo35HVDouEYoS1wfVO8=</ds:DigestValue> | ||||
| </ds:Reference> | ||||
| </ds:SignedInfo> | ||||
| <ds:SignatureValue>0JBFsBhyo4r/9m5vuBXbKirHOgniDNeGW3RNXpCE/sgXvrV3E4K8/M4HeO0VYtM0 | ||||
| G4bHvvkP2NCkdrKgZ9gB+XG8E/rEmJnwKpHm2kaNnpM1pYGoqBNWpqCa5FnUsEk4 | ||||
| c4BmBaKjmBSUrz+2JoOg1RKaaJumqGWm83IjWWJq9b4l40imL0XIgoTmWUtIGOA0 | ||||
| swm5rokLFldHv9T9CQvuYqCQIb6GAb2HB/GzNcPVO6quCqNVI6K9+Zh6vNpWpnCW | ||||
| crP8iCn4T3jo2PxU56dwA63xOtkTdYWphaGL4J63flsZysPQ817uuHV/XLu1VwHE | ||||
| cBpcTWyXL9LB7rgqrVSIzw==</ds:SignatureValue> | ||||
| <ds:KeyInfo Id="xmldsig-2e62ccd5-82d2-4922-90a0-31af30fc44c0-KeyInfo"> | ||||
| <ds:X509Data> | ||||
| <ds:X509Certificate>MIIH8TCCBdmgAwIBAgIIQxaPJd4YTlMwDQYJKoZIhvcNAQELBQAwgbYxIzAhBgkq | ||||
| hkiG9w0BCQEWFGluZm9AYW5kZXNzY2QuY29tLmNvMSYwJAYDVQQDEx1DQSBBTkRF | ||||
| UyBTQ0QgUy5BLiBDbGFzZSBJSSB2MzEwMC4GA1UECxMnRGl2aXNpb24gZGUgY2Vy | ||||
| dGlmaWNhY2lvbiBlbnRpZGFkIGZpbmFsMRIwEAYDVQQKEwlBbmRlcyBTQ0QxFDAS | ||||
| BgNVBAcTC0JvZ290YSBELkMuMQswCQYDVQQGEwJDTzAeFw0yNDA1MTYwNTAwMDBa | ||||
| Fw0yNTA1MTYwNDU5MDBaMIIBQDEtMCsGA1UECRMkVFYgNDYgQyA0MiBFU1RFIDc4 | ||||
| OSBDT1JSIFNBTlRBIEVMRU5BMSIwIAYJKoZIhvcNAQkBFhNiaWNpcGl6emFAZ21h | ||||
| aWwuY29tMRowGAYDVQQDExFCSUNJIFBJWlpBIFMuQS5TLjETMBEGA1UEBRMKOTAx | ||||
| NTc1NTI4MjE2MDQGA1UEDBMtRW1pc29yIEZhY3R1cmEgRWxlY3Ryb25pY2EgLSBQ | ||||
| ZXJzb25hIEp1cmlkaWNhMTswOQYDVQQLEzJFbWl0aWRvIHBvciBBbmRlcyBTQ0Qg | ||||
| QWMgMjYgNjkgQyAwMyBUb3JyZSBCIE9mIDcwMTEQMA4GA1UEChMHR0VSRU5URTES | ||||
| MBAGA1UEBwwJTUVERUxMw41OMRIwEAYDVQQIEwlBTlR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||||
| hT4f5CoO2M8qcG+CH7HnkaOHrSuK</ds:X509Certificate> | ||||
| </ds:X509Data> | ||||
| <ds:KeyValue> | ||||
| <ds:RSAKeyValue> | ||||
| <ds:Modulus>5J1O+4ZedrSBUsb+9tjNPHI9RGeIJcJl3Wc/208OqMYcCwGLUkrYBgH78E7IayD5 | ||||
| /wra04OU57cS1/+/yBUWYR60oqkaH2/8OXkJMqmjisVM/b58m7zyMw4TAF8N/Pbs | ||||
| wnrKukFU2acxISwTLu36HC4hshWw8bEGP54szvv1xnwqcOAWNBCxcBuc9k1JD+SI | ||||
| iqqPwHKh+6EDIooujo0H15w3rAxkHQRvYe6/IrpvH2sqJl1I3dLv0iqy9+d2l891 | ||||
| KBA9Yebdw7m/+ufu+eqs+0zKrwV6QLhRFmceHzEkPMTFepc2COGf80OUNbI6WWns | ||||
| pvDK97D8YG0MeifPYveIPw==</ds:Modulus> | ||||
| <ds:Exponent>AQAB</ds:Exponent> | ||||
| </ds:RSAKeyValue> | ||||
| </ds:KeyValue> | ||||
| </ds:KeyInfo> | ||||
| <ds:Object><xades:QualifyingProperties Target="#xmlsig-2e62ccd5-82d2-4922-90a0-31af30fc44c0" Id="XadesObjects"><xades:SignedProperties Id="xmldsig-2e62ccd5-82d2-4922-90a0-31af30fc44c0-signedprops"><xades:SignedSignatureProperties><xades:SigningTime>2025-03-16T16:49:57.777363</xades:SigningTime><xades:SigningCertificate><xades:Cert><xades:CertDigest><ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/><ds:DigestValue>YcIPspAVFcNg+B/galYrdCLYvLIEwFI4KWdSzcuupPY=</ds:DigestValue></xades:CertDigest><xades:IssuerSerial><ds:X509IssuerName>C=CO, L=Bogota D.C., O=Andes SCD, OU=Division de certificacion entidad final, CN=CA ANDES SCD S.A. Clase II v3, OID.1.2.840.113549.1.9.1=info@andesscd.com.co</ds:X509IssuerName><ds:X509SerialNumber>4834208642831502931</ds:X509SerialNumber></xades:IssuerSerial></xades:Cert></xades:SigningCertificate><xades:SignaturePolicyIdentifier><xades:SignaturePolicyId><xades:SigPolicyId><xades:Identifier>https://facturaelectronica.dian.gov.co/politicadefirma/v2/politicadefirmav2.pdf</xades:Identifier><xades:Description>Política de firma para facturas electrónicas de la República de Colombia.</xades:Description></xades:SigPolicyId><xades:SigPolicyHash><ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/><ds:DigestValue>dMoMvtcG5aIzgYo0tIsSQeVJBDnUnfSOfBpxXrmor0Y=</ds:DigestValue></xades:SigPolicyHash></xades:SignaturePolicyId></xades:SignaturePolicyIdentifier><xades:SignerRole><xades:ClaimedRoles><xades:ClaimedRole>supplier</xades:ClaimedRole></xades:ClaimedRoles></xades:SignerRole></xades:SignedSignatureProperties></xades:SignedProperties></xades:QualifyingProperties></ds:Object></ds:Signature></ext:ExtensionContent></ext:UBLExtension></ext:UBLExtensions><Novedad CUNENov="false">false</Novedad><Periodo FechaIngreso="2022-01-05" FechaLiquidacionInicio="2024-04-01" FechaLiquidacionFin="2024-04-30" TiempoLaborado="1" FechaGen="2024-04-30"/><NumeroSecuenciaXML Prefijo="N" Consecutivo="000001" Numero="N000001"/><LugarGeneracionXML Pais="CO" DepartamentoEstado="05" MunicipioCiudad="05001" Idioma="es"/><ProveedorXML NIT="901575528" DV="2" SoftwareID="100b0d10-0ca0-4ad4-a894-b704a568cbf3" RazonSocial="BICI PIZZA S.A.S" SoftwareSC="277c710304542320e15609646371219dc9ac3edd9c73adc0a278a355fbef97609bb7e451b92900b517044443f6ae1838"/><CodigoQR>https://catalogo-vpfe-hab.dian.gov.co/document/searchqr?documentkey=f498037db4d2f7c42224fbdc958d031927f17f0ad4e4c1f4a3e85d6363d68f3f951860873e6899937c080f03b0bd0ceb</CodigoQR><InformacionGeneral Version="V1.0: Documento Soporte de Pago de Nómina Electrónica" Ambiente="2" TipoXML="102" EncripCUNE="CUNE-SHA384" FechaGen="2024-04-30" HoraGen="08:01:00-05:00" PeriodoNomina="1" TipoMoneda="COP" TRM="0" CUNE="f498037db4d2f7c42224fbdc958d031927f17f0ad4e4c1f4a3e85d6363d68f3f951860873e6899937c080f03b0bd0ceb"/><Empleador NIT="901575528" DV="2" Pais="CO" DepartamentoEstado="05" MunicipioCiudad="05001" Direccion="calle etrivial" RazonSocial="BICI PIZZA S.A.S"/><Trabajador TipoTrabajador="01" SubTipoTrabajador="00" AltoRiesgoPension="false" TipoDocumento="11" NumeroDocumento="901575528" PrimerApellido="GONZALEZ" SegundoApellido="" PrimerNombre="JUAN" LugarTrabajoPais="CO" LugarTrabajoDepartamentoEstado="05" LugarTrabajoMunicipioCiudad="05001" LugarTrabajoDireccion="CL 35C 102-17 BL 7 AP 101" SalarioIntegral="false" TipoContrato="1" Sueldo="2400000.0"/><Pago Forma="1" Metodo="10"/><FechasPagos><FechaPago>2024-04-30</FechaPago></FechasPagos><Devengados><Basico DiasTrabajados="30" SueldoTrabajado="2400000.00"/></Devengados><Deducciones><Salud Porcentaje="4.00" Deduccion="96000.0"/><FondoPension Porcentaje="4.00" Deduccion="96000.0"/></Deducciones><Redondeo>0</Redondeo><DevengadosTotal>2400000.00</DevengadosTotal><DeduccionesTotal>192000.00</DeduccionesTotal><ComprobanteTotal>2208000.00</ComprobanteTotal></NominaIndividual> | ||||
							
								
								
									
										
											BIN
										
									
								
								examples/habilitacion/N000001.zip
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								examples/habilitacion/N000001.zip
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										123
									
								
								examples/habilitacion/N000002.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										123
									
								
								examples/habilitacion/N000002.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,123 @@ | ||||
|  | ||||
| from facho import fe | ||||
|  | ||||
| SOFTWARE_PIN='20234' | ||||
| SOFTWARE_ID='100b0d10-0ca0-4ad4-a894-b704a568cbf3' | ||||
| NIT='901575528' | ||||
| DV='2' | ||||
|  | ||||
| def extensions(nomina): | ||||
|     return [] | ||||
|  | ||||
| def nomina(): | ||||
|     nomina = fe.nomina.DIANNominaIndividual() | ||||
|  | ||||
|     nomina.asignar_fecha_pago('2024-04-30') | ||||
|  | ||||
|     nomina.asignar_metadata(fe.nomina.Metadata( | ||||
|     novedad=fe.nomina.Novedad(value='false'), | ||||
|         secuencia=fe.nomina.NumeroSecuencia( | ||||
|             prefijo='N', | ||||
|             consecutivo='000002' | ||||
|         ), | ||||
|         lugar_generacion=fe.nomina.Lugar( | ||||
|             pais = fe.nomina.Pais( | ||||
|                 code = 'CO' | ||||
|             ), | ||||
|             departamento = fe.nomina.Departamento( | ||||
|                 code = '05' | ||||
|             ), | ||||
|             municipio = fe.nomina.Municipio( | ||||
|                 code = '05001' | ||||
|             ), | ||||
|         ), | ||||
|         proveedor=fe.nomina.Proveedor( | ||||
| 	    razon_social='BICI PIZZA S.A.S', | ||||
|             nit=NIT, | ||||
|             dv=DV, | ||||
|             software_id=SOFTWARE_ID, | ||||
|             software_pin=SOFTWARE_PIN | ||||
|         ) | ||||
|     )) | ||||
|  | ||||
|     nomina.asignar_periodo(fe.nomina.Periodo( | ||||
|         fecha_ingreso= '2022-09-05', | ||||
|         fecha_liquidacion_inicio='2024-04-01', | ||||
|         fecha_liquidacion_fin='2024-04-30', | ||||
|         fecha_generacion='2024-04-30' | ||||
|     )) | ||||
|  | ||||
|     nomina.asignar_informacion_general(fe.nomina.InformacionGeneral( | ||||
|         fecha_generacion = '2024-04-30', | ||||
|         hora_generacion = '08:01:00-05:00', | ||||
|         tipo_ambiente = fe.nomina.InformacionGeneral.AMBIENTE_PRUEBAS, | ||||
|         software_pin = SOFTWARE_PIN, | ||||
|         periodo_nomina = fe.nomina.PeriodoNomina(code='1'), | ||||
|         tipo_moneda = fe.nomina.TipoMoneda(code='COP') | ||||
|     )) | ||||
|  | ||||
|     nomina.asignar_pago(fe.nomina.Pago( | ||||
|         forma=fe.nomina.FormaPago( | ||||
|             code='1', | ||||
|         ), | ||||
|         metodo=fe.nomina.MetodoPago( | ||||
|             code='10' | ||||
|         ) | ||||
|     )) | ||||
|     nomina.asignar_empleador(fe.nomina.Empleador( | ||||
| 	razon_social='BICI PIZZA S.A.S', | ||||
|         nit = NIT, | ||||
|         dv = DV, | ||||
|         pais = fe.nomina.Pais( | ||||
|             code = 'CO' | ||||
|         ), | ||||
|         departamento = fe.nomina.Departamento( | ||||
|             code = '05' | ||||
|         ), | ||||
|         municipio = fe.nomina.Municipio( | ||||
|             code = '05001' | ||||
|         ), | ||||
|         direccion = 'calle etrivial' | ||||
|     )) | ||||
|  | ||||
|     nomina.asignar_trabajador(fe.nomina.Trabajador( | ||||
|         tipo_contrato = fe.nomina.TipoContrato( | ||||
|             code = '1' | ||||
|         ), | ||||
|         alto_riesgo = False, | ||||
|         tipo_documento = fe.nomina.TipoDocumento( | ||||
|             code = '11' | ||||
|         ), | ||||
|         primer_apellido = 'GIRALDO', | ||||
|         segundo_apellido = '', | ||||
|         primer_nombre = 'VIVIANA', | ||||
|         lugar_trabajo = fe.nomina.LugarTrabajo( | ||||
|             pais = fe.nomina.Pais(code='CO'), | ||||
|             departamento = fe.nomina.Departamento(code='05'), | ||||
|             municipio = fe.nomina.Municipio(code='05001'), | ||||
|             direccion = 'CL 35C 102-17 BL 7 AP 101' | ||||
|         ), | ||||
|         numero_documento = NIT, | ||||
|         tipo = fe.nomina.TipoTrabajador( | ||||
|             code = '01' | ||||
|         ), | ||||
|         salario_integral = False, | ||||
|         sueldo = fe.nomina.Amount(1160000) | ||||
|     )) | ||||
|  | ||||
|     nomina.adicionar_devengado(fe.nomina.DevengadoBasico( | ||||
|         dias_trabajados = 30, | ||||
|         sueldo_trabajado = fe.nomina.Amount(1160000) | ||||
|     )) | ||||
|  | ||||
|     nomina.adicionar_deduccion(fe.nomina.DeduccionSalud( | ||||
|         porcentaje = fe.nomina.Amount(4), | ||||
|         deduccion = fe.nomina.Amount(46400) | ||||
|     )) | ||||
|  | ||||
|     nomina.adicionar_deduccion(fe.nomina.DeduccionFondoPension( | ||||
|         porcentaje=fe.nomina.Amount(4), | ||||
|         deduccion = fe.nomina.Amount(46400) | ||||
|     )) | ||||
|     return nomina | ||||
|      | ||||
							
								
								
									
										89
									
								
								examples/habilitacion/N000002.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										89
									
								
								examples/habilitacion/N000002.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,89 @@ | ||||
| <?xml version='1.0' encoding='UTF-8'?> | ||||
| <NominaIndividual xmlns:atd="urn:oasis:names:specification:ubl:schema:xsd:AttachedDocument-2" xmlns="dian:gov:co:facturaelectronica:NominaIndividual" xmlns:fe="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cdt="urn:DocumentInformation:names:specification:ubl:colombia:schema:xsd:DocumentInformationAggregateComponents-1" xmlns:clm54217="urn:un:unece:uncefact:codelist:specification:54217:2001" xmlns:clmIANAMIMEMediaType="urn:un:unece:uncefact:codelist:specification:IANAMIMEMediaType:2003" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:sts="dian:gov:co:facturaelectronica:Structures-2-1" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" xmlns:xades141="http://uri.etsi.org/01903/v1.4.1#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:sig="http://www.w3.org/2000/09/xmldsig#" SchemaLocation="" xsi:schemaLocation="dian:gov:co:facturaelectronica:NominaIndividual NominaIndividualElectronicaXSD.xsd"><ext:UBLExtensions><ext:UBLExtension><ext:ExtensionContent><ds:Signature Id="xmlsig-bd7246f2-0f63-4a0a-822b-f59be349b7df"> | ||||
| <ds:SignedInfo> | ||||
| <ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/> | ||||
| <ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/> | ||||
| <ds:Reference Id="xmldsig-bd7246f2-0f63-4a0a-822b-f59be349b7df-ref0" URI=""> | ||||
| <ds:Transforms> | ||||
| <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> | ||||
| </ds:Transforms> | ||||
| <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> | ||||
| <ds:DigestValue>OZ66ZARE1QPKfYYk+BdiEnO0675e7p00fGwhb/Iyd5s=</ds:DigestValue> | ||||
| </ds:Reference> | ||||
| <ds:Reference Id="xmldsig-bd7246f2-0f63-4a0a-822b-f59be349b7df-ref1" URI="#xmldsig-bd7246f2-0f63-4a0a-822b-f59be349b7df-KeyInfo"> | ||||
| <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> | ||||
| <ds:DigestValue>jZRqaYdQrLDYoqJmrKrLoO2ZHlGX1Xo5IpGFAznaQnI=</ds:DigestValue> | ||||
| </ds:Reference> | ||||
| <ds:Reference URI="#xmldsig-bd7246f2-0f63-4a0a-822b-f59be349b7df-signedprops" Type="http://uri.etsi.org/01903#SignedProperties"> | ||||
| <ds:Transforms> | ||||
| <ds:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/> | ||||
| </ds:Transforms> | ||||
| <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> | ||||
| <ds:DigestValue>XNMT1fgTLgeuUDfYH//8aY/TqzhsRcScSySL/6nKwxE=</ds:DigestValue> | ||||
| </ds:Reference> | ||||
| </ds:SignedInfo> | ||||
| <ds:SignatureValue>fHBH/GVqHYi8iFbtTUwLUaVerZjfoj64Toq5jE+qi/HLmwhtDCAK2V/ISn0VDxpJ | ||||
| 3QrAqWw/VjTFEqWmRV7mCxybM98A/+5yeWbvDkG2eY5fUOUHin9+oomysY8cwLjA | ||||
| joXsvjEJlM1YIndzWG/Dryr14Hcax6ItVSaopA+1BpUoFn/5jWwZXsbmq0jHDjsI | ||||
| Vyk1WpZzYwmM/aGZg7gj/pR7kZZOnv4d3L/MnFP6vJRdRNtRwO73wBd5lYGU1KaB | ||||
| iTimrV2gBwg0+o5bqloSaQEtqV87adJG0h3eosSiIhrG9rc9rOpvqqq7tG2nAxRx | ||||
| NyPM8gwuKoaoU9ogvRsqHQ==</ds:SignatureValue> | ||||
| <ds:KeyInfo Id="xmldsig-bd7246f2-0f63-4a0a-822b-f59be349b7df-KeyInfo"> | ||||
| <ds:X509Data> | ||||
| <ds:X509Certificate>MIIH8TCCBdmgAwIBAgIIQxaPJd4YTlMwDQYJKoZIhvcNAQELBQAwgbYxIzAhBgkq | ||||
| hkiG9w0BCQEWFGluZm9AYW5kZXNzY2QuY29tLmNvMSYwJAYDVQQDEx1DQSBBTkRF | ||||
| UyBTQ0QgUy5BLiBDbGFzZSBJSSB2MzEwMC4GA1UECxMnRGl2aXNpb24gZGUgY2Vy | ||||
| dGlmaWNhY2lvbiBlbnRpZGFkIGZpbmFsMRIwEAYDVQQKEwlBbmRlcyBTQ0QxFDAS | ||||
| BgNVBAcTC0JvZ290YSBELkMuMQswCQYDVQQGEwJDTzAeFw0yNDA1MTYwNTAwMDBa | ||||
| Fw0yNTA1MTYwNDU5MDBaMIIBQDEtMCsGA1UECRMkVFYgNDYgQyA0MiBFU1RFIDc4 | ||||
| OSBDT1JSIFNBTlRBIEVMRU5BMSIwIAYJKoZIhvcNAQkBFhNiaWNpcGl6emFAZ21h | ||||
| aWwuY29tMRowGAYDVQQDExFCSUNJIFBJWlpBIFMuQS5TLj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||||
| LQBr5PQBnSEWhmrQ9uFrwPyMMg3yd+L75TaHLZ0MTSVezAG52oM9jBiU5tYXkSio | ||||
| EfPdIsGlG74BybULGSG2OlTINlblj/lj7pL67V+gY9EGN1zzNKL5sW4YXlXewa6K | ||||
| dTpLmmzWzI8Cm+tOuuJDSHSwMjn525O+Z/oyKLjdQdyfg1KnZYwNZFpMmCwfP5nd | ||||
| cm4F7Anzb9HX9ciluAxc6as9TsNoDDTSAGPuUr0QvXqXd9ZCgXdNzdFeiaYknLP5 | ||||
| hT4f5CoO2M8qcG+CH7HnkaOHrSuK</ds:X509Certificate> | ||||
| </ds:X509Data> | ||||
| <ds:KeyValue> | ||||
| <ds:RSAKeyValue> | ||||
| <ds:Modulus>5J1O+4ZedrSBUsb+9tjNPHI9RGeIJcJl3Wc/208OqMYcCwGLUkrYBgH78E7IayD5 | ||||
| /wra04OU57cS1/+/yBUWYR60oqkaH2/8OXkJMqmjisVM/b58m7zyMw4TAF8N/Pbs | ||||
| wnrKukFU2acxISwTLu36HC4hshWw8bEGP54szvv1xnwqcOAWNBCxcBuc9k1JD+SI | ||||
| iqqPwHKh+6EDIooujo0H15w3rAxkHQRvYe6/IrpvH2sqJl1I3dLv0iqy9+d2l891 | ||||
| KBA9Yebdw7m/+ufu+eqs+0zKrwV6QLhRFmceHzEkPMTFepc2COGf80OUNbI6WWns | ||||
| pvDK97D8YG0MeifPYveIPw==</ds:Modulus> | ||||
| <ds:Exponent>AQAB</ds:Exponent> | ||||
| </ds:RSAKeyValue> | ||||
| </ds:KeyValue> | ||||
| </ds:KeyInfo> | ||||
| <ds:Object><xades:QualifyingProperties Target="#xmlsig-bd7246f2-0f63-4a0a-822b-f59be349b7df" Id="XadesObjects"><xades:SignedProperties Id="xmldsig-bd7246f2-0f63-4a0a-822b-f59be349b7df-signedprops"><xades:SignedSignatureProperties><xades:SigningTime>2025-03-16T16:50:01.250573</xades:SigningTime><xades:SigningCertificate><xades:Cert><xades:CertDigest><ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/><ds:DigestValue>YcIPspAVFcNg+B/galYrdCLYvLIEwFI4KWdSzcuupPY=</ds:DigestValue></xades:CertDigest><xades:IssuerSerial><ds:X509IssuerName>C=CO, L=Bogota D.C., O=Andes SCD, OU=Division de certificacion entidad final, CN=CA ANDES SCD S.A. Clase II v3, OID.1.2.840.113549.1.9.1=info@andesscd.com.co</ds:X509IssuerName><ds:X509SerialNumber>4834208642831502931</ds:X509SerialNumber></xades:IssuerSerial></xades:Cert></xades:SigningCertificate><xades:SignaturePolicyIdentifier><xades:SignaturePolicyId><xades:SigPolicyId><xades:Identifier>https://facturaelectronica.dian.gov.co/politicadefirma/v2/politicadefirmav2.pdf</xades:Identifier><xades:Description>Política de firma para facturas electrónicas de la República de Colombia.</xades:Description></xades:SigPolicyId><xades:SigPolicyHash><ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/><ds:DigestValue>dMoMvtcG5aIzgYo0tIsSQeVJBDnUnfSOfBpxXrmor0Y=</ds:DigestValue></xades:SigPolicyHash></xades:SignaturePolicyId></xades:SignaturePolicyIdentifier><xades:SignerRole><xades:ClaimedRoles><xades:ClaimedRole>supplier</xades:ClaimedRole></xades:ClaimedRoles></xades:SignerRole></xades:SignedSignatureProperties></xades:SignedProperties></xades:QualifyingProperties></ds:Object></ds:Signature></ext:ExtensionContent></ext:UBLExtension></ext:UBLExtensions><Novedad CUNENov="false">false</Novedad><Periodo FechaIngreso="2022-09-05" FechaLiquidacionInicio="2024-04-01" FechaLiquidacionFin="2024-04-30" TiempoLaborado="1" FechaGen="2024-04-30"/><NumeroSecuenciaXML Prefijo="N" Consecutivo="000002" Numero="N000002"/><LugarGeneracionXML Pais="CO" DepartamentoEstado="05" MunicipioCiudad="05001" Idioma="es"/><ProveedorXML NIT="901575528" DV="2" SoftwareID="100b0d10-0ca0-4ad4-a894-b704a568cbf3" RazonSocial="BICI PIZZA S.A.S" SoftwareSC="067c1069842576f1f954d3540d9f75a214e2a63219f36f4f25465e26958c10d2c9e222076635379bd7f61ca0459c87e9"/><CodigoQR>https://catalogo-vpfe-hab.dian.gov.co/document/searchqr?documentkey=cb2e6968a811c661ebdc8b8cd19a323ca05471c2fe3c3b1cfb5275379d7df94d6c22f9405d732295e805095e366a99fa</CodigoQR><InformacionGeneral Version="V1.0: Documento Soporte de Pago de Nómina Electrónica" Ambiente="2" TipoXML="102" EncripCUNE="CUNE-SHA384" FechaGen="2024-04-30" HoraGen="08:01:00-05:00" PeriodoNomina="1" TipoMoneda="COP" TRM="0" CUNE="cb2e6968a811c661ebdc8b8cd19a323ca05471c2fe3c3b1cfb5275379d7df94d6c22f9405d732295e805095e366a99fa"/><Empleador NIT="901575528" DV="2" Pais="CO" DepartamentoEstado="05" MunicipioCiudad="05001" Direccion="calle etrivial" RazonSocial="BICI PIZZA S.A.S"/><Trabajador TipoTrabajador="01" SubTipoTrabajador="00" AltoRiesgoPension="false" TipoDocumento="11" NumeroDocumento="901575528" PrimerApellido="GIRALDO" SegundoApellido="" PrimerNombre="VIVIANA" LugarTrabajoPais="CO" LugarTrabajoDepartamentoEstado="05" LugarTrabajoMunicipioCiudad="05001" LugarTrabajoDireccion="CL 35C 102-17 BL 7 AP 101" SalarioIntegral="false" TipoContrato="1" Sueldo="1160000.0"/><Pago Forma="1" Metodo="10"/><FechasPagos><FechaPago>2024-04-30</FechaPago></FechasPagos><Devengados><Basico DiasTrabajados="30" SueldoTrabajado="1160000.00"/></Devengados><Deducciones><Salud Porcentaje="4.00" Deduccion="46400.0"/><FondoPension Porcentaje="4.00" Deduccion="46400.0"/></Deducciones><Redondeo>0</Redondeo><DevengadosTotal>1160000.00</DevengadosTotal><DeduccionesTotal>92800.00</DeduccionesTotal><ComprobanteTotal>1067200.00</ComprobanteTotal></NominaIndividual> | ||||
							
								
								
									
										
											BIN
										
									
								
								examples/habilitacion/N000002.zip
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								examples/habilitacion/N000002.zip
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										123
									
								
								examples/habilitacion/N000003.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										123
									
								
								examples/habilitacion/N000003.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,123 @@ | ||||
|  | ||||
| from facho import fe | ||||
|  | ||||
| SOFTWARE_PIN='20234' | ||||
| SOFTWARE_ID='100b0d10-0ca0-4ad4-a894-b704a568cbf3' | ||||
| NIT='901575528' | ||||
| DV='2' | ||||
|  | ||||
| def extensions(nomina): | ||||
|     return [] | ||||
|  | ||||
| def nomina(): | ||||
|     nomina = fe.nomina.DIANNominaIndividual() | ||||
|  | ||||
|     nomina.asignar_fecha_pago('2024-04-30') | ||||
|  | ||||
|     nomina.asignar_metadata(fe.nomina.Metadata( | ||||
|     novedad=fe.nomina.Novedad(value='false'), | ||||
|         secuencia=fe.nomina.NumeroSecuencia( | ||||
|             prefijo='N', | ||||
|             consecutivo='000003' | ||||
|         ), | ||||
|         lugar_generacion=fe.nomina.Lugar( | ||||
|             pais = fe.nomina.Pais( | ||||
|                 code = 'CO' | ||||
|             ), | ||||
|             departamento = fe.nomina.Departamento( | ||||
|                 code = '05' | ||||
|             ), | ||||
|             municipio = fe.nomina.Municipio( | ||||
|                 code = '05001' | ||||
|             ), | ||||
|         ), | ||||
|         proveedor=fe.nomina.Proveedor( | ||||
| 	    razon_social='BICI PIZZA S.A.S', | ||||
|             nit=NIT, | ||||
|             dv=DV, | ||||
|             software_id=SOFTWARE_ID, | ||||
|             software_pin=SOFTWARE_PIN | ||||
|         ) | ||||
|     )) | ||||
|  | ||||
|     nomina.asignar_periodo(fe.nomina.Periodo( | ||||
|         fecha_ingreso= '2022-01-05', | ||||
|         fecha_liquidacion_inicio='2024-04-01', | ||||
|         fecha_liquidacion_fin='2024-04-30', | ||||
|         fecha_generacion='2024-04-30' | ||||
|     )) | ||||
|  | ||||
|     nomina.asignar_informacion_general(fe.nomina.InformacionGeneral( | ||||
|         fecha_generacion = '2024-04-30', | ||||
|         hora_generacion = '08:01:00-05:00', | ||||
|         tipo_ambiente = fe.nomina.InformacionGeneral.AMBIENTE_PRUEBAS, | ||||
|         software_pin = SOFTWARE_PIN, | ||||
|         periodo_nomina = fe.nomina.PeriodoNomina(code='1'), | ||||
|         tipo_moneda = fe.nomina.TipoMoneda(code='COP') | ||||
|     )) | ||||
|  | ||||
|     nomina.asignar_pago(fe.nomina.Pago( | ||||
|         forma=fe.nomina.FormaPago( | ||||
|             code='1', | ||||
|         ), | ||||
|         metodo=fe.nomina.MetodoPago( | ||||
|             code='10' | ||||
|         ) | ||||
|     )) | ||||
|     nomina.asignar_empleador(fe.nomina.Empleador( | ||||
| 	razon_social='BICI PIZZA S.A.S', | ||||
|         nit = NIT, | ||||
|         dv = DV, | ||||
|         pais = fe.nomina.Pais( | ||||
|             code = 'CO' | ||||
|         ), | ||||
|         departamento = fe.nomina.Departamento( | ||||
|             code = '05' | ||||
|         ), | ||||
|         municipio = fe.nomina.Municipio( | ||||
|             code = '05001' | ||||
|         ), | ||||
|         direccion = 'calle etrivial' | ||||
|     )) | ||||
|  | ||||
|     nomina.asignar_trabajador(fe.nomina.Trabajador( | ||||
|         tipo_contrato = fe.nomina.TipoContrato( | ||||
|             code = '1' | ||||
|         ), | ||||
|         alto_riesgo = False, | ||||
|         tipo_documento = fe.nomina.TipoDocumento( | ||||
|             code = '11' | ||||
|         ), | ||||
|         primer_apellido = 'GONZALEZ', | ||||
|         segundo_apellido = '', | ||||
|         primer_nombre = 'JUAN', | ||||
|         lugar_trabajo = fe.nomina.LugarTrabajo( | ||||
|             pais = fe.nomina.Pais(code='CO'), | ||||
|             departamento = fe.nomina.Departamento(code='05'), | ||||
|             municipio = fe.nomina.Municipio(code='05001'), | ||||
|             direccion = 'CL 35C 102-17 BL 7 AP 101' | ||||
|         ), | ||||
|         numero_documento = NIT, | ||||
|         tipo = fe.nomina.TipoTrabajador( | ||||
|             code = '01' | ||||
|         ), | ||||
|         salario_integral = False, | ||||
|         sueldo = fe.nomina.Amount(2400000) | ||||
|     )) | ||||
|  | ||||
|     nomina.adicionar_devengado(fe.nomina.DevengadoBasico( | ||||
|         dias_trabajados = 30, | ||||
|         sueldo_trabajado = fe.nomina.Amount(2400000) | ||||
|     )) | ||||
|  | ||||
|     nomina.adicionar_deduccion(fe.nomina.DeduccionSalud( | ||||
|         porcentaje = fe.nomina.Amount(4), | ||||
|         deduccion = fe.nomina.Amount(96000) | ||||
|     )) | ||||
|  | ||||
|     nomina.adicionar_deduccion(fe.nomina.DeduccionFondoPension( | ||||
|         porcentaje=fe.nomina.Amount(4), | ||||
|         deduccion = fe.nomina.Amount(96000) | ||||
|     )) | ||||
|     return nomina | ||||
|      | ||||
							
								
								
									
										89
									
								
								examples/habilitacion/N000003.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										89
									
								
								examples/habilitacion/N000003.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,89 @@ | ||||
| <?xml version='1.0' encoding='UTF-8'?> | ||||
| <NominaIndividual xmlns:atd="urn:oasis:names:specification:ubl:schema:xsd:AttachedDocument-2" xmlns="dian:gov:co:facturaelectronica:NominaIndividual" xmlns:fe="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cdt="urn:DocumentInformation:names:specification:ubl:colombia:schema:xsd:DocumentInformationAggregateComponents-1" xmlns:clm54217="urn:un:unece:uncefact:codelist:specification:54217:2001" xmlns:clmIANAMIMEMediaType="urn:un:unece:uncefact:codelist:specification:IANAMIMEMediaType:2003" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:sts="dian:gov:co:facturaelectronica:Structures-2-1" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" xmlns:xades141="http://uri.etsi.org/01903/v1.4.1#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:sig="http://www.w3.org/2000/09/xmldsig#" SchemaLocation="" xsi:schemaLocation="dian:gov:co:facturaelectronica:NominaIndividual NominaIndividualElectronicaXSD.xsd"><ext:UBLExtensions><ext:UBLExtension><ext:ExtensionContent><ds:Signature Id="xmlsig-135b3cc1-1d1c-4ddd-a4c0-704a880a352b"> | ||||
| <ds:SignedInfo> | ||||
| <ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/> | ||||
| <ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/> | ||||
| <ds:Reference Id="xmldsig-135b3cc1-1d1c-4ddd-a4c0-704a880a352b-ref0" URI=""> | ||||
| <ds:Transforms> | ||||
| <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> | ||||
| </ds:Transforms> | ||||
| <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> | ||||
| <ds:DigestValue>mf3prH7SIB1Df0Z/nOPdRGG0DKXP8oCra41918zaCyg=</ds:DigestValue> | ||||
| </ds:Reference> | ||||
| <ds:Reference Id="xmldsig-135b3cc1-1d1c-4ddd-a4c0-704a880a352b-ref1" URI="#xmldsig-135b3cc1-1d1c-4ddd-a4c0-704a880a352b-KeyInfo"> | ||||
| <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> | ||||
| <ds:DigestValue>H3dF/siCNdG6iSy15jUQct1k4qswXBZToWJH6tsptpk=</ds:DigestValue> | ||||
| </ds:Reference> | ||||
| <ds:Reference URI="#xmldsig-135b3cc1-1d1c-4ddd-a4c0-704a880a352b-signedprops" Type="http://uri.etsi.org/01903#SignedProperties"> | ||||
| <ds:Transforms> | ||||
| <ds:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/> | ||||
| </ds:Transforms> | ||||
| <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> | ||||
| <ds:DigestValue>IqiqJKHTI0OAWva1xZ+ZOk9ooGkzEa4hReQCr4/W778=</ds:DigestValue> | ||||
| </ds:Reference> | ||||
| </ds:SignedInfo> | ||||
| <ds:SignatureValue>Nv0nFvZ4Y3KIaPODEiOFgThDYb+DNKlJrRUAOrIxcNvtotpK7Y91JnYbUgFvl28b | ||||
| Z5V/catUMyOclGDjPzslTBcHXExleb5eIgUB8URdNvdrB78iXFUOfPc+ESFomru8 | ||||
| jyPX9cZw24ZYBmQqqusvqIkf/tIARFGZ+7AzXkp28dBRFyWtgjESn60DIrFjm9x5 | ||||
| Pthv1K95gytjrrpwvdk77KN4uumlCbGoc2Pizbj+ufijbnxEPDS7fS7RR0Qv9uz/ | ||||
| 2X7znR10TK8+gwMz7AVRYQi90ZbhOadxf3j+HVAlHtw+JHbrPSC+7xBOiPPStY6o | ||||
| 6TkQU+ZMpz2IUovjqREXow==</ds:SignatureValue> | ||||
| <ds:KeyInfo Id="xmldsig-135b3cc1-1d1c-4ddd-a4c0-704a880a352b-KeyInfo"> | ||||
| <ds:X509Data> | ||||
| <ds:X509Certificate>MIIH8TCCBdmgAwIBAgIIQxaPJd4YTlMwDQYJKoZIhvcNAQELBQAwgbYxIzAhBgkq | ||||
| hkiG9w0BCQEWFGluZm9AYW5kZXNzY2QuY29tLmNvMSYwJAYDVQQDEx1DQSBBTkRF | ||||
| UyBTQ0QgUy5BLiBDbGFzZSBJSSB2MzEwMC4GA1UECxMnRGl2aXNpb24gZGUgY2Vy | ||||
| dGlmaWNhY2lvbiBlbnRpZGFkIGZpbmFsMRIwEAYDVQQKEwlBb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OaGwp | ||||
| 4ovkXlYwQ7FVNfIIoAq95m9cBAigb06bRIlVBVTQq44hQFQQG6aSIT7SSPtCwPhB | ||||
| 5CJzG09pmgbxizqN/yxdjWdfW6Av79dh6K4uQT++Vtyp5DuAkmfn0ehayrUbDLkH | ||||
| 9jQFF128U5pnOPfKWf22acXqQBapesUSV/HZUZ3PXoWeHWXcMdz0azxOEunS4+px | ||||
| fs5UzInRAmEcYwJHqJT3irFz+J2RsZ0WnJHrTGqFoXniQQH8QbCHehDTGN7/v/v1 | ||||
| LQBr5PQBnSEWhmrQ9uFrwPyMMg3yd+L75TaHLZ0MTSVezAG52oM9jBiU5tYXkSio | ||||
| EfPdIsGlG74BybULGSG2OlTINlblj/lj7pL67V+gY9EGN1zzNKL5sW4YXlXewa6K | ||||
| dTpLmmzWzI8Cm+tOuuJDSHSwMjn525O+Z/oyKLjdQdyfg1KnZYwNZFpMmCwfP5nd | ||||
| cm4F7Anzb9HX9ciluAxc6as9TsNoDDTSAGPuUr0QvXqXd9ZCgXdNzdFeiaYknLP5 | ||||
| hT4f5CoO2M8qcG+CH7HnkaOHrSuK</ds:X509Certificate> | ||||
| </ds:X509Data> | ||||
| <ds:KeyValue> | ||||
| <ds:RSAKeyValue> | ||||
| <ds:Modulus>5J1O+4ZedrSBUsb+9tjNPHI9RGeIJcJl3Wc/208OqMYcCwGLUkrYBgH78E7IayD5 | ||||
| /wra04OU57cS1/+/yBUWYR60oqkaH2/8OXkJMqmjisVM/b58m7zyMw4TAF8N/Pbs | ||||
| wnrKukFU2acxISwTLu36HC4hshWw8bEGP54szvv1xnwqcOAWNBCxcBuc9k1JD+SI | ||||
| iqqPwHKh+6EDIooujo0H15w3rAxkHQRvYe6/IrpvH2sqJl1I3dLv0iqy9+d2l891 | ||||
| KBA9Yebdw7m/+ufu+eqs+0zKrwV6QLhRFmceHzEkPMTFepc2COGf80OUNbI6WWns | ||||
| pvDK97D8YG0MeifPYveIPw==</ds:Modulus> | ||||
| <ds:Exponent>AQAB</ds:Exponent> | ||||
| </ds:RSAKeyValue> | ||||
| </ds:KeyValue> | ||||
| </ds:KeyInfo> | ||||
| <ds:Object><xades:QualifyingProperties Target="#xmlsig-135b3cc1-1d1c-4ddd-a4c0-704a880a352b" Id="XadesObjects"><xades:SignedProperties Id="xmldsig-135b3cc1-1d1c-4ddd-a4c0-704a880a352b-signedprops"><xades:SignedSignatureProperties><xades:SigningTime>2025-03-16T16:51:23.354553</xades:SigningTime><xades:SigningCertificate><xades:Cert><xades:CertDigest><ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/><ds:DigestValue>YcIPspAVFcNg+B/galYrdCLYvLIEwFI4KWdSzcuupPY=</ds:DigestValue></xades:CertDigest><xades:IssuerSerial><ds:X509IssuerName>C=CO, L=Bogota D.C., O=Andes SCD, OU=Division de certificacion entidad final, CN=CA ANDES SCD S.A. Clase II v3, OID.1.2.840.113549.1.9.1=info@andesscd.com.co</ds:X509IssuerName><ds:X509SerialNumber>4834208642831502931</ds:X509SerialNumber></xades:IssuerSerial></xades:Cert></xades:SigningCertificate><xades:SignaturePolicyIdentifier><xades:SignaturePolicyId><xades:SigPolicyId><xades:Identifier>https://facturaelectronica.dian.gov.co/politicadefirma/v2/politicadefirmav2.pdf</xades:Identifier><xades:Description>Política de firma para facturas electrónicas de la República de Colombia.</xades:Description></xades:SigPolicyId><xades:SigPolicyHash><ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/><ds:DigestValue>dMoMvtcG5aIzgYo0tIsSQeVJBDnUnfSOfBpxXrmor0Y=</ds:DigestValue></xades:SigPolicyHash></xades:SignaturePolicyId></xades:SignaturePolicyIdentifier><xades:SignerRole><xades:ClaimedRoles><xades:ClaimedRole>supplier</xades:ClaimedRole></xades:ClaimedRoles></xades:SignerRole></xades:SignedSignatureProperties></xades:SignedProperties></xades:QualifyingProperties></ds:Object></ds:Signature></ext:ExtensionContent></ext:UBLExtension></ext:UBLExtensions><Novedad CUNENov="false">false</Novedad><Periodo FechaIngreso="2022-01-05" FechaLiquidacionInicio="2024-04-01" FechaLiquidacionFin="2024-04-30" TiempoLaborado="1" FechaGen="2024-04-30"/><NumeroSecuenciaXML Prefijo="N" Consecutivo="000003" Numero="N000003"/><LugarGeneracionXML Pais="CO" DepartamentoEstado="05" MunicipioCiudad="05001" Idioma="es"/><ProveedorXML NIT="901575528" DV="2" SoftwareID="100b0d10-0ca0-4ad4-a894-b704a568cbf3" RazonSocial="BICI PIZZA S.A.S" SoftwareSC="23bd3a3e925c4cdf6c4b99c1eda9e64846526241a263b86f3ffc9673d91020625812ef6abdcf93b4c326b7b65999d6c1"/><CodigoQR>https://catalogo-vpfe-hab.dian.gov.co/document/searchqr?documentkey=beae68d136b80593b01b5cd7594bc86cc2f6ffd17d0238e5842e29ef6dfde62d26cb959764b6bf0943e73149596bfec0</CodigoQR><InformacionGeneral Version="V1.0: Documento Soporte de Pago de Nómina Electrónica" Ambiente="2" TipoXML="102" EncripCUNE="CUNE-SHA384" FechaGen="2024-04-30" HoraGen="08:01:00-05:00" PeriodoNomina="1" TipoMoneda="COP" TRM="0" CUNE="beae68d136b80593b01b5cd7594bc86cc2f6ffd17d0238e5842e29ef6dfde62d26cb959764b6bf0943e73149596bfec0"/><Empleador NIT="901575528" DV="2" Pais="CO" DepartamentoEstado="05" MunicipioCiudad="05001" Direccion="calle etrivial" RazonSocial="BICI PIZZA S.A.S"/><Trabajador TipoTrabajador="01" SubTipoTrabajador="00" AltoRiesgoPension="false" TipoDocumento="11" NumeroDocumento="901575528" PrimerApellido="GONZALEZ" SegundoApellido="" PrimerNombre="JUAN" LugarTrabajoPais="CO" LugarTrabajoDepartamentoEstado="05" LugarTrabajoMunicipioCiudad="05001" LugarTrabajoDireccion="CL 35C 102-17 BL 7 AP 101" SalarioIntegral="false" TipoContrato="1" Sueldo="2400000.0"/><Pago Forma="1" Metodo="10"/><FechasPagos><FechaPago>2024-04-30</FechaPago></FechasPagos><Devengados><Basico DiasTrabajados="30" SueldoTrabajado="2400000.00"/></Devengados><Deducciones><Salud Porcentaje="4.00" Deduccion="96000.0"/><FondoPension Porcentaje="4.00" Deduccion="96000.0"/></Deducciones><Redondeo>0</Redondeo><DevengadosTotal>2400000.00</DevengadosTotal><DeduccionesTotal>192000.00</DeduccionesTotal><ComprobanteTotal>2208000.00</ComprobanteTotal></NominaIndividual> | ||||
							
								
								
									
										
											BIN
										
									
								
								examples/habilitacion/N000003.zip
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								examples/habilitacion/N000003.zip
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										123
									
								
								examples/habilitacion/N000004.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										123
									
								
								examples/habilitacion/N000004.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,123 @@ | ||||
|  | ||||
| from facho import fe | ||||
|  | ||||
| SOFTWARE_PIN='20234' | ||||
| SOFTWARE_ID='100b0d10-0ca0-4ad4-a894-b704a568cbf3' | ||||
| NIT='901575528' | ||||
| DV='2' | ||||
|  | ||||
| def extensions(nomina): | ||||
|     return [] | ||||
|  | ||||
| def nomina(): | ||||
|     nomina = fe.nomina.DIANNominaIndividual() | ||||
|  | ||||
|     nomina.asignar_fecha_pago('2024-04-30') | ||||
|  | ||||
|     nomina.asignar_metadata(fe.nomina.Metadata( | ||||
|     novedad=fe.nomina.Novedad(value='false'), | ||||
|         secuencia=fe.nomina.NumeroSecuencia( | ||||
|             prefijo='N', | ||||
|             consecutivo='000004' | ||||
|         ), | ||||
|         lugar_generacion=fe.nomina.Lugar( | ||||
|             pais = fe.nomina.Pais( | ||||
|                 code = 'CO' | ||||
|             ), | ||||
|             departamento = fe.nomina.Departamento( | ||||
|                 code = '05' | ||||
|             ), | ||||
|             municipio = fe.nomina.Municipio( | ||||
|                 code = '05001' | ||||
|             ), | ||||
|         ), | ||||
|         proveedor=fe.nomina.Proveedor( | ||||
| 	    razon_social='BICI PIZZA S.A.S', | ||||
|             nit=NIT, | ||||
|             dv=DV, | ||||
|             software_id=SOFTWARE_ID, | ||||
|             software_pin=SOFTWARE_PIN | ||||
|         ) | ||||
|     )) | ||||
|  | ||||
|     nomina.asignar_periodo(fe.nomina.Periodo( | ||||
|         fecha_ingreso= '2022-09-05', | ||||
|         fecha_liquidacion_inicio='2024-04-01', | ||||
|         fecha_liquidacion_fin='2024-04-30', | ||||
|         fecha_generacion='2024-04-30' | ||||
|     )) | ||||
|  | ||||
|     nomina.asignar_informacion_general(fe.nomina.InformacionGeneral( | ||||
|         fecha_generacion = '2024-04-30', | ||||
|         hora_generacion = '08:01:00-05:00', | ||||
|         tipo_ambiente = fe.nomina.InformacionGeneral.AMBIENTE_PRUEBAS, | ||||
|         software_pin = SOFTWARE_PIN, | ||||
|         periodo_nomina = fe.nomina.PeriodoNomina(code='1'), | ||||
|         tipo_moneda = fe.nomina.TipoMoneda(code='COP') | ||||
|     )) | ||||
|  | ||||
|     nomina.asignar_pago(fe.nomina.Pago( | ||||
|         forma=fe.nomina.FormaPago( | ||||
|             code='1', | ||||
|         ), | ||||
|         metodo=fe.nomina.MetodoPago( | ||||
|             code='10' | ||||
|         ) | ||||
|     )) | ||||
|     nomina.asignar_empleador(fe.nomina.Empleador( | ||||
| 	razon_social='BICI PIZZA S.A.S', | ||||
|         nit = NIT, | ||||
|         dv = DV, | ||||
|         pais = fe.nomina.Pais( | ||||
|             code = 'CO' | ||||
|         ), | ||||
|         departamento = fe.nomina.Departamento( | ||||
|             code = '05' | ||||
|         ), | ||||
|         municipio = fe.nomina.Municipio( | ||||
|             code = '05001' | ||||
|         ), | ||||
|         direccion = 'calle etrivial' | ||||
|     )) | ||||
|  | ||||
|     nomina.asignar_trabajador(fe.nomina.Trabajador( | ||||
|         tipo_contrato = fe.nomina.TipoContrato( | ||||
|             code = '1' | ||||
|         ), | ||||
|         alto_riesgo = False, | ||||
|         tipo_documento = fe.nomina.TipoDocumento( | ||||
|             code = '11' | ||||
|         ), | ||||
|         primer_apellido = 'GIRALDO', | ||||
|         segundo_apellido = '', | ||||
|         primer_nombre = 'VIVIANA', | ||||
|         lugar_trabajo = fe.nomina.LugarTrabajo( | ||||
|             pais = fe.nomina.Pais(code='CO'), | ||||
|             departamento = fe.nomina.Departamento(code='05'), | ||||
|             municipio = fe.nomina.Municipio(code='05001'), | ||||
|             direccion = 'CL 35C 102-17 BL 7 AP 101' | ||||
|         ), | ||||
|         numero_documento = NIT, | ||||
|         tipo = fe.nomina.TipoTrabajador( | ||||
|             code = '01' | ||||
|         ), | ||||
|         salario_integral = False, | ||||
|         sueldo = fe.nomina.Amount(1160000) | ||||
|     )) | ||||
|  | ||||
|     nomina.adicionar_devengado(fe.nomina.DevengadoBasico( | ||||
|         dias_trabajados = 30, | ||||
|         sueldo_trabajado = fe.nomina.Amount(1160000) | ||||
|     )) | ||||
|  | ||||
|     nomina.adicionar_deduccion(fe.nomina.DeduccionSalud( | ||||
|         porcentaje = fe.nomina.Amount(4), | ||||
|         deduccion = fe.nomina.Amount(46400) | ||||
|     )) | ||||
|  | ||||
|     nomina.adicionar_deduccion(fe.nomina.DeduccionFondoPension( | ||||
|         porcentaje=fe.nomina.Amount(4), | ||||
|         deduccion = fe.nomina.Amount(46400) | ||||
|     )) | ||||
|     return nomina | ||||
|      | ||||
							
								
								
									
										89
									
								
								examples/habilitacion/N000004.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										89
									
								
								examples/habilitacion/N000004.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,89 @@ | ||||
| <?xml version='1.0' encoding='UTF-8'?> | ||||
| <NominaIndividual xmlns:atd="urn:oasis:names:specification:ubl:schema:xsd:AttachedDocument-2" xmlns="dian:gov:co:facturaelectronica:NominaIndividual" xmlns:fe="http://www.dian.gov.co/contratos/facturaelectronica/v1" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cdt="urn:DocumentInformation:names:specification:ubl:colombia:schema:xsd:DocumentInformationAggregateComponents-1" xmlns:clm54217="urn:un:unece:uncefact:codelist:specification:54217:2001" xmlns:clmIANAMIMEMediaType="urn:un:unece:uncefact:codelist:specification:IANAMIMEMediaType:2003" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:sts="dian:gov:co:facturaelectronica:Structures-2-1" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" xmlns:xades141="http://uri.etsi.org/01903/v1.4.1#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:sig="http://www.w3.org/2000/09/xmldsig#" SchemaLocation="" xsi:schemaLocation="dian:gov:co:facturaelectronica:NominaIndividual NominaIndividualElectronicaXSD.xsd"><ext:UBLExtensions><ext:UBLExtension><ext:ExtensionContent><ds:Signature Id="xmlsig-bf43fedd-6780-438f-afe3-ac062d8b8072"> | ||||
| <ds:SignedInfo> | ||||
| <ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/> | ||||
| <ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/> | ||||
| <ds:Reference Id="xmldsig-bf43fedd-6780-438f-afe3-ac062d8b8072-ref0" URI=""> | ||||
| <ds:Transforms> | ||||
| <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> | ||||
| </ds:Transforms> | ||||
| <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> | ||||
| <ds:DigestValue>ZAE71pLQXXnN5+540pnkxH5ALNBQcecMdLWFKTKby0g=</ds:DigestValue> | ||||
| </ds:Reference> | ||||
| <ds:Reference Id="xmldsig-bf43fedd-6780-438f-afe3-ac062d8b8072-ref1" URI="#xmldsig-bf43fedd-6780-438f-afe3-ac062d8b8072-KeyInfo"> | ||||
| <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> | ||||
| <ds:DigestValue>kNyh65TH4KfF6wqRoy1duEawgkvOlr2rYLCNfdTfK1c=</ds:DigestValue> | ||||
| </ds:Reference> | ||||
| <ds:Reference URI="#xmldsig-bf43fedd-6780-438f-afe3-ac062d8b8072-signedprops" Type="http://uri.etsi.org/01903#SignedProperties"> | ||||
| <ds:Transforms> | ||||
| <ds:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/> | ||||
| </ds:Transforms> | ||||
| <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> | ||||
| <ds:DigestValue>BoPBi5C0tXfV04cf74M4jktBxf9eVsXk5IWqGdeOSHw=</ds:DigestValue> | ||||
| </ds:Reference> | ||||
| </ds:SignedInfo> | ||||
| <ds:SignatureValue>pw5WDlbd4GhnSAJKlTEDjsb1+VAVtyyXWA/isvGz4LHY5n1Fm4hiN7fD3JIrfOBj | ||||
| z/tUfROLzbbywUnVklfaDri6txZlFFwa9SY8MO38bgE0HUxGq5khb/4uzktGRInp | ||||
| H3i0TG5i42YB83PQItSLiEgPWqGVolj5sWfUqD81Ck4CvgtKuZgnn9JPLgP0sjjT | ||||
| BUjKcMt4K+ZLvXumehKKCzEbtoaa5DHKUrpuCU2giGMMPElwaTulFA5kNLBnAk2n | ||||
| HBCiIq+YZ2C3BqE+WQptcQDIObmEnRURvvUTB64gCh4Tigmq6vnv/dMPWmQvohmp | ||||
| ETIZDwU0/xdGcUK7Ujyl4g==</ds:SignatureValue> | ||||
| <ds:KeyInfo Id="xmldsig-bf43fedd-6780-438f-afe3-ac062d8b8072-KeyInfo"> | ||||
| <ds:X509Data> | ||||
| <ds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| bS5jby9DbGFzZUlJdjMuY3JsMB0GA1UdDgQWBBRKPoh3BJM7SxEL0UXkSne2MyFO | ||||
| jjAOBgNVHQ8BAf8EBAMCBeAwDQYJKoZIhvcNAQELBQADggIBAA6Zzor3kpJ6vNKv | ||||
| TAeHaMfmJ/PaghQ1+Lab7Pwk+lsPsMETFu/IpEK5qij2bV54UNnqyLYOZtIbnWTG | ||||
| qgT7QxQvy+/of/I3zzF+kH4/Lp2TSlHaDEb/airCZ3I2G23M9iaZzSwYuOsOaGwp | ||||
| 4ovkXlYwQ7FVNfIIoAq95m9cBAigb06bRIlVBVTQq44hQFQQG6aSIT7SSPtCwPhB | ||||
| 5CJzG09pmgbxizqN/yxdjWdfW6Av79dh6K4uQT++Vtyp5DuAkmfn0ehayrUbDLkH | ||||
| 9jQFF128U5pnOPfKWf22acXqQBapesUSV/HZUZ3PXoWeHWXcMdz0azxOEunS4+px | ||||
| fs5UzInRAmEcYwJHqJT3irFz+J2RsZ0WnJHrTGqFoXniQQH8QbCHehDTGN7/v/v1 | ||||
| LQBr5PQBnSEWhmrQ9uFrwPyMMg3yd+L75TaHLZ0MTSVezAG52oM9jBiU5tYXkSio | ||||
| EfPdIsGlG74BybULGSG2OlTINlblj/lj7pL67V+gY9EGN1zzNKL5sW4YXlXewa6K | ||||
| dTpLmmzWzI8Cm+tOuuJDSHSwMjn525O+Z/oyKLjdQdyfg1KnZYwNZFpMmCwfP5nd | ||||
| cm4F7Anzb9HX9ciluAxc6as9TsNoDDTSAGPuUr0QvXqXd9ZCgXdNzdFeiaYknLP5 | ||||
| hT4f5CoO2M8qcG+CH7HnkaOHrSuK</ds:X509Certificate> | ||||
| </ds:X509Data> | ||||
| <ds:KeyValue> | ||||
| <ds:RSAKeyValue> | ||||
| <ds:Modulus>5J1O+4ZedrSBUsb+9tjNPHI9RGeIJcJl3Wc/208OqMYcCwGLUkrYBgH78E7IayD5 | ||||
| /wra04OU57cS1/+/yBUWYR60oqkaH2/8OXkJMqmjisVM/b58m7zyMw4TAF8N/Pbs | ||||
| wnrKukFU2acxISwTLu36HC4hshWw8bEGP54szvv1xnwqcOAWNBCxcBuc9k1JD+SI | ||||
| iqqPwHKh+6EDIooujo0H15w3rAxkHQRvYe6/IrpvH2sqJl1I3dLv0iqy9+d2l891 | ||||
| KBA9Yebdw7m/+ufu+eqs+0zKrwV6QLhRFmceHzEkPMTFepc2COGf80OUNbI6WWns | ||||
| pvDK97D8YG0MeifPYveIPw==</ds:Modulus> | ||||
| <ds:Exponent>AQAB</ds:Exponent> | ||||
| </ds:RSAKeyValue> | ||||
| </ds:KeyValue> | ||||
| </ds:KeyInfo> | ||||
| <ds:Object><xades:QualifyingProperties Target="#xmlsig-bf43fedd-6780-438f-afe3-ac062d8b8072" Id="XadesObjects"><xades:SignedProperties Id="xmldsig-bf43fedd-6780-438f-afe3-ac062d8b8072-signedprops"><xades:SignedSignatureProperties><xades:SigningTime>2025-03-16T16:51:26.699846</xades:SigningTime><xades:SigningCertificate><xades:Cert><xades:CertDigest><ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/><ds:DigestValue>YcIPspAVFcNg+B/galYrdCLYvLIEwFI4KWdSzcuupPY=</ds:DigestValue></xades:CertDigest><xades:IssuerSerial><ds:X509IssuerName>C=CO, L=Bogota D.C., O=Andes SCD, OU=Division de certificacion entidad final, CN=CA ANDES SCD S.A. Clase II v3, OID.1.2.840.113549.1.9.1=info@andesscd.com.co</ds:X509IssuerName><ds:X509SerialNumber>4834208642831502931</ds:X509SerialNumber></xades:IssuerSerial></xades:Cert></xades:SigningCertificate><xades:SignaturePolicyIdentifier><xades:SignaturePolicyId><xades:SigPolicyId><xades:Identifier>https://facturaelectronica.dian.gov.co/politicadefirma/v2/politicadefirmav2.pdf</xades:Identifier><xades:Description>Política de firma para facturas electrónicas de la República de Colombia.</xades:Description></xades:SigPolicyId><xades:SigPolicyHash><ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/><ds:DigestValue>dMoMvtcG5aIzgYo0tIsSQeVJBDnUnfSOfBpxXrmor0Y=</ds:DigestValue></xades:SigPolicyHash></xades:SignaturePolicyId></xades:SignaturePolicyIdentifier><xades:SignerRole><xades:ClaimedRoles><xades:ClaimedRole>supplier</xades:ClaimedRole></xades:ClaimedRoles></xades:SignerRole></xades:SignedSignatureProperties></xades:SignedProperties></xades:QualifyingProperties></ds:Object></ds:Signature></ext:ExtensionContent></ext:UBLExtension></ext:UBLExtensions><Novedad CUNENov="false">false</Novedad><Periodo FechaIngreso="2022-09-05" FechaLiquidacionInicio="2024-04-01" FechaLiquidacionFin="2024-04-30" TiempoLaborado="1" FechaGen="2024-04-30"/><NumeroSecuenciaXML Prefijo="N" Consecutivo="000004" Numero="N000004"/><LugarGeneracionXML Pais="CO" DepartamentoEstado="05" MunicipioCiudad="05001" Idioma="es"/><ProveedorXML NIT="901575528" DV="2" SoftwareID="100b0d10-0ca0-4ad4-a894-b704a568cbf3" RazonSocial="BICI PIZZA S.A.S" SoftwareSC="61d2d18fc61f70cff4f5c5c2a5e17e5c904bf42179a8118242e994b40c22ef203741568ee51d94b81a7fbde4ea6a79aa"/><CodigoQR>https://catalogo-vpfe-hab.dian.gov.co/document/searchqr?documentkey=40d20d7af2d7ee471909e62fcb4beef7de82494e6c8df4e8349ca33a1246dea601b4cc9035e18972e853ecd435799eaa</CodigoQR><InformacionGeneral Version="V1.0: Documento Soporte de Pago de Nómina Electrónica" Ambiente="2" TipoXML="102" EncripCUNE="CUNE-SHA384" FechaGen="2024-04-30" HoraGen="08:01:00-05:00" PeriodoNomina="1" TipoMoneda="COP" TRM="0" CUNE="40d20d7af2d7ee471909e62fcb4beef7de82494e6c8df4e8349ca33a1246dea601b4cc9035e18972e853ecd435799eaa"/><Empleador NIT="901575528" DV="2" Pais="CO" DepartamentoEstado="05" MunicipioCiudad="05001" Direccion="calle etrivial" RazonSocial="BICI PIZZA S.A.S"/><Trabajador TipoTrabajador="01" SubTipoTrabajador="00" AltoRiesgoPension="false" TipoDocumento="11" NumeroDocumento="901575528" PrimerApellido="GIRALDO" SegundoApellido="" PrimerNombre="VIVIANA" LugarTrabajoPais="CO" LugarTrabajoDepartamentoEstado="05" LugarTrabajoMunicipioCiudad="05001" LugarTrabajoDireccion="CL 35C 102-17 BL 7 AP 101" SalarioIntegral="false" TipoContrato="1" Sueldo="1160000.0"/><Pago Forma="1" Metodo="10"/><FechasPagos><FechaPago>2024-04-30</FechaPago></FechasPagos><Devengados><Basico DiasTrabajados="30" SueldoTrabajado="1160000.00"/></Devengados><Deducciones><Salud Porcentaje="4.00" Deduccion="46400.0"/><FondoPension Porcentaje="4.00" Deduccion="46400.0"/></Deducciones><Redondeo>0</Redondeo><DevengadosTotal>1160000.00</DevengadosTotal><DeduccionesTotal>92800.00</DeduccionesTotal><ComprobanteTotal>1067200.00</ComprobanteTotal></NominaIndividual> | ||||
							
								
								
									
										
											BIN
										
									
								
								examples/habilitacion/N000004.zip
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								examples/habilitacion/N000004.zip
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| @@ -1,7 +1,7 @@ | ||||
| #                                               -*- Autoconf -*- | ||||
| # Process this file with autoconf to produce a configure script. | ||||
|  | ||||
| AC_PREREQ([2.69]) | ||||
| AC_PREREQ([2.71]) | ||||
| AC_INIT([facho-signer], [0.0.1], [bit4bit@riseup.net]) | ||||
| AM_INIT_AUTOMAKE | ||||
| AC_CONFIG_SRCDIR([src/facho_signer.c]) | ||||
|   | ||||
| @@ -177,10 +177,9 @@ class FachoXML: | ||||
|         xml = LXMLBuilder.from_string(document) | ||||
|         return FachoXML(xml, nsmap=namespaces) | ||||
|  | ||||
|     def root_namespace(self): | ||||
|         return etree.QName(self.root).namespace | ||||
|  | ||||
|     def append_element(self, elem, new_elem): | ||||
|         #elem = self.find_or_create_element(xpath, append=append) | ||||
|         #self.builder.append(elem, new_elem) | ||||
|         self.builder.append(elem, new_elem) | ||||
|  | ||||
|     def add_extension(self, extension): | ||||
|   | ||||
| @@ -21,10 +21,10 @@ __all__ = ['DianClient', | ||||
|  | ||||
| class SOAPService: | ||||
|  | ||||
|     def wsdl(self): | ||||
|     def get_wsdl(self): | ||||
|         raise NotImplementedError() | ||||
|  | ||||
|     def service(self): | ||||
|     def get_service(self): | ||||
|         raise NotImplementedError() | ||||
|  | ||||
|     def build_response(self, as_dict): | ||||
| @@ -63,10 +63,10 @@ class GetNumberingRange(SOAPService): | ||||
|     accountCodeT: str | ||||
|     softwareCode: str | ||||
|  | ||||
|     def wsdl(self): | ||||
|     def get_wsdl(self): | ||||
|         return 'https://vpfe.dian.gov.co/WcfDianCustomerServices.svc?wsdl' | ||||
|  | ||||
|     def service(self): | ||||
|     def get_service(self): | ||||
|         return 'GetNumberingRange' | ||||
|  | ||||
|     def build_response(self, as_dict): | ||||
| @@ -78,10 +78,10 @@ class SendBillAsync(SOAPService): | ||||
|     fileName: str | ||||
|     contentFile: str | ||||
|  | ||||
|     def wsdl(self): | ||||
|     def get_wsdl(self): | ||||
|         return 'https://vpfe.dian.gov.co/WcfDianCustomerServices.svc?wsdl' | ||||
|  | ||||
|     def service(self): | ||||
|     def get_service(self): | ||||
|         return 'SendBillAsync' | ||||
|  | ||||
|     def build_response(self, as_dict): | ||||
| @@ -106,10 +106,10 @@ class SendTestSetAsync(SOAPService): | ||||
|     contentFile: str | ||||
|     testSetId: str = '' | ||||
|  | ||||
|     def wsdl(self): | ||||
|     def get_wsdl(self): | ||||
|         return 'https://vpfe.dian.gov.co/WcfDianCustomerServices.svc?wsdl' | ||||
|  | ||||
|     def service(self): | ||||
|     def get_service(self): | ||||
|         return 'SendTestSetAsync' | ||||
|  | ||||
|     def build_response(self, as_dict): | ||||
| @@ -120,10 +120,10 @@ class SendBillSync(SOAPService): | ||||
|     fileName: str | ||||
|     contentFile: bytes | ||||
|  | ||||
|     def wsdl(self): | ||||
|     def get_wsdl(self): | ||||
|         return 'https://vpfe.dian.gov.co/WcfDianCustomerServices.svc?wsdl' | ||||
|  | ||||
|     def service(self): | ||||
|     def get_service(self): | ||||
|         return 'SendBillSync' | ||||
|  | ||||
|     def build_response(self, as_dict): | ||||
| @@ -153,10 +153,10 @@ class GetStatusResponse: | ||||
| class GetStatus(SOAPService): | ||||
|     trackId: bytes | ||||
|  | ||||
|     def wsdl(self): | ||||
|     def get_wsdl(self): | ||||
|         return 'https://vpfe.dian.gov.co/WcfDianCustomerServices.svc?wsdl' | ||||
|  | ||||
|     def service(self): | ||||
|     def get_service(self): | ||||
|         return 'GetStatus' | ||||
|  | ||||
|     def build_response(self, as_dict): | ||||
| @@ -166,10 +166,10 @@ class GetStatus(SOAPService): | ||||
| class GetStatusZip(SOAPService): | ||||
|     trackId: bytes | ||||
|  | ||||
|     def wsdl(self): | ||||
|     def get_wsdl(self): | ||||
|         return 'https://vpfe.dian.gov.co/WcfDianCustomerServices.svc?wsdl' | ||||
|  | ||||
|     def service(self): | ||||
|     def get_service(self): | ||||
|         return 'GetStatusZip' | ||||
|  | ||||
|     def build_response(self, as_dict): | ||||
| @@ -179,10 +179,10 @@ class GetStatusZip(SOAPService): | ||||
| class SendNominaSync(SOAPService): | ||||
|     contentFile: bytes | ||||
|  | ||||
|     def wsdl(self): | ||||
|     def get_wsdl(self): | ||||
|         return 'https://vpfe.dian.gov.co/WcfDianCustomerServices.svc?wsdl' | ||||
|  | ||||
|     def service(self): | ||||
|     def get_service(self): | ||||
|         return 'SendNominaSync' | ||||
|  | ||||
|     def build_response(self, as_dict): | ||||
| @@ -193,31 +193,31 @@ class Habilitacion: | ||||
|     WSDL = 'https://vpfe-hab.dian.gov.co/WcfDianCustomerServices.svc?wsdl' | ||||
|  | ||||
|     class GetNumberingRange(GetNumberingRange): | ||||
|         def wsdl(self): | ||||
|         def get_wsdl(self): | ||||
|             return Habilitacion.WSDL | ||||
|  | ||||
|     class SendBillAsync(SendBillAsync): | ||||
|         def wsdl(self): | ||||
|         def get_wsdl(self): | ||||
|             return Habilitacion.WSDL | ||||
|  | ||||
|     class SendBillSync(SendBillSync): | ||||
|         def wsdl(self): | ||||
|         def get_wsdl(self): | ||||
|             return Habilitacion.WSDL | ||||
|  | ||||
|     class SendTestSetAsync(SendTestSetAsync): | ||||
|         def wsdl(self): | ||||
|         def get_wsdl(self): | ||||
|             return Habilitacion.WSDL | ||||
|  | ||||
|     class GetStatus(GetStatus): | ||||
|         def wsdl(self): | ||||
|         def get_wsdl(self): | ||||
|             return Habilitacion.WSDL | ||||
|  | ||||
|     class GetStatusZip(GetStatusZip): | ||||
|         def wsdl(self): | ||||
|         def get_wsdl(self): | ||||
|             return Habilitacion.WSDL | ||||
|  | ||||
|     class SendNominaSync(SendNominaSync): | ||||
|         def wsdl(self): | ||||
|         def get_wsdl(self): | ||||
|             return Habilitacion.WSDL | ||||
|  | ||||
| class DianGateway: | ||||
| @@ -226,7 +226,7 @@ class DianGateway: | ||||
|         raise NotImplementedError() | ||||
|  | ||||
|     def _remote_service(self, conn, service): | ||||
|         return conn.service[service.service()] | ||||
|         return conn.service[service.get_service()] | ||||
|  | ||||
|     def _close(self, conn): | ||||
|         return | ||||
| @@ -250,7 +250,7 @@ class DianClient(DianGateway): | ||||
|         self._password = password | ||||
|  | ||||
|     def _open(self, service): | ||||
|         return zeep.Client(service.wsdl(), wsse=UsernameToken(self._username, self._password)) | ||||
|         return zeep.Client(service.get_wsdl(), wsse=UsernameToken(self._username, self._password)) | ||||
|  | ||||
|  | ||||
| class DianSignatureClient(DianGateway): | ||||
| @@ -264,7 +264,7 @@ class DianSignatureClient(DianGateway): | ||||
|         # RESOLUCCION 0004: pagina 756 | ||||
|         from zeep.wsse import utils | ||||
|  | ||||
|         client = zeep.Client(service.wsdl(), wsse= | ||||
|         client = zeep.Client(service.get_wsdl(), wsse= | ||||
|                              BinarySignature( | ||||
|                                  self.private_key_path, self.public_key_path, self.password, | ||||
|                                  signature_method=xmlsec.Transform.RSA_SHA256, | ||||
|   | ||||
| @@ -33,8 +33,7 @@ POLICY_NAME = u'Política de firma para facturas electrónicas de la República | ||||
|  | ||||
| NAMESPACES = { | ||||
|     'atd': 'urn:oasis:names:specification:ubl:schema:xsd:AttachedDocument-2', | ||||
|     'nomina': 'dian:gov:co:facturaelectronica:NominaIndividual', | ||||
|     'nominaajuste': 'dian:gov:co:facturaelectronica:NominaIndividualDeAjuste',     | ||||
|     'no': 'dian:gov:co:facturaelectronica:NominaIndividual', | ||||
|     'fe': 'http://www.dian.gov.co/contratos/facturaelectronica/v1', | ||||
|     'xs': 'http://www.w3.org/2001/XMLSchema-instance',     | ||||
|     'cac': 'urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2', | ||||
| @@ -88,12 +87,11 @@ class FeXML(FachoXML): | ||||
|      | ||||
|     def tostring(self, **kw): | ||||
|         # MACHETE(bit4bit) la DIAN espera que la etiqueta raiz no este en un namespace | ||||
|         root_namespace = self.root_namespace() | ||||
|         xmlns_name = {v: k for k, v in NAMESPACES.items()}[root_namespace] | ||||
|         return super().tostring(**kw)\ | ||||
|             .replace(xmlns_name + ':', '')\ | ||||
|             .replace('xmlns:'+xmlns_name, 'xmlns')\ | ||||
|             .replace('schemaLocation', 'xsi:schemaLocation') | ||||
|             .replace("fe:", "")\ | ||||
|             .replace("xmlns:no", "xmlns")\ | ||||
|             .replace("change", "xsi:schemaLocation") | ||||
|  | ||||
|  | ||||
| class DianXMLExtensionCUDFE(FachoXMLExtension): | ||||
|  | ||||
| @@ -122,7 +120,8 @@ class DianXMLExtensionCUDFE(FachoXMLExtension): | ||||
|         fachoxml.set_element('./cbc:UUID', cufe, | ||||
|                              schemeID=self.tipo_ambiente, | ||||
|                              schemeName=self.schemeName()) | ||||
|  | ||||
|         #DIAN 1.8.-2021: FAD03 | ||||
|         fachoxml.set_element('./cbc:ProfileID', 'DIAN 2.1: Factura Electrónica de Venta') | ||||
|         fachoxml.set_element('./cbc:ProfileExecutionID', self._tipo_ambiente_int()) | ||||
|         #DIAN 1.7.-2020: FAB36 | ||||
|         fachoxml.set_element('./ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/sts:DianExtensions/sts:QRCode', | ||||
|   | ||||
| @@ -18,6 +18,3 @@ class DIANCreditNoteXML(DIANInvoiceXML): | ||||
|  | ||||
|     def tag_document_concilied(fexml): | ||||
|         return 'Credited' | ||||
|  | ||||
|     def post_attach_invoice(fexml, invoice): | ||||
|         fexml.set_element('./cbc:ProfileID', 'DIAN 2.1: Nota Crédito de Factura Electrónica de Venta') | ||||
|   | ||||
| @@ -13,9 +13,6 @@ class DIANDebitNoteXML(DIANInvoiceXML): | ||||
|     def __init__(self, invoice): | ||||
|         super().__init__(invoice, 'DebitNote') | ||||
|  | ||||
|     def post_attach_invoice(fexml, invoice): | ||||
|         fexml.set_element('./cbc:ProfileID', 'DIAN 2.1 Nota Débito de Factura Electrónica de Venta') | ||||
|  | ||||
|     def tag_document(fexml): | ||||
|         return 'DebitNote' | ||||
|  | ||||
|   | ||||
| @@ -21,7 +21,6 @@ class DIANInvoiceXML(fe.FeXML): | ||||
|         ublextension = self.fragment('./ext:UBLExtensions/ext:UBLExtension', append=True) | ||||
|         extcontent = ublextension.find_or_create_element('/ext:UBLExtension/ext:ExtensionContent') | ||||
|         self.attach_invoice(invoice) | ||||
|         self.post_attach_invoice(invoice) | ||||
|  | ||||
|     def set_supplier(fexml, invoice): | ||||
|         fexml.placeholder_for('./cac:AccountingSupplierParty') | ||||
| @@ -416,6 +415,7 @@ class DIANInvoiceXML(fe.FeXML): | ||||
|             return fexml._set_debit_note_document_reference(reference) | ||||
|         if isinstance(reference, CreditNoteDocumentReference): | ||||
|             return fexml._set_credit_note_document_reference(reference) | ||||
|  | ||||
|         if isinstance(reference, InvoiceDocumentReference): | ||||
|             return fexml._set_invoice_document_reference(reference) | ||||
|  | ||||
| @@ -439,7 +439,6 @@ class DIANInvoiceXML(fe.FeXML): | ||||
|                 if subtotal.scheme is not None: | ||||
|                     tax_amount_for[subtotal.scheme.code]['tax_amount'] += subtotal.tax_amount | ||||
|                     tax_amount_for[subtotal.scheme.code]['taxable_amount'] += invoice_line.taxable_amount | ||||
|                     tax_amount_for[subtotal.scheme.code]['name'] = subtotal.scheme.name | ||||
|  | ||||
|                     # MACHETE ojo InvoiceLine.tax pasar a Invoice | ||||
|                     percent_for[subtotal.scheme.code] = subtotal.percent | ||||
| @@ -454,9 +453,10 @@ class DIANInvoiceXML(fe.FeXML): | ||||
|          | ||||
|         for index, item in enumerate(tax_amount_for.items()): | ||||
|             cod_impuesto, amount_of = item | ||||
|             next_append = index > 0 | ||||
|  | ||||
|             #DIAN 1.7.-2020: FAS01 | ||||
|             line = fexml.fragment('./cac:TaxTotal', append=True) | ||||
|             line = fexml.fragment('./cac:TaxTotal', append=next_append) | ||||
|             #DIAN 1.7.-2020: FAU06 | ||||
|             tax_amount = amount_of['tax_amount'] | ||||
|             fexml.set_element_amount_for(line, | ||||
| @@ -486,7 +486,7 @@ class DIANInvoiceXML(fe.FeXML): | ||||
|             line.set_element('/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory/cac:TaxScheme/cbc:ID', | ||||
|                     cod_impuesto) | ||||
|             line.set_element('/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory/cac:TaxScheme/cbc:Name', | ||||
|                              amount_of['name']) | ||||
|                     'IVA') | ||||
|    | ||||
|     # abstract method | ||||
|     def tag_document(fexml): | ||||
| @@ -567,10 +567,6 @@ class DIANInvoiceXML(fe.FeXML): | ||||
|             fexml.set_element_amount_for(line, './cbc:Amount', charge.amount) | ||||
|             fexml.set_element_amount_for(line, './cbc:BaseAmount', charge.base_amount) | ||||
|              | ||||
|     def post_attach_invoice(fexml, invoice): | ||||
|         #DIAN 1.8.-2021: FAD03 | ||||
|         fexml.set_element('./cbc:ProfileID', 'DIAN 2.1: Factura Electrónica de Venta') | ||||
|  | ||||
|     def attach_invoice(fexml, invoice): | ||||
|         """adiciona etiquetas a FEXML y retorna FEXML | ||||
|         en caso de fallar validacion retorna None""" | ||||
|   | ||||
| @@ -53,20 +53,14 @@ class FechaPago(Fecha): | ||||
|  | ||||
| @dataclass | ||||
| class Novedad: | ||||
|     # cune de nomina a relacionar | ||||
|     # NIE204 | ||||
|     cune: str | ||||
|     # NIE199 | ||||
|     activa: bool = False | ||||
|     value: False | ||||
|  | ||||
|     def apply(self, fragment): | ||||
|         if self.cune != "": | ||||
|         fragment.set_attributes('./Novedad', | ||||
|                                     CUNENov=self.cune, | ||||
|                                 CUNENov=self.value, | ||||
|                                 ) | ||||
|  | ||||
|     def post_apply(self, fexml, scopexml, fragment): | ||||
|         scopexml.set_element('./Novedad', self.activa) | ||||
|         scopexml.set_element('./Novedad', "false") | ||||
|  | ||||
|  | ||||
| @dataclass | ||||
| @@ -144,12 +138,13 @@ 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 == ambiente: | ||||
|         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') | ||||
|          | ||||
|         scopexml.set_element('./CodigoQR', codigo_qr) | ||||
|         scopexml.set_element('./Novedad', "false")         | ||||
|  | ||||
|         # NIE020 | ||||
|         software_code = self._software_security_code(fexml, scopexml) | ||||
| @@ -182,7 +177,6 @@ class Metadata: | ||||
|     proveedor: Proveedor | ||||
|  | ||||
|     def apply(self, novedad, numero_secuencia_xml, lugar_generacion_xml, proveedor_xml): | ||||
|         if novedad: | ||||
|         self.novedad.apply(novedad) | ||||
|         self.secuencia.apply(numero_secuencia_xml) | ||||
|         self.lugar_generacion.apply(lugar_generacion_xml, './LugarGeneracionXML') | ||||
| @@ -190,7 +184,6 @@ class Metadata: | ||||
|  | ||||
|     def post_apply(self, fexml, scopexml, novedad, numero_secuencia_xml, lugar_generacion_xml, proveedor_xml): | ||||
|         self.proveedor.post_apply(fexml, scopexml, proveedor_xml) | ||||
|         if novedad: | ||||
|         self.novedad.post_apply(fexml, scopexml, proveedor_xml)         | ||||
|          | ||||
| @dataclass | ||||
| @@ -219,8 +212,9 @@ class InformacionGeneral: | ||||
|     class TIPO_AMBIENTE: | ||||
|         valor: str | ||||
|  | ||||
|         def __eq__(self, other): | ||||
|             return self.valor == str(other) | ||||
|         @classmethod | ||||
|         def same(cls, value): | ||||
|             return cls.valor == str(value) | ||||
|  | ||||
|     # TABLA 5.1.1 | ||||
|     @dataclass | ||||
| @@ -237,34 +231,11 @@ class InformacionGeneral: | ||||
|         def __str__(self): | ||||
|             self.valor | ||||
|  | ||||
|     # TABLA 5.5.7 | ||||
|     @dataclass | ||||
|     class TIPO_XML: | ||||
|         valor: str | ||||
|  | ||||
|         def __eq__(self, other): | ||||
|             return self.valor == str(other) | ||||
|  | ||||
|     @dataclass | ||||
|     class TIPO_XML_NORMAL(TIPO_XML): | ||||
|         valor: str = '102' | ||||
|  | ||||
|         def __str__(self): | ||||
|             self.valor             | ||||
|  | ||||
|     @dataclass | ||||
|     class TIPO_XML_AJUSTES(TIPO_XML): | ||||
|         valor: str = '103' | ||||
|  | ||||
|         def __str__(self): | ||||
|             self.valor | ||||
|  | ||||
|     fecha_generacion: typing.Union[str, Fecha] | ||||
|     hora_generacion: str | ||||
|     periodo_nomina: PeriodoNomina | ||||
|     tipo_moneda: TipoMoneda | ||||
|     tipo_ambiente: TIPO_AMBIENTE | ||||
|     tipo_xml: TIPO_XML | ||||
|     software_pin: str | ||||
|  | ||||
|     def __post_init__(self): | ||||
| @@ -279,7 +250,7 @@ class InformacionGeneral: | ||||
|                                 # NIE202 | ||||
|                                 # TABLA 5.5.2 | ||||
|                                 # TODO(bit4bit) solo NominaIndividual | ||||
|                                 TipoXML = self.tipo_xml.valor, | ||||
|                                 TipoXML = '102', | ||||
|                                 # NIE024 | ||||
|                                 CUNE = None, | ||||
|                                 # NIE025 | ||||
| @@ -338,18 +309,15 @@ class DianXMLExtensionSigner(fe.DianXMLExtensionSigner): | ||||
|  | ||||
|  | ||||
| class DIANNominaXML: | ||||
|     def __init__(self, tag_document, xpath_ajuste=None, schemaLocation=None, namespace_ajuste=None): | ||||
|     def __init__(self, tag_document, xpath_ajuste=None,schemaLocation=None): | ||||
|         self.informacion_general_version = None | ||||
|  | ||||
|         self.tag_document = tag_document | ||||
|         self.fexml = fe.FeXML(tag_document, 'http://www.dian.gov.co/contratos/facturaelectronica/v1') | ||||
|  | ||||
|         if namespace_ajuste: | ||||
|             self.fexml = fe.FeXML(tag_document, namespace_ajuste) | ||||
|         else: | ||||
|             self.fexml = fe.FeXML(tag_document, 'dian:gov:co:facturaelectronica:NominaIndividual') | ||||
|  | ||||
|         if schemaLocation is not None: | ||||
|             self.fexml.root.set("SchemaLocation", "")             | ||||
|         self.fexml.root.set("schemaLocation", schemaLocation) | ||||
|             self.fexml.root.set("change", schemaLocation) | ||||
|  | ||||
|         # layout, la dian requiere que los elementos | ||||
|         # esten ordenados segun el anexo tecnico | ||||
| @@ -361,7 +329,6 @@ class DIANNominaXML: | ||||
|             self.root_fragment = self.fexml.fragment(xpath_ajuste) | ||||
|         self.root_fragment.placeholder_for('./ReemplazandoPredecesor', optional=True) | ||||
|         self.root_fragment.placeholder_for('./EliminandoPredecesor', optional=True) | ||||
|         if not namespace_ajuste: | ||||
|         self.root_fragment.placeholder_for('./Novedad', optional=False) | ||||
|         self.root_fragment.placeholder_for('./Periodo') | ||||
|         self.root_fragment.placeholder_for('./NumeroSecuenciaXML') | ||||
| @@ -375,10 +342,8 @@ class DIANNominaXML: | ||||
|         self.root_fragment.placeholder_for('./FechasPagos') | ||||
|         self.root_fragment.placeholder_for('./Devengados/Basico') | ||||
|         self.root_fragment.placeholder_for('./Devengados/Transporte', optional=True) | ||||
|         if not namespace_ajuste: | ||||
|  | ||||
|         self.novedad = self.root_fragment.fragment('./Novedad') | ||||
|         else: | ||||
|             self.novedad = None | ||||
|         self.informacion_general_xml = self.root_fragment.fragment('./InformacionGeneral') | ||||
|         self.periodo_xml = self.root_fragment.fragment('./Periodo') | ||||
|         self.fecha_pagos_xml = self.root_fragment.fragment('./FechasPagos') | ||||
| @@ -398,7 +363,6 @@ class DIANNominaXML: | ||||
|         if not isinstance(metadata, Metadata): | ||||
|             raise ValueError('se espera tipo Metadata') | ||||
|         self.metadata = metadata | ||||
|                  | ||||
|         self.metadata.apply(self.novedad, self.numero_secuencia_xml, self.lugar_generacion_xml, self.proveedor_xml) | ||||
|          | ||||
|     def asignar_informacion_general(self, general): | ||||
| @@ -555,8 +519,6 @@ class DIANNominaXML: | ||||
|         devengados_total = Amount(0.0) | ||||
|         for devengado in devengados: | ||||
|             devengados_total += devengado | ||||
|         # TODO(bit4bit) nque valor va redondeado? | ||||
|         # NIE186 | ||||
|         self.root_fragment.set_element('./Redondeo', str(round(0,2)))           | ||||
|         self.root_fragment.set_element('./DevengadosTotal', str(round(devengados_total,2))) | ||||
|  | ||||
| @@ -592,8 +554,6 @@ class DIANNominaIndividualDeAjuste(DIANNominaXML): | ||||
|             fecha_generacion: str | ||||
|  | ||||
|             def apply(self, fragment): | ||||
|                 # NIAE214 | ||||
|                 fragment.set_element('./TipoNota', '1')                 | ||||
|                 fragment.set_element('./Reemplazar/ReemplazandoPredecesor', None, | ||||
|                                      # NIAE090 | ||||
|                                      NumeroPred = self.numero, | ||||
| @@ -604,11 +564,9 @@ class DIANNominaIndividualDeAjuste(DIANNominaXML): | ||||
|                                      ) | ||||
|  | ||||
|         def __init__(self): | ||||
|             schema = "dian:gov:co:facturaelectronica:NominaIndividualDeAjuste NominaIndividualDeAjusteElectronicaXSD.xsd" | ||||
|              | ||||
|             super().__init__('NominaIndividualDeAjuste', './Reemplazar', schemaLocation=schema, namespace_ajuste='dian:gov:co:facturaelectronica:NominaIndividualDeAjuste') | ||||
|              | ||||
|             self.informacion_general_version = 'V1.0: Nota de Ajuste de Documento Soporte de Pago de Nómina Electrónica' | ||||
|             super().__init__('NominaIndividualDeAjuste', './Reemplazar') | ||||
|             # NIAE214 | ||||
|             self.root_fragment.set_element('./TipoNota', '1') | ||||
|  | ||||
|         def asignar_predecesor(self, predecesor): | ||||
|             if not isinstance(predecesor, self.Predecesor): | ||||
| @@ -625,7 +583,6 @@ class DIANNominaIndividualDeAjuste(DIANNominaXML): | ||||
|             fecha_generacion: str | ||||
|  | ||||
|             def apply(self, fragment): | ||||
|                 fragment.set_element('./TipoNota', '2') | ||||
|                 fragment.set_element('./Eliminar/EliminandoPredecesor', None, | ||||
|                                      # NIAE090 | ||||
|                                      NumeroPred = self.numero, | ||||
| @@ -636,9 +593,9 @@ class DIANNominaIndividualDeAjuste(DIANNominaXML): | ||||
|                                      ) | ||||
|  | ||||
|         def __init__(self): | ||||
|             schema = "dian:gov:co:facturaelectronica:NominaIndividualDeAjuste NominaIndividualDeAjusteElectronicaXSD.xsd"             | ||||
|             super().__init__('NominaIndividualDeAjuste', './Eliminar', schemaLocation=schema, namespace_ajuste='dian:gov:co:facturaelectronica:NominaIndividualDeAjuste') | ||||
|             super().__init__('NominaIndividualDeAjuste', './Eliminar') | ||||
|  | ||||
|             self.root_fragment.set_element('./TipoNota', '2') | ||||
|             self.informacion_general_version = "V1.0: Nota de Ajuste de Documento Soporte de Pago de Nómina Electrónica" | ||||
|  | ||||
|         def asignar_predecesor(self, predecesor): | ||||
|   | ||||
| @@ -1,17 +0,0 @@ | ||||
| attrs==22.1.0 | ||||
| distlib==0.3.6 | ||||
| filelock==3.8.0 | ||||
| iniconfig==1.1.1 | ||||
| packaging==21.3 | ||||
| platformdirs==2.5.2 | ||||
| pluggy==1.0.0 | ||||
| py==1.11.0 | ||||
| pyparsing==3.0.9 | ||||
| pytest==7.1.3 | ||||
| semantic-version==2.10.0 | ||||
| setuptools-rust==1.5.2 | ||||
| six==1.16.0 | ||||
| tomli==2.0.1 | ||||
| tox==3.26.0 | ||||
| typing_extensions==4.4.0 | ||||
| virtualenv==20.16.5 | ||||
							
								
								
									
										3
									
								
								scrips/nomina.csv
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								scrips/nomina.csv
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | ||||
| P,#,Nombre,P_Apellido,S_Apellido,Cédula,Dirección,Salario,Días,Salud,Pension,Aux Transpo,Sueldo,Fecha_pago,Fecha_Ingreso,Fecha_inicio,Fecha_fin,Fecha_generación,hora_generacion | ||||
| N,000005,JUAN,GONZALEZ,CARDONA,71380802,CL 35C 102-17 BL 7 AP 101,2400000,30,96000,96000,140606,2400000,2024-04-30,2022-01-05,2024-04-01,2024-04-30,2024-04-30,08:01:00 | ||||
| N,000006,VIVIANA,GIRALDO,VASQUEZ,32257132,CL 35C 102-17 BL 7 AP 101,1160000,30,46400,46400,140606,1160000,2024-04-30,2022-09-05,2024-04-01,2024-04-30,2024-04-30,08:01:00 | ||||
| 
 | 
							
								
								
									
										177
									
								
								scrips/nomina.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										177
									
								
								scrips/nomina.sh
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,177 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| SOFTWARE_PIN='20234' | ||||
| SOFTWARE_ID='100b0d10-0ca0-4ad4-a894-b704a568cbf3' | ||||
| NIT='901575528' | ||||
| DV='2' | ||||
| TIPO_AMBIENTE='AMBIENTE_PRUEBAS' | ||||
| RAZON_SOCIAL='BICI PIZZA S.A.S' | ||||
| SET_PRUEBAS='be4d232c-9c7b-4542-b24d-6044c4e316ce' | ||||
| PASSPHARASE='7U3XbtZ76W' | ||||
| #La ruta donde se encuentren estos archivos | ||||
| LLAVE_PRIVADA='privada.pem' | ||||
| LLAVE_PUBLICA='publica.pem' | ||||
| CERTIFICADO='Certificado.pfx' | ||||
| HABILITACION='True' | ||||
| ARCHIVO_CSV='nomina.csv' | ||||
|  | ||||
| IFS=, | ||||
| while read line; do | ||||
|      | ||||
|     field=(  $line ) | ||||
|  | ||||
|     Prefijo=${field[0]} | ||||
|     Numero=${field[1]} | ||||
|     Nombre=${field[2]} | ||||
|     P_Apellido=${field[3]} | ||||
|     S_Apellifo=${field[4]} | ||||
|     Cedula=${field[5]} | ||||
|     Direccion=${field[6]} | ||||
|     Salario=${field[7]} | ||||
|     Sueldo=${field[12]} | ||||
|     Dias=${field[8]} | ||||
|     Salud=${field[9]} | ||||
|     Pension=${field[10]} | ||||
|     AuxTp=${field[11]} | ||||
|     Pago=${field[13]} | ||||
|     Ingreso=${field[14]} | ||||
|     Inicio=${field[15]} | ||||
|     Fin=${field[16]} | ||||
|     Generacion=${field[17]} | ||||
|     Hora=${field[18]} | ||||
|      | ||||
|     echo " | ||||
| from facho import fe | ||||
|  | ||||
| SOFTWARE_PIN='${SOFTWARE_PIN}' | ||||
| SOFTWARE_ID='${SOFTWARE_ID}' | ||||
| NIT='${NIT}' | ||||
| DV='${DV}' | ||||
|  | ||||
| def extensions(nomina): | ||||
|     return [] | ||||
|  | ||||
| def nomina(): | ||||
|     nomina = fe.nomina.DIANNominaIndividual() | ||||
|  | ||||
|     nomina.asignar_fecha_pago('${Pago}') | ||||
|  | ||||
|     nomina.asignar_metadata(fe.nomina.Metadata( | ||||
|     novedad=fe.nomina.Novedad(value='false'), | ||||
|         secuencia=fe.nomina.NumeroSecuencia( | ||||
|             prefijo='${Prefijo}', | ||||
|             consecutivo='${Numero}' | ||||
|         ), | ||||
|         lugar_generacion=fe.nomina.Lugar( | ||||
|             pais = fe.nomina.Pais( | ||||
|                 code = 'CO' | ||||
|             ), | ||||
|             departamento = fe.nomina.Departamento( | ||||
|                 code = '05' | ||||
|             ), | ||||
|             municipio = fe.nomina.Municipio( | ||||
|                 code = '05001' | ||||
|             ), | ||||
|         ), | ||||
|         proveedor=fe.nomina.Proveedor( | ||||
| 	    razon_social='${RAZON_SOCIAL}', | ||||
|             nit=NIT, | ||||
|             dv=DV, | ||||
|             software_id=SOFTWARE_ID, | ||||
|             software_pin=SOFTWARE_PIN | ||||
|         ) | ||||
|     )) | ||||
|  | ||||
|     nomina.asignar_periodo(fe.nomina.Periodo( | ||||
|         fecha_ingreso= '${Ingreso}', | ||||
|         fecha_liquidacion_inicio='${Inicio}', | ||||
|         fecha_liquidacion_fin='${Fin}', | ||||
|         fecha_generacion='${Generacion}' | ||||
|     )) | ||||
|  | ||||
|     nomina.asignar_informacion_general(fe.nomina.InformacionGeneral( | ||||
|         fecha_generacion = '${Generacion}', | ||||
|         hora_generacion = '${Hora}-05:00', | ||||
|         tipo_ambiente = fe.nomina.InformacionGeneral.${TIPO_AMBIENTE}, | ||||
|         software_pin = SOFTWARE_PIN, | ||||
|         periodo_nomina = fe.nomina.PeriodoNomina(code='1'), | ||||
|         tipo_moneda = fe.nomina.TipoMoneda(code='COP') | ||||
|     )) | ||||
|  | ||||
|     nomina.asignar_pago(fe.nomina.Pago( | ||||
|         forma=fe.nomina.FormaPago( | ||||
|             code='1', | ||||
|         ), | ||||
|         metodo=fe.nomina.MetodoPago( | ||||
|             code='10' | ||||
|         ) | ||||
|     )) | ||||
|     nomina.asignar_empleador(fe.nomina.Empleador( | ||||
| 	razon_social='${RAZON_SOCIAL}', | ||||
|         nit = NIT, | ||||
|         dv = DV, | ||||
|         pais = fe.nomina.Pais( | ||||
|             code = 'CO' | ||||
|         ), | ||||
|         departamento = fe.nomina.Departamento( | ||||
|             code = '05' | ||||
|         ), | ||||
|         municipio = fe.nomina.Municipio( | ||||
|             code = '05001' | ||||
|         ), | ||||
|         direccion = 'calle etrivial' | ||||
|     )) | ||||
|  | ||||
|     nomina.asignar_trabajador(fe.nomina.Trabajador( | ||||
|         tipo_contrato = fe.nomina.TipoContrato( | ||||
|             code = '1' | ||||
|         ), | ||||
|         alto_riesgo = False, | ||||
|         tipo_documento = fe.nomina.TipoDocumento( | ||||
|             code = '11' | ||||
|         ), | ||||
|         primer_apellido = '${P_Apellido}', | ||||
|         segundo_apellido = '${S_Apellido}', | ||||
|         primer_nombre = '${Nombre}', | ||||
|         lugar_trabajo = fe.nomina.LugarTrabajo( | ||||
|             pais = fe.nomina.Pais(code='CO'), | ||||
|             departamento = fe.nomina.Departamento(code='05'), | ||||
|             municipio = fe.nomina.Municipio(code='05001'), | ||||
|             direccion = '${Direccion}' | ||||
|         ), | ||||
|         numero_documento = NIT, | ||||
|         tipo = fe.nomina.TipoTrabajador( | ||||
|             code = '01' | ||||
|         ), | ||||
|         salario_integral = False, | ||||
|         sueldo = fe.nomina.Amount(${Sueldo}) | ||||
|     )) | ||||
|  | ||||
|     nomina.adicionar_devengado(fe.nomina.DevengadoBasico( | ||||
|         dias_trabajados = ${field[8]}, | ||||
|         sueldo_trabajado = fe.nomina.Amount(${Salario}) | ||||
|     )) | ||||
|  | ||||
|     nomina.adicionar_deduccion(fe.nomina.DeduccionSalud( | ||||
|         porcentaje = fe.nomina.Amount(4), | ||||
|         deduccion = fe.nomina.Amount(${Salud}) | ||||
|     )) | ||||
|  | ||||
|     nomina.adicionar_deduccion(fe.nomina.DeduccionFondoPension( | ||||
|         porcentaje=fe.nomina.Amount(4), | ||||
|         deduccion = fe.nomina.Amount(${Pension}) | ||||
|     )) | ||||
|     return nomina | ||||
|     "  > "${Prefijo}${Numero}".py | ||||
|     facho generate-nomina --private-key ${CERTIFICADO} --passphrase ${PASSPHARASE} --use-cache-policy --sign "${field[0]}${field[1]}".py  "${Prefijo}${Numero}".xml | ||||
|     CUNE=`grep -oP "<CodigoQR>(.*)</CodigoQR>" "${Prefijo}${Numero}".xml | sed -n  's/.*documentkey=\([^<]*\)<\/CodigoQR>.*/\1/p'` | ||||
|     zip "${field[0]}${field[1]}".zip "${field[0]}${field[1]}".xml | ||||
|     if [ "$HABILITACION" == "True" ];then | ||||
| 	facho soap-send-test-set-async --private-key ${LLAVE_PRIVADA} --public-key ${LLAVE_PUBLICA} --habilitacion --password ${PASSPHARASE} --test-setid ${SET_PRUEBAS} "${field[0]}${field[1]}".xml "${field[0]}${field[1]}".zip | ||||
|     else | ||||
| 	facho soap-send-nomina-sync --private-key ${LLAVE_PRIVADA} --public-key ${LLAVE_PUBLICA} --password ${PASSPHARASE} "${field[0]}${field[1]}".xml "${field[0]}${field[1]}".zip --produccion | ||||
|     fi | ||||
|     | ||||
|  | ||||
| done < ${ARCHIVO_CSV} | ||||
|  | ||||
							
								
								
									
										15
									
								
								setup.py
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								setup.py
									
									
									
									
									
								
							| @@ -13,18 +13,19 @@ with open('README.rst') as readme_file: | ||||
| with open('HISTORY.rst') as history_file: | ||||
|     history = history_file.read() | ||||
|  | ||||
| requirements = ['Click>=6.0', | ||||
|                 'zeep==4.0.0', | ||||
|                 'lxml==4.6.3', | ||||
| requirements = ['Click>=8.1.7',  | ||||
|                 'zeep==4.2.1',  | ||||
|                 'lxml==5.2.2',  | ||||
|                 'cryptography==3.3.2',  | ||||
|                 'pyOpenSSL==20.0.1',  | ||||
|                 'xmlsig==0.1.7',  | ||||
|                 'xades==0.2.2', | ||||
|                 'xmlsec==1.3.12', | ||||
|                 'xades==1.0.0',  | ||||
|                 'xmlsec==1.3.14',  | ||||
|                 'python-dateutil==2.9.0.post0',  | ||||
|                 # usamos esta dependencia en runtime  | ||||
|                 # para forzar uso de policy_id de archivo local  | ||||
|                 'mock>=2.0.0', | ||||
|                 'xmlschema>=1.8'] | ||||
|                 'mock>=5.1.0',  | ||||
|                 'xmlschema>=3.0.0' ] | ||||
|  | ||||
| setup_requirements = ['pytest-runner', ] | ||||
|  | ||||
|   | ||||
| @@ -33,23 +33,6 @@ def test_invoicesimple_build_with_cufe(simple_invoice): | ||||
|     cufe = xml.get_element_text('/fe:Invoice/cbc:UUID') | ||||
|     assert cufe != '' | ||||
|  | ||||
| def test_invoice_profile_id(simple_invoice): | ||||
|     xml = DIANInvoiceXML(simple_invoice) | ||||
|     cufe_extension = fe.DianXMLExtensionCUFE(simple_invoice) | ||||
|     xml.add_extension(cufe_extension) | ||||
|     assert xml.get_element_text('/fe:Invoice/cbc:ProfileID') == 'DIAN 2.1: Factura Electrónica de Venta' | ||||
|  | ||||
| def test_debit_note_profile_id(simple_invoice): | ||||
|     xml = DIANDebitNoteXML(simple_invoice) | ||||
|     cufe_extension = fe.DianXMLExtensionCUFE(simple_invoice) | ||||
|     xml.add_extension(cufe_extension) | ||||
|     assert xml.get_element_text('/fe:DebitNote/cbc:ProfileID') == 'DIAN 2.1 Nota Débito de Factura Electrónica de Venta' | ||||
|  | ||||
| def test_credit_note_profile_id(simple_invoice): | ||||
|     xml = DIANCreditNoteXML(simple_invoice) | ||||
|     cufe_extension = fe.DianXMLExtensionCUFE(simple_invoice) | ||||
|     xml.add_extension(cufe_extension) | ||||
|     assert xml.get_element_text('/fe:CreditNote/cbc:ProfileID') == 'DIAN 2.1: Nota Crédito de Factura Electrónica de Venta' | ||||
|  | ||||
| def test_invoicesimple_xml_signed(monkeypatch, simple_invoice): | ||||
|     xml = DIANInvoiceXML(simple_invoice) | ||||
|   | ||||
| @@ -4,7 +4,6 @@ | ||||
| # this repository contains the full copyright notices and license terms. | ||||
|  | ||||
| """Tests for `facho` package.""" | ||||
| import re | ||||
|  | ||||
| import pytest | ||||
|  | ||||
| @@ -28,8 +27,8 @@ def test_adicionar_devengado_Basico(): | ||||
|     )) | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|     assert xml.get_element_attribute('/nomina:NominaIndividual/Devengados/Basico', 'DiasTrabajados') == '30' | ||||
|     assert xml.get_element_attribute('/nomina:NominaIndividual/Devengados/Basico', 'SueldoTrabajado') == '1000000.00' | ||||
|     assert xml.get_element_attribute('/fe:NominaIndividual/Devengados/Basico', 'DiasTrabajados') == '30' | ||||
|     assert xml.get_element_attribute('/fe:NominaIndividual/Devengados/Basico', 'SueldoTrabajado') == '1000000.00' | ||||
|  | ||||
| def test_adicionar_devengado_transporte(): | ||||
|     nomina = fe.nomina.DIANNominaIndividual() | ||||
| @@ -40,7 +39,7 @@ def test_adicionar_devengado_transporte(): | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|  | ||||
|     assert xml.get_element_attribute('/nomina:NominaIndividual/Devengados/Transporte', 'AuxilioTransporte') == '2000000.0' | ||||
|     assert xml.get_element_attribute('/fe:NominaIndividual/Devengados/Transporte', 'AuxilioTransporte') == '2000000.0' | ||||
|  | ||||
| def test_adicionar_devengado_comprobante_total(): | ||||
|     nomina = fe.nomina.DIANNominaIndividual() | ||||
| @@ -58,7 +57,7 @@ def test_adicionar_devengado_comprobante_total(): | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|  | ||||
|     assert xml.get_element_text('/nomina:NominaIndividual/ComprobanteTotal') == '1000000.00' | ||||
|     assert xml.get_element_text('/fe:NominaIndividual/ComprobanteTotal') == '1000000.00' | ||||
|  | ||||
| def test_adicionar_devengado_comprobante_total_cero(): | ||||
|     nomina = fe.nomina.DIANNominaIndividual() | ||||
| @@ -75,7 +74,7 @@ def test_adicionar_devengado_comprobante_total_cero(): | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|  | ||||
|     assert xml.get_element_text('/nomina:NominaIndividual/ComprobanteTotal') == '0.00' | ||||
|     assert xml.get_element_text('/fe:NominaIndividual/ComprobanteTotal') == '0.00' | ||||
|  | ||||
| def test_adicionar_devengado_transporte_muchos(): | ||||
|     nomina = fe.nomina.DIANNominaIndividual() | ||||
| @@ -90,7 +89,7 @@ def test_adicionar_devengado_transporte_muchos(): | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|     print(xml) | ||||
|     assert xml.get_element_text('/nomina:NominaIndividual/DevengadosTotal') == '5000000.00' | ||||
|     assert xml.get_element_text('/fe:NominaIndividual/DevengadosTotal') == '5000000.00' | ||||
|  | ||||
| def test_adicionar_deduccion_salud(): | ||||
|     nomina = fe.nomina.DIANNominaIndividual() | ||||
| @@ -107,7 +106,7 @@ def test_adicionar_deduccion_salud(): | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|     print(xml) | ||||
|     assert xml.get_element_text('/nomina:NominaIndividual/DeduccionesTotal') == '1000.00' | ||||
|     assert xml.get_element_text('/fe:NominaIndividual/DeduccionesTotal') == '1000.00' | ||||
|  | ||||
| def test_nomina_obligatorios_segun_anexo_tecnico(): | ||||
|     nomina = fe.nomina.DIANNominaIndividual() | ||||
| @@ -123,10 +122,6 @@ def test_nomina_xml(): | ||||
|     nomina = fe.nomina.DIANNominaIndividual() | ||||
|  | ||||
|     nomina.asignar_metadata(fe.nomina.Metadata( | ||||
|         novedad=fe.nomina.Novedad( | ||||
|             activa = True, | ||||
|             cune = "N0111" | ||||
|         ), | ||||
|         secuencia=fe.nomina.NumeroSecuencia( | ||||
|             prefijo = 'N', | ||||
|             consecutivo='00001' | ||||
| @@ -156,7 +151,6 @@ def test_nomina_xml(): | ||||
|         hora_generacion = '1053:10-05:00', | ||||
|         tipo_ambiente = fe.nomina.InformacionGeneral.AMBIENTE_PRODUCCION, | ||||
|         software_pin = '693', | ||||
|         tipo_xml = fe.nomina.InformacionGeneral.TIPO_XML_NORMAL, | ||||
|         periodo_nomina = fe.nomina.PeriodoNomina(code='1'), | ||||
|         tipo_moneda = fe.nomina.TipoMoneda(code='COP') | ||||
|     )) | ||||
| @@ -213,26 +207,25 @@ def test_nomina_xml(): | ||||
|     )) | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|     expected_cune = 'b8f9b6c24de07ffd92ea5467433a3b69357cfaffa7c19722db94b2e0eca41d057085a54f484b5da15ff585e773b0b0ab' | ||||
|     assert xml.get_element_attribute('/nomina:NominaIndividual/InformacionGeneral', 'CUNE') == expected_cune | ||||
|     assert xml.get_element_attribute('/nomina:NominaIndividual/InformacionGeneral', 'TipoXML') == '102' | ||||
|     assert xml.get_element_text_or_attribute('/nomina:NominaIndividual/NumeroSecuenciaXML/@Numero') == 'N00001' | ||||
|     assert xml.get_element_text_or_attribute('/nomina:NominaIndividual/NumeroSecuenciaXML/@Consecutivo') == '00001' | ||||
|     assert xml.get_element_text_or_attribute('/nomina:NominaIndividual/LugarGeneracionXML/@Pais') == 'CO' | ||||
|     assert xml.get_element_text_or_attribute('/nomina:NominaIndividual/LugarGeneracionXML/@DepartamentoEstado') == '05' | ||||
|     assert xml.get_element_text_or_attribute('/nomina:NominaIndividual/LugarGeneracionXML/@MunicipioCiudad') == '05001' | ||||
|     assert xml.get_element_text_or_attribute('/nomina:NominaIndividual/ProveedorXML/@NIT') == '999999' | ||||
|     assert xml.get_element_text_or_attribute('/nomina:NominaIndividual/ProveedorXML/@DV') == '2' | ||||
|     assert xml.get_element_text_or_attribute('/nomina:NominaIndividual/ProveedorXML/@SoftwareID') == 'xx' | ||||
|     assert xml.get_element_text_or_attribute('/nomina:NominaIndividual/ProveedorXML/@SoftwareSC') is not None | ||||
|     assert xml.get_element_text_or_attribute('/nomina:NominaIndividual/CodigoQR') == f"https://catalogo-vpfe.dian.gov.co/document/searchqr?documentkey={expected_cune}" | ||||
|     assert xml.get_element_text_or_attribute('/nomina:NominaIndividual/Empleador/@NIT') == '700085371' | ||||
|     assert xml.get_element_text_or_attribute('/nomina:NominaIndividual/Trabajador/@NumeroDocumento') == '800199436' | ||||
|     assert xml.get_element_text_or_attribute('/nomina:NominaIndividual/Novedad') == 'True' | ||||
|     assert xml.get_element_text_or_attribute('/nomina:NominaIndividual/Novedad/@CUNENov') == 'N0111' | ||||
|     # TODO(bit4bit) no logro generar cune igual al del anexo tecnico | ||||
|     #assert xml.get_element_attribute('/fe:NominaIndividual/InformacionGeneral', 'CUNE') == '16560dc8956122e84ffb743c817fe7d494e058a44d9ca3fa4c234c268b4f766003253fbee7ea4af9682dd57210f3bac2' | ||||
|  | ||||
|     # confirmar el namespace | ||||
|     assert 'xmlns="dian:gov:co:facturaelectronica:NominaIndividual"' in xml.tostring() | ||||
|     expected_cune = 'b8f9b6c24de07ffd92ea5467433a3b69357cfaffa7c19722db94b2e0eca41d057085a54f484b5da15ff585e773b0b0ab' | ||||
|     assert xml.get_element_attribute('/fe:NominaIndividual/InformacionGeneral', 'fachoCUNE')  == "N000012020-01-161053:10-05:003500000.001000000.002500000.007000853718001994361026931" | ||||
|     assert xml.get_element_attribute('/fe:NominaIndividual/InformacionGeneral', 'CUNE') == expected_cune | ||||
|     assert xml.get_element_text_or_attribute('/fe:NominaIndividual/NumeroSecuenciaXML/@Numero') == 'N00001' | ||||
|     assert xml.get_element_text_or_attribute('/fe:NominaIndividual/NumeroSecuenciaXML/@Consecutivo') == '00001' | ||||
|     assert xml.get_element_text_or_attribute('/fe:NominaIndividual/LugarGeneracionXML/@Pais') == 'CO' | ||||
|     assert xml.get_element_text_or_attribute('/fe:NominaIndividual/LugarGeneracionXML/@DepartamentoEstado') == '05' | ||||
|     assert xml.get_element_text_or_attribute('/fe:NominaIndividual/LugarGeneracionXML/@MunicipioCiudad') == '05001' | ||||
|     assert xml.get_element_text_or_attribute('/fe:NominaIndividual/ProveedorXML/@NIT') == '999999' | ||||
|     assert xml.get_element_text_or_attribute('/fe:NominaIndividual/ProveedorXML/@DV') == '2' | ||||
|     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.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' | ||||
|  | ||||
| def test_asignar_pago(): | ||||
|     nomina = fe.nomina.DIANNominaIndividual() | ||||
| @@ -249,10 +242,147 @@ def test_nomina_xmlsign(monkeypatch): | ||||
|     xml.add_extension(signer) | ||||
|  | ||||
|     print(xml.tostring()) | ||||
|     elem = xml.get_element('/nomina:NominaIndividual/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/ds:Signature') | ||||
|     elem = xml.get_element('/fe:NominaIndividual/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/ds:Signature') | ||||
|     assert elem is not None | ||||
|  | ||||
|  | ||||
| def atest_nomina_ajuste_reemplazar(): | ||||
|     nomina = fe.nomina.DIANNominaIndividualDeAjuste.Reemplazar() | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|     print(xml) | ||||
|     assert False | ||||
|  | ||||
|  | ||||
| def test_adicionar_reemplazar_devengado_comprobante_total(): | ||||
|     nomina = fe.nomina.DIANNominaIndividualDeAjuste.Reemplazar() | ||||
|  | ||||
|     nomina.adicionar_devengado(fe.nomina.DevengadoBasico( | ||||
|         dias_trabajados = 60, | ||||
|         sueldo_trabajado = fe.nomina.Amount(2_000_000) | ||||
|     )) | ||||
|  | ||||
|     nomina.adicionar_deduccion(fe.nomina.DeduccionSalud( | ||||
|         porcentaje = fe.nomina.Amount(19), | ||||
|         deduccion = fe.nomina.Amount(1_000_000) | ||||
|     )) | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|  | ||||
|     assert xml.get_element_text('/fe:NominaIndividualDeAjuste/Reemplazar/ComprobanteTotal') == '1000000.00' | ||||
|  | ||||
|  | ||||
| def test_adicionar_reemplazar_asignar_predecesor(): | ||||
|     nomina = fe.nomina.DIANNominaIndividualDeAjuste.Reemplazar() | ||||
|  | ||||
|     nomina.asignar_predecesor(fe.nomina.DIANNominaIndividualDeAjuste.Reemplazar.Predecesor( | ||||
|         numero = '123456', | ||||
|         cune = 'ABC123456', | ||||
|         fecha_generacion = '2021-11-16' | ||||
|     )) | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|     print(xml.tostring()) | ||||
|     assert xml.get_element_text_or_attribute('/fe:NominaIndividualDeAjuste/Reemplazar/ReemplazandoPredecesor/@NumeroPred') == '123456' | ||||
|     assert xml.get_element_text_or_attribute('/fe:NominaIndividualDeAjuste/Reemplazar/ReemplazandoPredecesor/@CUNEPred') == 'ABC123456' | ||||
|     assert xml.get_element_text_or_attribute('/fe:NominaIndividualDeAjuste/Reemplazar/ReemplazandoPredecesor/@FechaGenPred') == '2021-11-16' | ||||
|  | ||||
|  | ||||
| def test_adicionar_reemplazar_eliminar_predecesor_opcional(): | ||||
|     nomina = fe.nomina.DIANNominaIndividualDeAjuste.Reemplazar() | ||||
|  | ||||
|     nomina.asignar_predecesor(fe.nomina.DIANNominaIndividualDeAjuste.Reemplazar.Predecesor( | ||||
|         numero = '123456', | ||||
|         cune = 'ABC123456', | ||||
|         fecha_generacion = '2021-11-16' | ||||
|     )) | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|     print(xml.tostring()) | ||||
|  | ||||
|     assert xml.get_element('/fe:NominaIndividualDeAjuste/Reemplazar/ReemplazandoPredecesor') is not None | ||||
|     assert xml.get_element('/fe:NominaIndividualDeAjuste/Eliminar/EliminandoPredecesor') is None | ||||
|  | ||||
| def test_adicionar_eliminar_reemplazar_predecesor_opcional(): | ||||
|     nomina = fe.nomina.DIANNominaIndividualDeAjuste.Eliminar() | ||||
|  | ||||
|     nomina.asignar_predecesor(fe.nomina.DIANNominaIndividualDeAjuste.Eliminar.Predecesor( | ||||
|         numero = '123456', | ||||
|         cune = 'ABC123456', | ||||
|         fecha_generacion = '2021-11-16' | ||||
|     )) | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|     print(xml.tostring()) | ||||
|     assert xml.get_element('/fe:NominaIndividualDeAjuste/Eliminar/EliminandoPredecesor') is not None | ||||
|     assert xml.get_element('/fe:NominaIndividualDeAjuste/Reemplazar/ReemplazandoPredecesor') is None | ||||
|  | ||||
| def test_adicionar_eliminar_devengado_comprobante_total(): | ||||
|     nomina = fe.nomina.DIANNominaIndividualDeAjuste.Eliminar() | ||||
|  | ||||
|     nomina.adicionar_devengado(fe.nomina.DevengadoBasico( | ||||
|         dias_trabajados = 60, | ||||
|         sueldo_trabajado = fe.nomina.Amount(2_000_000) | ||||
|     )) | ||||
|  | ||||
|     nomina.adicionar_deduccion(fe.nomina.DeduccionSalud( | ||||
|         porcentaje = fe.nomina.Amount(19), | ||||
|         deduccion = fe.nomina.Amount(1_000_000) | ||||
|     )) | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|  | ||||
|     assert xml.get_element_text('/fe:NominaIndividualDeAjuste/Eliminar/ComprobanteTotal') == '1000000.00' | ||||
|  | ||||
| def test_adicionar_eliminar_asignar_predecesor(): | ||||
|     nomina = fe.nomina.DIANNominaIndividualDeAjuste.Eliminar() | ||||
|  | ||||
|     nomina.asignar_predecesor(fe.nomina.DIANNominaIndividualDeAjuste.Eliminar.Predecesor( | ||||
|         numero = '123456', | ||||
|         cune = 'ABC123456', | ||||
|         fecha_generacion = '2021-11-16' | ||||
|     )) | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|     print(xml.tostring()) | ||||
|     assert xml.get_element_text_or_attribute('/fe:NominaIndividualDeAjuste/Eliminar/EliminandoPredecesor/@NumeroPred') == '123456' | ||||
|     assert xml.get_element_text_or_attribute('/fe:NominaIndividualDeAjuste/Eliminar/EliminandoPredecesor/@CUNEPred') == 'ABC123456' | ||||
|     assert xml.get_element_text_or_attribute('/fe:NominaIndividualDeAjuste/Eliminar/EliminandoPredecesor/@FechaGenPred') == '2021-11-16' | ||||
|  | ||||
| def test_nomina_devengado_horas_extras_diarias(): | ||||
|     nomina = fe.nomina.DIANNominaIndividual() | ||||
|  | ||||
|     nomina.adicionar_devengado(fe.nomina.DevengadoHorasExtrasDiarias( | ||||
|         horas_extras=[ | ||||
|             fe.nomina.DevengadoHoraExtra( | ||||
|                 hora_inicio='2021-11-30T19:09:55', | ||||
|                 hora_fin='2021-11-30T20:09:55', | ||||
|                 cantidad=1, | ||||
|                 porcentaje=fe.nomina.Amount(1), | ||||
|                 pago=fe.nomina.Amount(100) | ||||
|             ), | ||||
|             fe.nomina.DevengadoHoraExtra( | ||||
|                 hora_inicio='2021-11-30T18:09:55', | ||||
|                 hora_fin='2021-11-30T19:09:55', | ||||
|                 cantidad=2, | ||||
|                 porcentaje=fe.nomina.Amount(2), | ||||
|                 pago=fe.nomina.Amount(200) | ||||
|             ) | ||||
|         ] | ||||
|     )) | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|     extras = xml.get_element('/fe:NominaIndividual/Devengados/HEDs/HED', multiple=True) | ||||
|     assert extras[0].get('HoraInicio') == '2021-11-30T19:09:55' | ||||
|     assert extras[0].get('HoraFin') == '2021-11-30T20:09:55' | ||||
|     assert extras[0].get('Cantidad') == '1' | ||||
|     assert extras[0].get('Porcentaje') == '1.00' | ||||
|     assert extras[0].get('Pago') == '100.00' | ||||
|     assert extras[1].get('HoraInicio') == '2021-11-30T18:09:55' | ||||
|     assert extras[1].get('HoraFin') == '2021-11-30T19:09:55' | ||||
|     assert extras[1].get('Cantidad') == '2' | ||||
|     assert extras[1].get('Porcentaje') == '2.00' | ||||
|     assert extras[1].get('Pago') == '200.00' | ||||
|  | ||||
| def test_nomina_devengado_horas_extras_nocturnas(): | ||||
|     nomina = fe.nomina.DIANNominaIndividual() | ||||
| @@ -277,7 +407,7 @@ def test_nomina_devengado_horas_extras_nocturnas(): | ||||
|     )) | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|     extras = xml.get_element('/nomina:NominaIndividual/Devengados/HENs/HEN', multiple=True) | ||||
|     extras = xml.get_element('/fe:NominaIndividual/Devengados/HENs/HEN', multiple=True) | ||||
|     assert extras[0].get('HoraInicio') == '2021-11-30T19:09:55' | ||||
|     assert extras[0].get('HoraFin') == '2021-11-30T20:09:55' | ||||
|     assert extras[0].get('Cantidad') == '1' | ||||
| @@ -312,7 +442,7 @@ def test_nomina_devengado_horas_recargo_nocturno(): | ||||
|     )) | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|     extras = xml.get_element('/nomina:NominaIndividual/Devengados/HRNs/HRN', multiple=True) | ||||
|     extras = xml.get_element('/fe:NominaIndividual/Devengados/HRNs/HRN', multiple=True) | ||||
|     assert extras[0].get('HoraInicio') == '2021-11-30T19:09:55' | ||||
|     assert extras[0].get('HoraFin') == '2021-11-30T20:09:55' | ||||
|     assert extras[0].get('Cantidad') == '1' | ||||
| @@ -347,7 +477,7 @@ def test_nomina_devengado_horas_extras_diarias_dominicales_y_festivos(): | ||||
|     )) | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|     extras = xml.get_element('/nomina:NominaIndividual/Devengados/HEDDFs/HEDDF', multiple=True) | ||||
|     extras = xml.get_element('/fe:NominaIndividual/Devengados/HEDDFs/HEDDF', multiple=True) | ||||
|     assert extras[0].get('HoraInicio') == '2021-11-30T19:09:55' | ||||
|     assert extras[0].get('HoraFin') == '2021-11-30T20:09:55' | ||||
|     assert extras[0].get('Cantidad') == '1' | ||||
| @@ -382,7 +512,7 @@ def test_nomina_devengado_horas_recargo_diarias_dominicales_y_festivos(): | ||||
|     )) | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|     extras = xml.get_element('/nomina:NominaIndividual/Devengados/HRDDFs/HRDDF', multiple=True) | ||||
|     extras = xml.get_element('/fe:NominaIndividual/Devengados/HRDDFs/HRDDF', multiple=True) | ||||
|     assert extras[0].get('HoraInicio') == '2021-11-30T19:09:55' | ||||
|     assert extras[0].get('HoraFin') == '2021-11-30T20:09:55' | ||||
|     assert extras[0].get('Cantidad') == '1' | ||||
| @@ -418,7 +548,7 @@ def test_nomina_devengado_horas_extras_nocturnas_dominicales_y_festivos(): | ||||
|     )) | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|     extras = xml.get_element('/nomina:NominaIndividual/Devengados/HENDFs/HENDF', multiple=True) | ||||
|     extras = xml.get_element('/fe:NominaIndividual/Devengados/HENDFs/HENDF', multiple=True) | ||||
|     assert extras[0].get('HoraInicio') == '2021-11-30T19:09:55' | ||||
|     assert extras[0].get('HoraFin') == '2021-11-30T20:09:55' | ||||
|     assert extras[0].get('Cantidad') == '1' | ||||
| @@ -453,7 +583,7 @@ def test_nomina_devengado_horas_recargo_nocturno_dominicales_y_festivos(): | ||||
|     )) | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|     extras = xml.get_element('/nomina:NominaIndividual/Devengados/HRNDFs/HRNDF', multiple=True) | ||||
|     extras = xml.get_element('/fe:NominaIndividual/Devengados/HRNDFs/HRNDF', multiple=True) | ||||
|     assert extras[0].get('HoraInicio') == '2021-11-30T19:09:55' | ||||
|     assert extras[0].get('HoraFin') == '2021-11-30T20:09:55' | ||||
|     assert extras[0].get('Cantidad') == '1' | ||||
|   | ||||
| @@ -1,235 +0,0 @@ | ||||
| #!/usr/bin/env python | ||||
| # -*- coding: utf-8 -*- | ||||
| # This file is part of facho.  The COPYRIGHT file at the top level of | ||||
| # this repository contains the full copyright notices and license terms. | ||||
|  | ||||
| """Tests for `facho` package.""" | ||||
| import re | ||||
|  | ||||
| import pytest | ||||
|  | ||||
| from facho import fe | ||||
|  | ||||
| import helpers | ||||
|  | ||||
| def atest_nomina_ajuste_reemplazar(): | ||||
|     nomina = fe.nomina.DIANNominaIndividualDeAjuste.Reemplazar() | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|     print(xml) | ||||
|     assert False | ||||
|  | ||||
| def test_nomina_ajuste_reemplazar_asignacion_tipo_xml(): | ||||
|     nomina = fe.nomina.DIANNominaIndividualDeAjuste.Reemplazar() | ||||
|     nomina.asignar_metadata(fe.nomina.Metadata( | ||||
|         novedad=fe.nomina.Novedad( | ||||
|             activa = True, | ||||
|             cune = "N0111" | ||||
|         ), | ||||
|         secuencia=fe.nomina.NumeroSecuencia( | ||||
|             prefijo = 'N', | ||||
|             consecutivo='00001' | ||||
|         ), | ||||
|         lugar_generacion=fe.nomina.Lugar( | ||||
|             pais = fe.nomina.Pais( | ||||
|                 code = 'CO' | ||||
|             ), | ||||
|             departamento = fe.nomina.Departamento( | ||||
|                 code = '05' | ||||
|             ), | ||||
|             municipio = fe.nomina.Municipio( | ||||
|                 code = '05001' | ||||
|             ), | ||||
|         ), | ||||
|         proveedor=fe.nomina.Proveedor( | ||||
|             nit='999999', | ||||
|             dv=2, | ||||
|             software_id='xx', | ||||
|             software_pin='12', | ||||
|             razon_social='facho' | ||||
|         ) | ||||
|     )) | ||||
|     nomina.asignar_empleador(fe.nomina.Empleador( | ||||
|         razon_social='facho', | ||||
|         nit = '700085371', | ||||
|         dv = '1', | ||||
|         pais = fe.nomina.Pais( | ||||
|             code = 'CO' | ||||
|         ), | ||||
|         departamento = fe.nomina.Departamento( | ||||
|             code = '05' | ||||
|         ), | ||||
|         municipio = fe.nomina.Municipio( | ||||
|             code = '05001' | ||||
|         ), | ||||
|         direccion = 'calle etrivial' | ||||
|     )) | ||||
|  | ||||
|     nomina.asignar_trabajador(fe.nomina.Trabajador( | ||||
|         tipo_contrato = fe.nomina.TipoContrato( | ||||
|             code = '1' | ||||
|         ), | ||||
|         alto_riesgo = False, | ||||
|         tipo_documento = fe.nomina.TipoDocumento( | ||||
|             code = '11' | ||||
|         ), | ||||
|         primer_apellido = 'gnu', | ||||
|         segundo_apellido = 'emacs', | ||||
|         primer_nombre = 'facho', | ||||
|         lugar_trabajo = fe.nomina.LugarTrabajo( | ||||
|             pais = fe.nomina.Pais(code='CO'), | ||||
|             departamento = fe.nomina.Departamento(code='05'), | ||||
|             municipio = fe.nomina.Municipio(code='05001'), | ||||
|             direccion = 'calle facho' | ||||
|         ), | ||||
|         numero_documento = '800199436', | ||||
|         tipo = fe.nomina.TipoTrabajador( | ||||
|             code = '01' | ||||
|         ), | ||||
|         salario_integral = True, | ||||
|         sueldo = fe.nomina.Amount(1_500_000) | ||||
|     )) | ||||
|     nomina.asignar_informacion_general(fe.nomina.InformacionGeneral( | ||||
|         fecha_generacion = '2020-01-16', | ||||
|         hora_generacion = '1053:10-05:00', | ||||
|         tipo_ambiente = fe.nomina.InformacionGeneral.AMBIENTE_PRODUCCION, | ||||
|         software_pin = '693', | ||||
|         tipo_xml = fe.nomina.InformacionGeneral.TIPO_XML_AJUSTES, | ||||
|         periodo_nomina = fe.nomina.PeriodoNomina(code='1'), | ||||
|         tipo_moneda = fe.nomina.TipoMoneda(code='COP') | ||||
|     )) | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|  | ||||
|     assert xml.get_element_attribute('/nominaajuste:NominaIndividualDeAjuste/Reemplazar/InformacionGeneral', 'TipoXML') == '103' | ||||
|  | ||||
|  | ||||
| def test_adicionar_reemplazar_devengado_comprobante_total(): | ||||
|     nomina = fe.nomina.DIANNominaIndividualDeAjuste.Reemplazar() | ||||
|  | ||||
|     nomina.adicionar_devengado(fe.nomina.DevengadoBasico( | ||||
|         dias_trabajados = 60, | ||||
|         sueldo_trabajado = fe.nomina.Amount(2_000_000) | ||||
|     )) | ||||
|  | ||||
|     nomina.adicionar_deduccion(fe.nomina.DeduccionSalud( | ||||
|         porcentaje = fe.nomina.Amount(19), | ||||
|         deduccion = fe.nomina.Amount(1_000_000) | ||||
|     )) | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|  | ||||
|     assert xml.get_element_text('/nominaajuste:NominaIndividualDeAjuste/Reemplazar/ComprobanteTotal') == '1000000.00' | ||||
|  | ||||
|  | ||||
| def test_adicionar_reemplazar_asignar_predecesor(): | ||||
|     nomina = fe.nomina.DIANNominaIndividualDeAjuste.Reemplazar() | ||||
|  | ||||
|     nomina.asignar_predecesor(fe.nomina.DIANNominaIndividualDeAjuste.Reemplazar.Predecesor( | ||||
|         numero = '123456', | ||||
|         cune = 'ABC123456', | ||||
|         fecha_generacion = '2021-11-16' | ||||
|     )) | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|     print(xml.tostring()) | ||||
|     assert xml.get_element_text_or_attribute('/nominaajuste:NominaIndividualDeAjuste/Reemplazar/ReemplazandoPredecesor/@NumeroPred') == '123456' | ||||
|     assert xml.get_element_text_or_attribute('/nominaajuste:NominaIndividualDeAjuste/Reemplazar/ReemplazandoPredecesor/@CUNEPred') == 'ABC123456' | ||||
|     assert xml.get_element_text_or_attribute('/nominaajuste:NominaIndividualDeAjuste/Reemplazar/ReemplazandoPredecesor/@FechaGenPred') == '2021-11-16' | ||||
|  | ||||
|  | ||||
| def test_adicionar_reemplazar_eliminar_predecesor_opcional(): | ||||
|     nomina = fe.nomina.DIANNominaIndividualDeAjuste.Reemplazar() | ||||
|  | ||||
|     nomina.asignar_predecesor(fe.nomina.DIANNominaIndividualDeAjuste.Reemplazar.Predecesor( | ||||
|         numero = '123456', | ||||
|         cune = 'ABC123456', | ||||
|         fecha_generacion = '2021-11-16' | ||||
|     )) | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|     print(xml.tostring()) | ||||
|  | ||||
|     assert xml.get_element('/nominaajuste:NominaIndividualDeAjuste/Reemplazar/ReemplazandoPredecesor') is not None | ||||
|     assert xml.get_element('/nominaajuste:NominaIndividualDeAjuste/Eliminar/EliminandoPredecesor') is None | ||||
|  | ||||
| def test_adicionar_eliminar_reemplazar_predecesor_opcional(): | ||||
|     nomina = fe.nomina.DIANNominaIndividualDeAjuste.Eliminar() | ||||
|  | ||||
|     nomina.asignar_predecesor(fe.nomina.DIANNominaIndividualDeAjuste.Eliminar.Predecesor( | ||||
|         numero = '123456', | ||||
|         cune = 'ABC123456', | ||||
|         fecha_generacion = '2021-11-16' | ||||
|     )) | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|     print(xml.tostring()) | ||||
|     assert xml.get_element('/nominaajuste:NominaIndividualDeAjuste/Eliminar/EliminandoPredecesor') is not None | ||||
|     assert xml.get_element('/nominaajuste:NominaIndividualDeAjuste/Reemplazar/ReemplazandoPredecesor') is None | ||||
|  | ||||
| def test_adicionar_eliminar_devengado_comprobante_total(): | ||||
|     nomina = fe.nomina.DIANNominaIndividualDeAjuste.Eliminar() | ||||
|  | ||||
|     nomina.adicionar_devengado(fe.nomina.DevengadoBasico( | ||||
|         dias_trabajados = 60, | ||||
|         sueldo_trabajado = fe.nomina.Amount(2_000_000) | ||||
|     )) | ||||
|  | ||||
|     nomina.adicionar_deduccion(fe.nomina.DeduccionSalud( | ||||
|         porcentaje = fe.nomina.Amount(19), | ||||
|         deduccion = fe.nomina.Amount(1_000_000) | ||||
|     )) | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|  | ||||
|     assert xml.get_element_text('/nominaajuste:NominaIndividualDeAjuste/Eliminar/ComprobanteTotal') == '1000000.00' | ||||
|  | ||||
| def test_adicionar_eliminar_asignar_predecesor(): | ||||
|     nomina = fe.nomina.DIANNominaIndividualDeAjuste.Eliminar() | ||||
|  | ||||
|     nomina.asignar_predecesor(fe.nomina.DIANNominaIndividualDeAjuste.Eliminar.Predecesor( | ||||
|         numero = '123456', | ||||
|         cune = 'ABC123456', | ||||
|         fecha_generacion = '2021-11-16' | ||||
|     )) | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|     print(xml.tostring()) | ||||
|     assert xml.get_element_text_or_attribute('/nominaajuste:NominaIndividualDeAjuste/Eliminar/EliminandoPredecesor/@NumeroPred') == '123456' | ||||
|     assert xml.get_element_text_or_attribute('/nominaajuste:NominaIndividualDeAjuste/Eliminar/EliminandoPredecesor/@CUNEPred') == 'ABC123456' | ||||
|     assert xml.get_element_text_or_attribute('/nominaajuste:NominaIndividualDeAjuste/Eliminar/EliminandoPredecesor/@FechaGenPred') == '2021-11-16' | ||||
|  | ||||
| def test_nomina_devengado_horas_extras_diarias(): | ||||
|     nomina = fe.nomina.DIANNominaIndividual() | ||||
|  | ||||
|     nomina.adicionar_devengado(fe.nomina.DevengadoHorasExtrasDiarias( | ||||
|         horas_extras=[ | ||||
|             fe.nomina.DevengadoHoraExtra( | ||||
|                 hora_inicio='2021-11-30T19:09:55', | ||||
|                 hora_fin='2021-11-30T20:09:55', | ||||
|                 cantidad=1, | ||||
|                 porcentaje=fe.nomina.Amount(1), | ||||
|                 pago=fe.nomina.Amount(100) | ||||
|             ), | ||||
|             fe.nomina.DevengadoHoraExtra( | ||||
|                 hora_inicio='2021-11-30T18:09:55', | ||||
|                 hora_fin='2021-11-30T19:09:55', | ||||
|                 cantidad=2, | ||||
|                 porcentaje=fe.nomina.Amount(2), | ||||
|                 pago=fe.nomina.Amount(200) | ||||
|             ) | ||||
|         ] | ||||
|     )) | ||||
|  | ||||
|     xml = nomina.toFachoXML() | ||||
|     extras = xml.get_element('/nomina:NominaIndividual/Devengados/HEDs/HED', multiple=True) | ||||
|     assert extras[0].get('HoraInicio') == '2021-11-30T19:09:55' | ||||
|     assert extras[0].get('HoraFin') == '2021-11-30T20:09:55' | ||||
|     assert extras[0].get('Cantidad') == '1' | ||||
|     assert extras[0].get('Porcentaje') == '1.00' | ||||
|     assert extras[0].get('Pago') == '100.00' | ||||
|     assert extras[1].get('HoraInicio') == '2021-11-30T18:09:55' | ||||
|     assert extras[1].get('HoraFin') == '2021-11-30T19:09:55' | ||||
|     assert extras[1].get('Cantidad') == '2' | ||||
|     assert extras[1].get('Porcentaje') == '2.00' | ||||
|     assert extras[1].get('Pago') == '200.00' | ||||
							
								
								
									
										15
									
								
								tox.ini
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								tox.ini
									
									
									
									
									
								
							| @@ -1,12 +1,17 @@ | ||||
| [tox] | ||||
| envlist = py37, py38, py39, py310 | ||||
| envlist = py27, py34, py35, py36, flake8 | ||||
|  | ||||
| [travis] | ||||
| python = | ||||
|     3.7: py37 | ||||
|     3.8: py38 | ||||
|     3.9: py39 | ||||
|     3.10: py310 | ||||
|     3.6: py36 | ||||
|     3.5: py35 | ||||
|     3.4: py34 | ||||
|     2.7: py27 | ||||
|  | ||||
| [testenv:flake8] | ||||
| basepython = python | ||||
| deps = flake8 | ||||
| commands = flake8 facho | ||||
|  | ||||
| [testenv] | ||||
| setenv = | ||||
|   | ||||
		Reference in New Issue
	
	Block a user