se adiciona SendNominaSync
FossilOrigin-Name: e09a3b15439d3f052dd7dbf9504035507abad0cc885c69432d0b989bb4b8b55f
This commit is contained in:
		
							
								
								
									
										23
									
								
								facho/cli.py
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								facho/cli.py
									
									
									
									
									
								
							| @@ -312,6 +312,26 @@ def generate_nomina(private_key, passphrase, scriptname, ssl=True, sign=False, u | |||||||
|     else: |     else: | ||||||
|         DIANWrite(xml, output) |         DIANWrite(xml, output) | ||||||
|  |  | ||||||
|  | @click.command() | ||||||
|  | @click.option('--private-key', required=True) | ||||||
|  | @click.option('--public-key', required=True) | ||||||
|  | @click.option('--habilitacion/--produccion', default=False) | ||||||
|  | @click.option('--password') | ||||||
|  | @click.argument('filename', required=True) | ||||||
|  | @click.argument('zipfile', type=click.Path(exists=True)) | ||||||
|  | def soap_send_nomina_sync(private_key, public_key, habilitacion, password, filename, zipfile): | ||||||
|  |     from facho.fe.client import dian | ||||||
|  |  | ||||||
|  |     client = dian.DianSignatureClient(private_key, public_key, password=password) | ||||||
|  |     req = dian.SendNominaSync | ||||||
|  |     if habilitacion: | ||||||
|  |         req = dian.Habilitacion.SendNominaSync | ||||||
|  |     resp = client.request(req( | ||||||
|  |         filename, | ||||||
|  |         open(zipfile, 'rb').read() | ||||||
|  |     )) | ||||||
|  |     print(resp) | ||||||
|  |  | ||||||
| @click.command() | @click.command() | ||||||
| @click.option('--private-key', type=click.Path(exists=True)) | @click.option('--private-key', type=click.Path(exists=True)) | ||||||
| @click.option('--passphrase') | @click.option('--passphrase') | ||||||
| @@ -347,7 +367,8 @@ main.add_command(soap_get_status) | |||||||
| main.add_command(soap_get_status_zip) | main.add_command(soap_get_status_zip) | ||||||
| main.add_command(soap_get_numbering_range) | main.add_command(soap_get_numbering_range) | ||||||
| main.add_command(generate_invoice) | main.add_command(generate_invoice) | ||||||
| main.add_command(generate_nomina) |  | ||||||
| main.add_command(validate_invoice) | main.add_command(validate_invoice) | ||||||
| main.add_command(sign_xml) | main.add_command(sign_xml) | ||||||
| main.add_command(sign_verify_xml) | main.add_command(sign_verify_xml) | ||||||
|  | main.add_command(generate_nomina) | ||||||
|  | main.add_command(soap_send_nomina_sync) | ||||||
|   | |||||||
| @@ -175,6 +175,20 @@ class GetStatusZip(SOAPService): | |||||||
|     def build_response(self, as_dict): |     def build_response(self, as_dict): | ||||||
|         return GetStatusResponse.fromdict(as_dict[0]) |         return GetStatusResponse.fromdict(as_dict[0]) | ||||||
|  |  | ||||||
|  | @dataclass | ||||||
|  | class SendNominaSync(SOAPService): | ||||||
|  |     fileName: str | ||||||
|  |     contentFile: bytes | ||||||
|  |  | ||||||
|  |     def get_wsdl(self): | ||||||
|  |         return 'https://vpfe.dian.gov.co/WcfDianCustomerServices.svc?wsdl' | ||||||
|  |  | ||||||
|  |     def get_service(self): | ||||||
|  |         return 'SendNominaSync' | ||||||
|  |  | ||||||
|  |     def build_response(self, as_dict): | ||||||
|  |         return as_dict | ||||||
|  |  | ||||||
|      |      | ||||||
| class Habilitacion: | class Habilitacion: | ||||||
|     WSDL = 'https://vpfe-hab.dian.gov.co/WcfDianCustomerServices.svc?wsdl' |     WSDL = 'https://vpfe-hab.dian.gov.co/WcfDianCustomerServices.svc?wsdl' | ||||||
| @@ -203,6 +217,9 @@ class Habilitacion: | |||||||
|         def get_wsdl(self): |         def get_wsdl(self): | ||||||
|             return Habilitacion.WSDL |             return Habilitacion.WSDL | ||||||
|  |  | ||||||
|  |     class SendNominaSync(SendNominaSync): | ||||||
|  |         def get_wsdl(self): | ||||||
|  |             return Habilitacion.WSDL | ||||||
|  |  | ||||||
| class DianGateway: | class DianGateway: | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user