-- API fiscal · Diagnóstico callback hacia ALIANPOS

SELECT id,tipo_documento,RIGHT(clave,8) AS clave_final,estado,respuesta_hacienda,
       webhook_url IS NOT NULL AND webhook_url<>'' AS tiene_callback,
       app_webhook_entregado_en,app_webhook_intentos,app_webhook_error,updated_at
FROM fe_documentos
ORDER BY id DESC
LIMIT 50;

SELECT id,tipo_documento,RIGHT(clave,8) AS clave_final,estado,respuesta_hacienda,
       webhook_url IS NOT NULL AND webhook_url<>'' AS tiene_callback,
       app_webhook_entregado_en,app_webhook_intentos,app_webhook_error,updated_at
FROM fe_mensajes_receptor
ORDER BY id DESC
LIMIT 50;
