Cita:
Empezado por RanNav
Buenos días,
Tengo un par de preguntas.
El alta de subsanación debe ser un registro nuevo, con el campo de subsanación con valor "S", pero, ¿debe referenciarse la factura que se quiere subsanar de alguna forma o poniendo el mismo numSerieFactura ya valdría? y, a parte, ¿el resto de campos que no pertenecen a los que se quieran subsanar deberían de ser los mismos que tiene la factura que se quiere subsanar?
Por otro lado, no encuentro ningún ejemplo de cómo se debe generar el xml para consultar a la AEAT, sí que he visto el esquema, pero no he encontrado dentro de este hilo un ejemplo XML de la consulta.
Si alguien me muestra un ejemplo de como quedaría un XML de un alta de subsanación y de una consulta, sería de gran ayuda para continuar desarrollando todo lo que se nos ha venido encima... 
|
Hola RanNav,
Aunque imagino que a estas alturas ya lo habrás resuelto, aquí te adjunto cómo realizo las consultas (por ahora, sólo en calidad de "Emisor").
Te muestro el código en DataFlex, pero es muy fácil de comprender.
Código:
// Componer el XML de la consulta
// Nota: Hay más posibles filtros opcionales pero incluyo solo lo básico
Get Create (RefClass(cComXml)) to hoXml
Set ComTag of hoXml to "soapenv:Envelope"
Get ComAddAttribute of hoXml "xmlns:soapenv" "....schemas.xmlsoap.org/soap/envelope/" to iSuccess
Get ComAddAttribute of hoXml "xmlns:sfLRC" gsVerifactu_ConsultaLR to iSuccess
Get ComAddAttribute of hoXml "xmlns:sf" ".....agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/tike/cont/ws/SuministroInformacion.xsd" to iSuccess
Send ComUpdateChildContent to hoXml "soapenv:Header" ""
Send ComUpdateChildContent to hoXml "soapenv:Body|sfLRC:ConsultaFactuSistemaFacturacion|sfLRC:Cabecera|sf:IDVersion" gsIDVersionEsquema_Verifactu
Send ComUpdateChildContent to hoXml "soapenv:Body|sfLRC:ConsultaFactuSistemaFacturacion|sfLRC:Cabecera|sf:ObligadoEmision|sf:NombreRazon" (Trim(EMPRESAS.NOMBRE))
Send ComUpdateChildContent to hoXml "soapenv:Body|sfLRC:ConsultaFactuSistemaFacturacion|sfLRC:Cabecera|sf:ObligadoEmision|sf:NIF" EMPRESAS.NIF
If (sNifConsultar <> '') Begin
// ToDo: El campo "NombreRazon" del Destinatario no es obligatorio si se facilita el NIF
// ....prewww1.aeat.es/wlpl/TIKE-CONT/SvTikeEmitidasQuery
Send ComUpdateChildContent to hoXml "soapenv:Body|sfLRC:ConsultaFactuSistemaFacturacion|sfLRC:Cabecera|sf:Destinatario|sf:NIF" sNifConsultar
End
Send ComUpdateChildContent to hoXml "soapenv:Body|sfLRC:ConsultaFactuSistemaFacturacion|sfLRC:FiltroConsulta|sfLRC:PeriodoImputacion|sf:Ejercicio" sEjercicio
Send ComUpdateChildContent to hoXml "soapenv:Body|sfLRC:ConsultaFactuSistemaFacturacion|sfLRC:FiltroConsulta|sfLRC:PeriodoImputacion|sf:Periodo" sPeriodo
If (sNumserieFtra <> '') Send ComUpdateChildContent to hoXml "soapenv:Body|sfLRC:ConsultaFactuSistemaFacturacion|sfLRC:FiltroConsulta|sfLRC:NumSerieFactura" sNumserieFtra
If (sDesdeFecha <> '') Begin
If (sDesdeFecha = sHastaFecha) Send ComUpdateChildContent to hoXml "soapenv:Body|sfLRC:ConsultaFactuSistemaFacturacion|sfLRC:FiltroConsulta|sfLRC:FechaExpedicionFactura|sf:FechaExpedicionFactura" sDesdeFecha
Else Begin
Send ComUpdateChildContent to hoXml "soapenv:Body|sfLRC:ConsultaFactuSistemaFacturacion|sfLRC:FiltroConsulta|sfLRC:FechaExpedicionFactura|sf:RangoFechaExpedicion|sf:Desde" sDesdeFecha
Send ComUpdateChildContent to hoXml "soapenv:Body|sfLRC:ConsultaFactuSistemaFacturacion|sfLRC:FiltroConsulta|sfLRC:FechaExpedicionFactura|sf:RangoFechaExpedicion|sf:Hasta" sHastaFecha
End
End
Get ComGetXml of hoXml to sSoapRequestBody
Send Destroy of hoXml
Un saludo.
Antonio
PD: Disculpa, pero aún no tengo permiso para poner URLs
