facho/cli.py: nuevo comando soap-get-numbering-range
FossilOrigin-Name: d14d8f78bc133599e116319bd1cad9049ebf4971f57aac7a593493b6c48e4d03
This commit is contained in:
parent
ae12f706cb
commit
aa7ee9f523
25
facho/cli.py
25
facho/cli.py
@ -142,6 +142,30 @@ def soap_get_status(private_key, public_key, habilitacion, password, track_id):
|
|||||||
))
|
))
|
||||||
print(resp)
|
print(resp)
|
||||||
|
|
||||||
|
@click.command()
|
||||||
|
@click.option('--private-key', required=True)
|
||||||
|
@click.option('--public-key', required=True)
|
||||||
|
@click.option('--habilitacion/--produccion', default=False)
|
||||||
|
@click.option('--password')
|
||||||
|
@click.option('--nit', required=True)
|
||||||
|
@click.option('--nit-proveedor', required=True)
|
||||||
|
@click.option('--id-software', required=True)
|
||||||
|
def soap_get_numbering_range(private_key,
|
||||||
|
public_key,
|
||||||
|
habilitacion,
|
||||||
|
password,
|
||||||
|
nit, nit_proveedor, id_software):
|
||||||
|
from facho.fe.client import dian
|
||||||
|
|
||||||
|
client = dian.DianSignatureClient(private_key, public_key, password=password)
|
||||||
|
req = dian.GetNumberingRange
|
||||||
|
if habilitacion:
|
||||||
|
req = dian.Habilitacion.GetNumberingRange
|
||||||
|
resp = client.request(req(
|
||||||
|
nit, nit_proveedor, id_software
|
||||||
|
))
|
||||||
|
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')
|
||||||
@ -186,4 +210,5 @@ main.add_command(soap_send_bill_async)
|
|||||||
main.add_command(soap_send_bill_sync)
|
main.add_command(soap_send_bill_sync)
|
||||||
main.add_command(soap_get_status)
|
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(generate_invoice)
|
main.add_command(generate_invoice)
|
||||||
|
@ -64,19 +64,20 @@ class ConsultaResolucionesFacturacionRespuesta:
|
|||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class ConsultaResolucionesFacturacionPeticion(SOAPService):
|
class GetNumberingRange(SOAPService):
|
||||||
NITObligadoFacturarElectronicamente: str
|
accountCode: str
|
||||||
NITProveedorTecnologico: str
|
accountCodeT: str
|
||||||
IdentificadorSoftware: str
|
softwareCode: str
|
||||||
|
|
||||||
def get_wsdl(self):
|
def get_wsdl(self):
|
||||||
return 'https://facturaelectronica.dian.gov.co/servicios/B2BIntegrationEngine-servicios/FacturaElectronica/consultaResolucionesFacturacion.wsdl'
|
return 'https://colombia-dian-webservices-input-sbx.azurewebsites.net/WcfDianCustomerServices.svc?wsdl'
|
||||||
|
|
||||||
def get_service(self):
|
def get_service(self):
|
||||||
return 'ConsultaResolucionesFacturacion'
|
return 'GetNumberingRange'
|
||||||
|
|
||||||
def build_response(self, as_dict):
|
def build_response(self, as_dict):
|
||||||
return ConsultaResolucionesFacturacionRespuesta.fromdict(as_dict)
|
return as_dict
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class SendBillAsync(SOAPService):
|
class SendBillAsync(SOAPService):
|
||||||
@ -154,12 +155,14 @@ class GetStatusZip(SOAPService):
|
|||||||
class Habilitacion:
|
class Habilitacion:
|
||||||
WSDL = 'https://vpfe-hab.dian.gov.co/WcfDianCustomerServices.svc?wsdl'
|
WSDL = 'https://vpfe-hab.dian.gov.co/WcfDianCustomerServices.svc?wsdl'
|
||||||
|
|
||||||
|
class GetNumberingRange(GetNumberingRange):
|
||||||
|
def get_wsdl(self):
|
||||||
|
return Habilitacion.WSDL
|
||||||
|
|
||||||
class SendBillAsync(SendBillAsync):
|
class SendBillAsync(SendBillAsync):
|
||||||
def get_wsdl(self):
|
def get_wsdl(self):
|
||||||
return Habilitacion.WSDL
|
return Habilitacion.WSDL
|
||||||
|
|
||||||
|
|
||||||
class SendBillSync(SendBillSync):
|
class SendBillSync(SendBillSync):
|
||||||
def get_wsdl(self):
|
def get_wsdl(self):
|
||||||
return Habilitacion.WSDL
|
return Habilitacion.WSDL
|
||||||
|
Loading…
Reference in New Issue
Block a user