diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 7c5a550f8..25fb3c073 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -2679,33 +2679,40 @@ Public Class ClsVentas Public Function GetFacturasCanceladasPendientesWS(RFC As String, CveEmpresa As Integer, Optional showalert As Boolean = True) As Boolean Dim retorno As Boolean = False - Dim objServicio As Cancelacion.CancelacionSoapClient = New Cancelacion.CancelacionSoapClient() + Try + + Dim objServicio As Cancelacion.CancelacionSoapClient = New Cancelacion.CancelacionSoapClient() Dim resp As Cancelacion.StructCancel = objServicio.ObtienePendientes(RFC, "UserTest", "1234567890") - If resp.Estado = 0 Then - Dim XmlPendientes As String = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(resp.Xml)) - Dim theReader As IO.StringReader = New IO.StringReader(XmlPendientes) - Dim theDataSet As DataSet = New DataSet() - theDataSet.ReadXml(theReader) + If resp.Estado = 0 Then + Dim XmlPendientes As String = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(resp.Xml)) + Dim theReader As IO.StringReader = New IO.StringReader(XmlPendientes) + Dim theDataSet As DataSet = New DataSet() + theDataSet.ReadXml(theReader) - If theDataSet.Tables(0).Rows(0)("Uuid").ToString() <> "null" Then - Dim sb = New StringBuilder() + If theDataSet.Tables(0).Rows(0)("Uuid").ToString() <> "null" Then + Dim sb = New StringBuilder() - For Each item As DataRow In theDataSet.Tables(0).Rows - sb.AppendFormat("{0};", item("Uuid").ToString()) - Next + For Each item As DataRow In theDataSet.Tables(0).Rows + sb.AppendFormat("{0};", item("Uuid").ToString()) + Next - If GetFacturasCanceladasPendientes(sb.ToString(), CveEmpresa) Then - retorno = True + If GetFacturasCanceladasPendientes(sb.ToString(), CveEmpresa) Then + retorno = True + End If + + Else + If showalert Then + Alert("No se encontraron cancelaciones pendientes", ModExtensiones.TipoMensaje.MsgError) + End If End If - Else - If showalert Then - Alert("No se encontraron cancelaciones pendientes", ModExtensiones.TipoMensaje.MsgError) - End If + Alert("Error al obtener cancelaciones pendientes: " & resp.Descripcion, ModExtensiones.TipoMensaje.MsgError) End If - Else - Alert("Error al obtener cancelaciones pendientes: " & resp.Descripcion, ModExtensiones.TipoMensaje.MsgError) - End If + + Catch ex As Exception + retorno = False + Me.OnError("Error al obtener cancelaciones pendientes: ", ex, "") + End Try Return retorno End Function diff --git a/Inicio.aspx b/Inicio.aspx index 36480761b..3fb0bbc90 100644 --- a/Inicio.aspx +++ b/Inicio.aspx @@ -688,6 +688,7 @@