diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 65e819be0..91a282ca2 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -7641,6 +7641,26 @@ Public Class ClsPaginas
Return Nothing
End If
+ 'SOLO FORMATO DE STIMULSOFT Y COMPLEMENTO DE SERVICIOS DE CONSTRUCCION
+ If UsuarioActual.Empresa.Funcionalidad(707) = "1" AndAlso Vta.CveComplementoTimbrado = 9 AndAlso Not String.IsNullOrEmpty(Vta.ComplementoSAT) Then
+ Dim settings As New JsonSerializerSettings
+ settings.NullValueHandling = NullValueHandling.Ignore
+ Dim pc As Modelos.MParcialesConstruccion = JsonConvert.DeserializeObject(Of Modelos.MParcialesConstruccion)(Vta.ComplementoSAT, settings)
+
+ If pc IsNot Nothing Then
+ params.Add(New ReportParameter("SC_NumPerLicoAut", pc.NumPerLicoAut))
+ params.Add(New ReportParameter("SC_Calle", pc.Calle))
+ params.Add(New ReportParameter("SC_NoExterior", pc.NoExterior))
+ params.Add(New ReportParameter("SC_NoInterior", pc.NoInterior))
+ params.Add(New ReportParameter("SC_Colonia", pc.Colonia))
+ params.Add(New ReportParameter("SC_Localidad", pc.Localidad))
+ params.Add(New ReportParameter("SC_Referencia", pc.Referencia))
+ params.Add(New ReportParameter("SC_Municipio", pc.Municipio))
+ params.Add(New ReportParameter("SC_Estado", pc.Estado))
+ params.Add(New ReportParameter("SC_CodigoPostal", pc.CodigoPostal))
+ End If
+ End If
+
If NombreArchivo = "FacturaUSA" Then
Dim DtBaseTotales As DataTable = Vta.DtDeduccion.Clone()
@@ -7868,7 +7888,7 @@ Public Class ClsPaginas
If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then
RutaReporte = String.Format("{0}{1}", bdir, RutaReporte)
End If
- Dim urlHost As String = "http://sig.adssistemas.mx:7998/"
+ Dim urlHost As String = "http: //sig.adssistemas.mx:7998/"
'Dim urlHost As String = "http://localhost:2202/"
If EsProduccion Then
urlHost = "http://192.200.113.178:6599/"
diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb
index a22fce440..1d32535fd 100644
--- a/App_Code/ClsProductosServicios.vb
+++ b/App_Code/ClsProductosServicios.vb
@@ -325,6 +325,26 @@ Public Class ClsProductosServicios
Return Retorno
End Function
+
+ Public Function GetPS_APIMarcasStock(CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Inv_APIMarcasStockGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+
+ Retorno = True
+ Catch ex As SqlException
+ OnError("Ocurrió un error al consultar el stock.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
Public Function GetPSSimplificado(CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
diff --git a/Ashx/E189.ashx b/Ashx/E189.ashx
new file mode 100644
index 000000000..201b808b0
--- /dev/null
+++ b/Ashx/E189.ashx
@@ -0,0 +1,216 @@
+<%@ WebHandler Language="VB" Class="E189" %>
+
+Option Strict On
+Option Explicit On
+
+Imports System.Data
+Imports System.IO
+Imports Newtonsoft.Json
+Imports Newtonsoft.Json.Linq
+Imports Extensiones
+
+Public Class E189 : Implements IHttpHandler, System.Web.SessionState.IRequiresSessionState
+
+ Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
+ Get
+ Return False
+ End Get
+ End Property
+
+ Private ReadOnly Property CveEmpresa As Integer = 189
+ Private ReadOnly Property CveUsuario As Integer = 100
+ Private ReadOnly Property NombreCadena As String = "Conexion"
+
+ Public ReadOnly Property EsProduccion As Boolean
+ Get
+ If IsNothing(System.Configuration.ConfigurationManager.AppSettings("EsProduccion")) Then
+ Return False
+ Else
+ Return (System.Configuration.ConfigurationManager.AppSettings("EsProduccion").ToString() = "1")
+ End If
+ End Get
+ End Property
+
+
+#Region "V A L I D A - D A T O S"
+ Private Function ValidaUsuarioSistema(CveUsuario As Integer, CveEmpresa As Integer) As Usuario
+ Dim UsuarioActual As Usuario = Nothing
+ Dim NombreCadena As String = ClsPaginas.GlobalNombreCadenaConexion(CveEmpresa)
+ Dim ObjUsuarios As New ClsSisUsuarioAutenticacion(NombreCadena:=NombreCadena)
+ UsuarioActual = ObjUsuarios.GetUsuarioDetalle(100, CveEmpresa)
+ If UsuarioActual IsNot Nothing Then
+ HttpContext.Current.Session("UsuarioSIG") = UsuarioActual
+ 'CreaObjetoEmpresa(UsuarioActual)
+ End If
+ ObjUsuarios.Dispose()
+
+ Return UsuarioActual
+ End Function
+
+ 'Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
+ ' Dim ObjEmpresa As New ClsSisEmpresas()
+ ' If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
+ ' If ObjEmpresa.GetEmpresasFuncionalidades(UsuarioActual.CveEmpresa) Then
+ ' Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
+
+ ' Dim EmpresasFuncionalidades As New HybridDictionary
+ ' For Each Row As Data.DataRow In dttmp.Rows
+ ' EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
+ ' Next
+ ' ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
+ ' End If
+
+ ' UsuarioActual.Empresa = ObjEmpresa.Empresa
+
+ ' End If
+ ' ObjEmpresa.Dispose()
+ 'End Sub
+#End Region
+
+ Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
+ Dim retorno As String = ""
+ Dim MsgLog As New StringBuilder
+ MsgLog.AppendLine("Inicia Petición.")
+ Try
+ Dim Metodo As String = If(context.Request("Metodo") = Nothing, "", context.Request("Metodo").ToString())
+ MsgLog.AppendLine(Metodo)
+
+ If Metodo = "Stock" Then
+ context.Response.ContentType = "application/json"
+ retorno = ConsultaDatos(context)
+ End If
+
+ context.Response.Write(retorno)
+
+ Catch ex As Exception
+ context.Response.ContentType = "text/html"
+ MsgLog.AppendLine("Error de procesamiento:" & ex.Message)
+
+ Dim respuesta As New AuthMessage
+ respuesta.ErrorMessage = New ResponseMsgError() With {.message = "La solicitud no se pudo procesar."}
+ respuesta.IsSuccess = False
+ respuesta.StatusCode = 200
+ retorno = JsonConvert.SerializeObject(respuesta.ErrorMessage)
+ context.Response.Write(retorno)
+
+ End Try
+ MsgLog.ToString.GuardaLogAD("LogE119")
+ End Sub
+
+
+ Private Function ConsultaDatos(ByVal context As HttpContext) As String
+ Dim Respuesta As New ResponseMsg
+ Dim RespuestaError As New ResponseMsgError
+ Dim TieneError As Boolean = False
+
+ Dim productos As JArray = Nothing
+
+ Using ObjInventario As New ClsProductosServicios
+ If ObjInventario.GetPS_APIMarcasStock(189) AndAlso ObjInventario.DtResultados IsNot Nothing Then
+ productos = JArray.Parse(ObjInventario.DtResultados.DataTableToJSONIPP())
+ Else
+ RespuestaError.message = "no se pudo obtener los datos"
+ TieneError = True
+ End If
+ End Using
+
+ If TieneError Then
+ context.Response.StatusCode = 200
+ Return JsonConvert.SerializeObject(RespuestaError)
+ Else
+ context.Response.StatusCode = 200
+ Try
+ Return New JObject(New JProperty("productos", productos)).ToString()
+ Catch ex As Exception
+ RespuestaError.message = "Ocurrió un error al generar la petición"
+ Return JsonConvert.SerializeObject(RespuestaError)
+ End Try
+
+ End If
+ End Function
+
+
+
+ Private Class ResponseMsg
+ Sub New()
+ status = "success"
+ End Sub
+ Public Property status As String
+ Public Property data As Object
+ Public Property message As String
+ End Class
+
+ Private Class ResponseMsgError
+ Sub New()
+ status = "error"
+ End Sub
+ Public Property status As String
+ Public Property message As String
+ End Class
+
+ Private Class AuthMessage
+ Public Property IsSuccess As Boolean
+ Public Property ErrorMessage As ResponseMsgError
+ Public Property StatusCode As Integer
+ End Class
+
+ 'Private Function ActualizarExistenciasJson(Todos As Boolean) As String
+ ' Dim payload = New JObject()
+
+ ' Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0
+
+ ' Dim DtPS As DataTable = Nothing
+ ' Using ObjPS As New ClsProductosServicios
+ ' If ObjPS.GetExistenciasEmpresa("-1", CveEmpresa) Then
+ ' DtPS = ObjPS.DtResultados.Copy()
+ ' End If
+ ' End Using
+
+ ' If DtPS IsNot Nothing Then
+ ' payload.Add(New JProperty("stock", GenerarPayloadExistencias(DtPS)))
+ ' End If
+
+ ' Return payload.ToString()
+ 'End Function
+
+
+
+ Private Function Parametros(Cadena As String) As Hashtable
+ Dim P1() As String = Cadena.Split("&"c)
+ Dim Tmp As String
+ Dim P2() As String
+
+ Dim URLParametros As New Hashtable
+
+ For Each Tmp In P1
+ P2 = Tmp.Replace("%26%", "&").Split("="c)
+ URLParametros.Add(P2(0).ToString.ToUpper, P2(1))
+ Next
+ Return URLParametros
+ End Function
+
+ Private Shared Function IsValidJson(ByVal strInput As String) As Boolean
+ If String.IsNullOrWhiteSpace(strInput) Then
+ Return False
+ End If
+
+ strInput = strInput.Trim()
+
+ If (strInput.StartsWith("{") AndAlso strInput.EndsWith("}")) OrElse (strInput.StartsWith("[") AndAlso strInput.EndsWith("]")) Then
+
+ Try
+ Dim obj As JToken = JToken.Parse(strInput)
+ Return True
+ Catch jex As JsonReaderException
+ Console.WriteLine(jex.Message)
+ Return False
+ Catch ex As Exception
+ Console.WriteLine(ex.ToString())
+ Return False
+ End Try
+ Else
+ Return False
+ End If
+ End Function
+
+End Class
\ No newline at end of file
diff --git a/Ventas/CatMetasVendedores.aspx b/Ventas/CatMetasVendedores.aspx
index a449a738d..77746d7e5 100644
--- a/Ventas/CatMetasVendedores.aspx
+++ b/Ventas/CatMetasVendedores.aspx
@@ -168,11 +168,7 @@