예제 #1
0
        public static string ConsultarAFIPUltNroComprobante(FeaEntidades.InterFacturas.lote_comprobantes lc, Entidades.Sesion Sesion)
        {
            try
            {
                string respuesta = "";
                LoginTicket ticket;
                ar.gov.afip.wsw.Service objWS;
                ar.gov.afip.wsfev1.Service objWSFEV1;
                CrearTicket(Sesion, out ticket, out objWS, out objWSFEV1);

                ar.gov.afip.wsw.FELastCMPtype FELastCMPtype = new ar.gov.afip.wsw.FELastCMPtype();
                FELastCMPtype.TipoCbte = lc.comprobante[0].cabecera.informacion_comprobante.tipo_de_comprobante;
                FELastCMPtype.PtoVta = lc.comprobante[0].cabecera.informacion_comprobante.punto_de_venta;
                ar.gov.afip.wsw.FERecuperaLastCMPResponse FERecuperaLastCMPResponse = new ar.gov.afip.wsw.FERecuperaLastCMPResponse();
                FERecuperaLastCMPResponse = objWS.FERecuperaLastCMPRequest(ticket.ObjAutorizacion, FELastCMPtype);
                System.Globalization.CultureInfo cedeiraCultura = new System.Globalization.CultureInfo(System.Configuration.ConfigurationManager.AppSettings["Cultura"], false);
                cedeiraCultura.DateTimeFormat = new System.Globalization.CultureInfo(System.Configuration.ConfigurationManager.AppSettings["CulturaDateTimeFormat"], false).DateTimeFormat;
                if (FERecuperaLastCMPResponse.RError != null && FERecuperaLastCMPResponse.RError.perrmsg != "OK")
                {
                    respuesta += DB.Funciones.ObjetoSerializado(FERecuperaLastCMPResponse.RError);
                }
                else
                {
                    respuesta += "Nro Ult. Comprobante: " + FERecuperaLastCMPResponse.cbte_nro.ToString();
                }
                return respuesta;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
예제 #2
0
 /// <remarks/>
 public void FERecuperaLastCMPRequestAsync(FEAuthRequest argAuth, FELastCMPtype argTCMP) {
     this.FERecuperaLastCMPRequestAsync(argAuth, argTCMP, null);
 }
예제 #3
0
 /// <remarks/>
 public void FERecuperaLastCMPRequestAsync(FEAuthRequest argAuth, FELastCMPtype argTCMP, object userState) {
     if ((this.FERecuperaLastCMPRequestOperationCompleted == null)) {
         this.FERecuperaLastCMPRequestOperationCompleted = new System.Threading.SendOrPostCallback(this.OnFERecuperaLastCMPRequestOperationCompleted);
     }
     this.InvokeAsync("FERecuperaLastCMPRequest", new object[] {
                 argAuth,
                 argTCMP}, this.FERecuperaLastCMPRequestOperationCompleted, userState);
 }
예제 #4
0
 public FERecuperaLastCMPResponse FERecuperaLastCMPRequest(FEAuthRequest argAuth, FELastCMPtype argTCMP) {
     object[] results = this.Invoke("FERecuperaLastCMPRequest", new object[] {
                 argAuth,
                 argTCMP});
     return ((FERecuperaLastCMPResponse)(results[0]));
 }