Fecha de cancelación cfdi
Publicado: Lun May 04, 2015 8:28 pm
Antes que nada agradesco a todos los que participan de este foro que por cierto me ha ayudado muchisimo. Es la primera vez que hago una pregunta y no encontré ningún tema para realizar mi pregunta. El problema que tengo es básicamente que no se como obtener le fecha de cancelación de un cfdi. Hace aproximadamente un año desarrolle una pequeña aplicación que verificaba el estatus de los comprobantes, el código lo obtuve en este foro en el tema que hablaba de un nuevo servicio del sat. La cuestión es que en dicho hilo se podía descargar un pequeño programita hecho en delphi que mostraba el funcionamiento del wsdl (WebService del sat para consulta). Todo funcionó perfectamente pero ahora tengo la necesidad de saber la fecha de cancelación y no se como obtenerla. tengo el siguiente arhcivo que utilizo para el wsdl que estaba incluido con el programita que mencione anteriormente y que descargue también en este foro
<?xml version='1.0' encoding='utf-8'?>
<wsdl:definitions targetNamespace="http://tempuri.org/" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://tempuri.org/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/ ... ty-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ConsultaCFDIService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<wsp:Policy wsu:Id="BasicHttpBinding_IConsultaCFDIService_policy">
<wsp:ExactlyOne>
<wsp:All>
<sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<wsp:Policy>
<sp:TransportToken>
<wsp:Policy>
<sp:HttpsToken RequireClientCertificate="false"/>
</wsp:Policy>
</sp:TransportToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic256/>
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict/>
</wsp:Policy>
</sp:Layout>
</wsp:Policy>
</sp:TransportBinding>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<wsdl:types>
<xs:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://schemas.datacontract.org/2004/07 ... Servicio"/>
<xs:element name="Consulta">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" type="xs:string" name="expresionImpresa" nillable="true"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ConsultaResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" xmlns:q1="http://schemas.datacontract.org/2004/07 ... i.Servicio" type="q1:Acuse" name="ConsultaResult" nillable="true"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<xs:schema elementFormDefault="qualified" attributeFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element type="xs:anyType" name="anyType" nillable="true"/>
<xs:element type="xs:anyURI" name="anyURI" nillable="true"/>
<xs:element type="xs:base64Binary" name="base64Binary" nillable="true"/>
<xs:element type="xs:boolean" name="boolean" nillable="true"/>
<xs:element type="xs:byte" name="byte" nillable="true"/>
<xs:element type="xs:dateTime" name="dateTime" nillable="true"/>
<xs:element type="xs:decimal" name="decimal" nillable="true"/>
<xs:element type="xs:double" name="double" nillable="true"/>
<xs:element type="xs:float" name="float" nillable="true"/>
<xs:element type="xs:int" name="int" nillable="true"/>
<xs:element type="xs:long" name="long" nillable="true"/>
<xs:element type="xs:QName" name="QName" nillable="true"/>
<xs:element type="xs:short" name="short" nillable="true"/>
<xs:element type="xs:string" name="string" nillable="true"/>
<xs:element type="xs:unsignedByte" name="unsignedByte" nillable="true"/>
<xs:element type="xs:unsignedInt" name="unsignedInt" nillable="true"/>
<xs:element type="xs:unsignedLong" name="unsignedLong" nillable="true"/>
<xs:element type="xs:unsignedShort" name="unsignedShort" nillable="true"/>
<xs:element type="tns:char" name="char" nillable="true"/>
<xs:simpleType name="char">
<xs:restriction base="xs:int"/>
</xs:simpleType>
<xs:element type="tns:duration" name="duration" nillable="true"/>
<xs:simpleType name="duration">
<xs:restriction base="xs:duration">
<xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?"/>
<xs:minInclusive value="-P10675199DT2H48M5.4775808S"/>
<xs:maxInclusive value="P10675199DT2H48M5.4775807S"/>
</xs:restriction>
</xs:simpleType>
<xs:element type="tns:guid" name="guid" nillable="true"/>
<xs:simpleType name="guid">
<xs:restriction base="xs:string">
<xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}"/>
</xs:restriction>
</xs:simpleType>
<xs:attribute type="xs:QName" name="FactoryType"/>
<xs:attribute type="xs:ID" name="Id"/>
<xs:attribute type="xs:IDREF" name="Ref"/>
</xs:schema>
<xs:schema elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07 ... i.Servicio" xmlns:tns="http://schemas.datacontract.org/2004/07 ... i.Servicio" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="Acuse">
<xs:sequence>
<xs:element minOccurs="0" type="xs:string" name="CodigoEstatus" nillable="true"/>
<xs:element minOccurs="0" type="xs:string" name="Estado" nillable="true"/>
</xs:sequence>
</xs:complexType>
<xs:element type="tns:Acuse" name="Acuse" nillable="true"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="IConsultaCFDIService_Consulta_InputMessage">
<wsdl:part element="tns:Consulta" name="parameters"/>
</wsdl:message>
<wsdl:message name="IConsultaCFDIService_Consulta_OutputMessage">
<wsdl:part element="tns:ConsultaResponse" name="parameters"/>
</wsdl:message>
<wsdl:portType name="IConsultaCFDIService">
<wsdl:operation name="Consulta">
<wsdl:input wsaw:Action="http://tempuri.org/IConsultaCFDIService/Consulta" message="tns:IConsultaCFDIService_Consulta_InputMessage"/>
<wsdl:output wsaw:Action="http://tempuri.org/IConsultaCFDIService ... taResponse" message="tns:IConsultaCFDIService_Consulta_OutputMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding type="tns:IConsultaCFDIService" name="BasicHttpBinding_IConsultaCFDIService">
<wsp:PolicyReference URI="#BasicHttpBinding_IConsultaCFDIService_policy"/>
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="Consulta">
<soap:operation soapAction="http://tempuri.org/IConsultaCFDIService/Consulta" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ConsultaCFDIService">
<wsdl:port binding="tns:BasicHttpBinding_IConsultaCFDIService" name="BasicHttpBinding_IConsultaCFDIService">
<soap:address location="https://consultaqr.facturaelectronica.s ... vice.svc"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
este archivo lo utilice para generar una unit con las funciones necesarias y poder así consumir el servicio, esto lo hice con el asistence WSDL importer de Delphi 2010.
Mi código es más o menos así
var
ConsultaCFDIv32:IConsultaCFDIService;
vAcuse : Acuse;
ParametrosConsulta:WideString;
FVVigencia:TDate;
HVVigencia:TTime;
begin
RFCEmisor := ZQComprobantes.FieldByName('RFCEmisor').AsString;
RFCEmisor := StringReplace(RFCEmisor, '&', '&',[rfReplaceAll, rfIgnoreCase]);
RFCReceptor := ZQComprobantes.FieldByName('RFCReceptor').AsString;
RFCReceptor := StringReplace(RFCReceptor, '&', '&',[rfReplaceAll, rfIgnoreCase]);
Total := ZQComprobantes.FieldByName('Total').AsString;
UUID := ZQTimbresFiscales.FieldByName('UUID').AsString;
ConsultaCFDIv32:= GetIConsultaCFDIService();
ParametrosConsulta := format( 're=%s&rr=%s&tt=%s&id=%s', [RFCEmisor, RFCReceptor, Total, UUID]);
vAcuse := ConsultaCFDIv32.Consulta(ParametrosConsulta);
//SI EL COMPROBANTE ESTA VIGENTE
If UpperCase(vAcuse.Estado) = 'VIGENTE' Then
{***REALIZO LAS ACCIONES CORRESPONDIENTES***}
//SI EL COMPROBANTE ESTA CANCELADO
Else If UpperCase(vAcuse.Estado) = 'CANCELADO' Then
{***REALIZO LAS ACCIONES CORRESPONDIENTES***}
ELse//SI EL COMPROBANTE NO SE ENCONTRO
{***REALIZO LAS ACCIONES CORRESPONDIENTES***}
end;
Entonces no se de que manera puedo obtener la fecah de cancelación porque la variable vAcuse solo devuelve el código del estatus y el estado
-vAcuse.CodigoEstatus
-vAcuse.Estado
pero no encuentró algo como
-vAcuse.Fecha
Agradecería mucho la ayuda que puedan brindarme ojala me haya explicado bien, de antemano muchas gracias a todos!!!
<?xml version='1.0' encoding='utf-8'?>
<wsdl:definitions targetNamespace="http://tempuri.org/" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://tempuri.org/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/ ... ty-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ConsultaCFDIService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<wsp:Policy wsu:Id="BasicHttpBinding_IConsultaCFDIService_policy">
<wsp:ExactlyOne>
<wsp:All>
<sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<wsp:Policy>
<sp:TransportToken>
<wsp:Policy>
<sp:HttpsToken RequireClientCertificate="false"/>
</wsp:Policy>
</sp:TransportToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic256/>
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict/>
</wsp:Policy>
</sp:Layout>
</wsp:Policy>
</sp:TransportBinding>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<wsdl:types>
<xs:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://schemas.datacontract.org/2004/07 ... Servicio"/>
<xs:element name="Consulta">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" type="xs:string" name="expresionImpresa" nillable="true"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ConsultaResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" xmlns:q1="http://schemas.datacontract.org/2004/07 ... i.Servicio" type="q1:Acuse" name="ConsultaResult" nillable="true"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<xs:schema elementFormDefault="qualified" attributeFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element type="xs:anyType" name="anyType" nillable="true"/>
<xs:element type="xs:anyURI" name="anyURI" nillable="true"/>
<xs:element type="xs:base64Binary" name="base64Binary" nillable="true"/>
<xs:element type="xs:boolean" name="boolean" nillable="true"/>
<xs:element type="xs:byte" name="byte" nillable="true"/>
<xs:element type="xs:dateTime" name="dateTime" nillable="true"/>
<xs:element type="xs:decimal" name="decimal" nillable="true"/>
<xs:element type="xs:double" name="double" nillable="true"/>
<xs:element type="xs:float" name="float" nillable="true"/>
<xs:element type="xs:int" name="int" nillable="true"/>
<xs:element type="xs:long" name="long" nillable="true"/>
<xs:element type="xs:QName" name="QName" nillable="true"/>
<xs:element type="xs:short" name="short" nillable="true"/>
<xs:element type="xs:string" name="string" nillable="true"/>
<xs:element type="xs:unsignedByte" name="unsignedByte" nillable="true"/>
<xs:element type="xs:unsignedInt" name="unsignedInt" nillable="true"/>
<xs:element type="xs:unsignedLong" name="unsignedLong" nillable="true"/>
<xs:element type="xs:unsignedShort" name="unsignedShort" nillable="true"/>
<xs:element type="tns:char" name="char" nillable="true"/>
<xs:simpleType name="char">
<xs:restriction base="xs:int"/>
</xs:simpleType>
<xs:element type="tns:duration" name="duration" nillable="true"/>
<xs:simpleType name="duration">
<xs:restriction base="xs:duration">
<xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?"/>
<xs:minInclusive value="-P10675199DT2H48M5.4775808S"/>
<xs:maxInclusive value="P10675199DT2H48M5.4775807S"/>
</xs:restriction>
</xs:simpleType>
<xs:element type="tns:guid" name="guid" nillable="true"/>
<xs:simpleType name="guid">
<xs:restriction base="xs:string">
<xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}"/>
</xs:restriction>
</xs:simpleType>
<xs:attribute type="xs:QName" name="FactoryType"/>
<xs:attribute type="xs:ID" name="Id"/>
<xs:attribute type="xs:IDREF" name="Ref"/>
</xs:schema>
<xs:schema elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07 ... i.Servicio" xmlns:tns="http://schemas.datacontract.org/2004/07 ... i.Servicio" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="Acuse">
<xs:sequence>
<xs:element minOccurs="0" type="xs:string" name="CodigoEstatus" nillable="true"/>
<xs:element minOccurs="0" type="xs:string" name="Estado" nillable="true"/>
</xs:sequence>
</xs:complexType>
<xs:element type="tns:Acuse" name="Acuse" nillable="true"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="IConsultaCFDIService_Consulta_InputMessage">
<wsdl:part element="tns:Consulta" name="parameters"/>
</wsdl:message>
<wsdl:message name="IConsultaCFDIService_Consulta_OutputMessage">
<wsdl:part element="tns:ConsultaResponse" name="parameters"/>
</wsdl:message>
<wsdl:portType name="IConsultaCFDIService">
<wsdl:operation name="Consulta">
<wsdl:input wsaw:Action="http://tempuri.org/IConsultaCFDIService/Consulta" message="tns:IConsultaCFDIService_Consulta_InputMessage"/>
<wsdl:output wsaw:Action="http://tempuri.org/IConsultaCFDIService ... taResponse" message="tns:IConsultaCFDIService_Consulta_OutputMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding type="tns:IConsultaCFDIService" name="BasicHttpBinding_IConsultaCFDIService">
<wsp:PolicyReference URI="#BasicHttpBinding_IConsultaCFDIService_policy"/>
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="Consulta">
<soap:operation soapAction="http://tempuri.org/IConsultaCFDIService/Consulta" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ConsultaCFDIService">
<wsdl:port binding="tns:BasicHttpBinding_IConsultaCFDIService" name="BasicHttpBinding_IConsultaCFDIService">
<soap:address location="https://consultaqr.facturaelectronica.s ... vice.svc"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
este archivo lo utilice para generar una unit con las funciones necesarias y poder así consumir el servicio, esto lo hice con el asistence WSDL importer de Delphi 2010.
Mi código es más o menos así
var
ConsultaCFDIv32:IConsultaCFDIService;
vAcuse : Acuse;
ParametrosConsulta:WideString;
FVVigencia:TDate;
HVVigencia:TTime;
begin
RFCEmisor := ZQComprobantes.FieldByName('RFCEmisor').AsString;
RFCEmisor := StringReplace(RFCEmisor, '&', '&',[rfReplaceAll, rfIgnoreCase]);
RFCReceptor := ZQComprobantes.FieldByName('RFCReceptor').AsString;
RFCReceptor := StringReplace(RFCReceptor, '&', '&',[rfReplaceAll, rfIgnoreCase]);
Total := ZQComprobantes.FieldByName('Total').AsString;
UUID := ZQTimbresFiscales.FieldByName('UUID').AsString;
ConsultaCFDIv32:= GetIConsultaCFDIService();
ParametrosConsulta := format( 're=%s&rr=%s&tt=%s&id=%s', [RFCEmisor, RFCReceptor, Total, UUID]);
vAcuse := ConsultaCFDIv32.Consulta(ParametrosConsulta);
//SI EL COMPROBANTE ESTA VIGENTE
If UpperCase(vAcuse.Estado) = 'VIGENTE' Then
{***REALIZO LAS ACCIONES CORRESPONDIENTES***}
//SI EL COMPROBANTE ESTA CANCELADO
Else If UpperCase(vAcuse.Estado) = 'CANCELADO' Then
{***REALIZO LAS ACCIONES CORRESPONDIENTES***}
ELse//SI EL COMPROBANTE NO SE ENCONTRO
{***REALIZO LAS ACCIONES CORRESPONDIENTES***}
end;
Entonces no se de que manera puedo obtener la fecah de cancelación porque la variable vAcuse solo devuelve el código del estatus y el estado
-vAcuse.CodigoEstatus
-vAcuse.Estado
pero no encuentró algo como
-vAcuse.Fecha
Agradecería mucho la ayuda que puedan brindarme ojala me haya explicado bien, de antemano muchas gracias a todos!!!