diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb
index 016bdbaee..1a939af3d 100644
--- a/App_Code/ClsProductosServicios.vb
+++ b/App_Code/ClsProductosServicios.vb
@@ -2135,6 +2135,74 @@ Public Class ClsProductosServicios
End Try
Return Retorno
- End Function
+ End Function
+
+ Public Function GetProductosModificados(CveEmpresa As Integer, CvePrecioLista As Integer, Optional HorasDiferencia As Integer = -1) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_ProductosModificadosGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
+ .Add("@HorasDiferencia", SqlDbType.Int).Value = HorasDiferencia
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener los productos modificados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+ Return Retorno
+ End Function
+ Public Function GetPreciosModificados(CveEmpresa As Integer, CvePrecioLista As Integer, Optional HorasDiferencia As Integer = -1) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_ProductosPreciosModificadosGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
+ .Add("@HorasDiferencia", SqlDbType.Int).Value = HorasDiferencia
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener los precios modificados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function GetExistenciasEmpresa(Codigo As String, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_ProductosExistenciasEmpresaGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@Codigo", SqlDbType.VarChar).Value = Codigo
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener las existencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function GetVendedoresModificados(CveEmpresa As Integer, Optional HorasDiferencia As Integer = -1) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_VendedoresModificadosGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@HorasDiferencia", SqlDbType.Int).Value = HorasDiferencia
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener los vendedores.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
End Class
diff --git a/Ashx/E141.ashx b/Ashx/E141.ashx
index 1afdca0b9..dd8ea7fcf 100644
--- a/Ashx/E141.ashx
+++ b/Ashx/E141.ashx
@@ -2,8 +2,9 @@
Imports System
Imports System.Web
-Imports System.Data
+Imports System.Data
Imports System.Net.Http
+Imports System.Net
Imports Newtonsoft.Json
Imports Newtonsoft.Json.Linq
Imports Extensiones
@@ -28,8 +29,46 @@ Public Class E141 : Implements IHttpHandler
End If
End Get
End Property
+ Public ReadOnly Property UsuarioWSE141 As String
+ Get
+ If IsNothing(System.Configuration.ConfigurationManager.AppSettings("UsuarioWSE141")) Then
+ Return ""
+ Else
+ Return System.Configuration.ConfigurationManager.AppSettings("UsuarioWSE141").ToString()
+ End If
+ End Get
+ End Property
+ Public ReadOnly Property PasswordWSE141 As String
+ Get
+ If IsNothing(System.Configuration.ConfigurationManager.AppSettings("PasswordWSE141")) Then
+ Return ""
+ Else
+ Return System.Configuration.ConfigurationManager.AppSettings("PasswordWSE141").ToString()
+ End If
+ End Get
+ End Property
+ Public ReadOnly Property TokenAutorizacion As String
+ Get
+ If EsProduccion Then
+ Return "$2y$10$AGCCDbEoGEpd0ys89fuBXedtWlunwUeLRlo4MdeLyxDvJF4GwpL7a"
+ Else
+ Return "$2y$10$8Mk3YeIkJESilIwD.U5dG.SsA4JloycJKbaGls8TNEw/AKBE1qane"
+ End If
+ End Get
+ End Property
+
+ Public ReadOnly Property URLBase As String
+ Get
+ If EsProduccion Then
+ Return "https://services.fidelityapps.mx/"
+ Else
+ Return "https://econollantas-pruebas.fidelityapps.mx/"
+ End If
+ End Get
+ End Property
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
+ context.Response.ContentType = "application/json"
Dim retorno As String = "no se encontro la variable"
Try
Dim Params = If(context.Request("P") = Nothing, "", context.Request("P").ToString())
@@ -43,57 +82,379 @@ Public Class E141 : Implements IHttpHandler
End If
End If
+
+ Dim Metodo = If(context.Request("Metodo") = Nothing, "", context.Request("Metodo").ToString())
+
+ Dim FiltrarTodos = If(context.Request("FiltrarTodos") = Nothing, "", context.Request("FiltrarTodos").ToString())
+
+ If Metodo = "CrearActualizarProductos" Then
+ retorno = CrearActualizarProductos(If(FiltrarTodos = "1", True, False))
+ End If
+
+ If Metodo = "ActualizarPrecios" Then
+ retorno = ActualizarPrecios(If(FiltrarTodos = "1", True, False))
+ End If
+
+ If Metodo = "ActualizarExistencias" Then
+ retorno = ActualizarExistencias(If(FiltrarTodos = "1", True, False))
+ End If
+
+ If Metodo = "ActualizarVendedores" Then
+ retorno = ActualizarVendedores(If(FiltrarTodos = "1", True, False))
+ End If
+
+ If Metodo = "GetExistencia" Then
+ Dim Codigo = If(context.Request("Sku") = Nothing, "", context.Request("Sku").ToString())
+ retorno = GetExistencia(context, Codigo)
+ End If
+
Catch ex As Exception
retorno = ex.ToString()
ex.GuardaLog(ex.ToString())
- context.Response.Write(retorno)
+
End Try
+ context.Response.Write(retorno)
End Sub
+ Private Function GetExistencia(ByVal context As HttpContext, Codigo As String) As String
+ Dim respuesta = New With {.isSuccess = False, .message = "", .products = New JArray}
+ If String.IsNullOrEmpty(Codigo) OrElse Codigo = "-1" Then
+ respuesta.message = "el parametro 'Sku' es invalido"
+ respuesta.isSuccess = False
- 'Private Function DescargarFactura(CveVenta As Integer) As Byte()
- ' Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", ClsPaginas.UrlSitio, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=0", CveVenta))))
- ' Dim File As Byte() = Nothing
- ' Try
- ' Using httpClient = New HttpClient()
- ' httpClient.Timeout = New TimeSpan(0, 15, 0)
- ' Using request = New HttpRequestMessage(HttpMethod.Get, Url)
- ' request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO=100", CveEmpresa, DateTime.UtcNow.Ticks)))
- ' Dim response = httpClient.SendAsync(request).Result
- ' If response.StatusCode = Net.HttpStatusCode.OK Then
- ' File = response.Content.ReadAsByteArrayAsync().Result
- ' End If
- ' End Using
- ' End Using
- ' Catch ex As Exception
- ' File = Nothing
- ' OnError("Ocurrió un error al descargar la factura", ex)
- ' End Try
-
- ' Return File
+ Return JsonConvert.SerializeObject(respuesta)
+ End If
+
+ Dim unauthorized As Boolean = True
+
+ Dim authHeader = context.Request.Headers("Authorization")
+ If authHeader IsNot Nothing Then
+ Dim basicAuth As String = authHeader.Replace("Basic ", "")
+
+ Dim usernamePasswordArray = Encoding.UTF8.GetString(Convert.FromBase64String(basicAuth)).Split(":"c)
+
+ Dim userName = usernamePasswordArray(0)
+ Dim password = usernamePasswordArray(1)
+ unauthorized = Not (userName = Me.UsuarioWSE141 AndAlso password = Me.PasswordWSE141)
+
+ Else
+ respuesta.message = "el usuario y/o contraseña son requeridos"
+ respuesta.isSuccess = False
+ 'context.Response.StatusCode = 401
+
+ Return JsonConvert.SerializeObject(respuesta)
+ End If
+
+ If unauthorized Then
+ respuesta.message = "el usuario y/o contraseña no son validos"
+ respuesta.isSuccess = False
+ 'context.Response.StatusCode = 401
+
+ Return JsonConvert.SerializeObject(respuesta)
+ End If
+
+ Using ObjPS As New ClsProductosServicios()
+ If ObjPS.GetExistenciasEmpresa(Codigo, CveEmpresa) Then
+ Dim ArrayPS As New JArray
+ For Each RowPS As DataRow In ObjPS.DtResultados.Rows
+ Dim producto As New JObject(
+ New JProperty("sku", RowPS("Codigo")),
+ New JProperty("stock", RowPS("Existencia"))
+ )
+ ArrayPS.Add(producto)
+ Next
+
+ respuesta.products = ArrayPS
+ respuesta.isSuccess = True
+ respuesta.message = "La existencia se obtuvo correctamente"
+ Else
+ respuesta.isSuccess = False
+ respuesta.message = "Ocurrió un error al obtener la existencia"
+ End If
+
+ End Using
+
+ Return JsonConvert.SerializeObject(respuesta)
+ End Function
+
+ Private Function EnviarInformacion(url As String, payload As String) As String
+ Dim Retorno As String = "{}"
+ Try
+ Using httpClient = New HttpClient()
+ Using request = New HttpRequestMessage(HttpMethod.Post, New Uri(url))
+ request.Headers.Add("token", TokenAutorizacion)
+
+ Using content = New StringContent(payload, Encoding.UTF8, "application/json")
+ request.Content = content
+
+ Dim response = httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).Result
+
+ If response.StatusCode = Net.HttpStatusCode.OK Then
+ Retorno = response.Content.ReadAsStringAsync().Result
+ End If
+ End Using
+
+ End Using
+
+ End Using
+ Catch ex As Exception
+ Retorno = New JObject(New JProperty("Error", ex.ToString())).ToString()
+ OnError("Ocurrió un error al enviar la informacion", ex)
+ End Try
+ Return Retorno
+ End Function
+
+ 'Private Function EnviarInformacion2(url As String, payload As String) As String
+ ' Dim Retorno As String = "{}"
+ ' Try
+ ' Dim Request As WebRequest = WebRequest.Create(url)
+ ' Request.Method = "post"
+ ' Request.ContentType = "application/json"
+ ' Request.Headers.Add("token", TokenAutorizacion)
+
+ ' Dim byteArray As Byte() = Encoding.UTF8.GetBytes(payload)
+ ' Request.ContentLength = byteArray.Length
+
+ ' Using dataStream As Stream = Request.GetRequestStream()
+ ' dataStream.Write(byteArray, 0, byteArray.Length)
+ ' Using tResponse As WebResponse = Request.GetResponse()
+ ' Using dataStreamResponse As Stream = tResponse.GetResponseStream()
+ ' Using tReader As New StreamReader(dataStreamResponse)
+ ' Retorno = tReader.ReadToEnd()
+ ' End Using
+ ' End Using
+ ' End Using
+ ' End Using
+ ' Catch ex As Exception
+ ' Retorno = New JObject(New JProperty("Error", ex.ToString())).ToString()
+ ' OnError("Ocurrió un error al enviar la informacion", ex)
+ ' End Try
+ ' Return Retorno
'End Function
+#Region "C R E A C I Ó N / A C T U A L I Z A C I Ó N - P R O D U C T O S"
+ Private Function CrearActualizarProductos(Todos As Boolean) As String
+ Return EnviarInformacion($"{Me.URLBase}api/services/products/import", GetProductosModificados(Todos))
+ End Function
- Private Function DescargarFactura(FilePDF As String) As Byte()
- Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?TipoDocto=Ing&File={1}&TipoArchivo=PDF", "http://localhost/", FilePDF))
- Dim File As Byte() = Nothing
- Try
- Using httpClient = New HttpClient()
- httpClient.Timeout = New TimeSpan(0, 1, 0)
- Using request = New HttpRequestMessage(HttpMethod.Get, Url)
- request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO=100", CveEmpresa, DateTime.UtcNow.Ticks)))
- Dim response = httpClient.SendAsync(request).Result
- If response.StatusCode = Net.HttpStatusCode.OK Then
- File = response.Content.ReadAsByteArrayAsync().Result
- End If
- End Using
- End Using
- Catch ex As Exception
- File = Nothing
- OnError("Ocurrió un error al descargar la factura", ex)
- End Try
-
- Return File
+ Private Function GetProductosModificados(Todos As Boolean) As String
+ Dim Retorno As String = "{}"
+
+ Dim DtPS As DataTable = Nothing
+ Using ObjPS As New ClsProductosServicios
+ 'OBTERNER PRECIOS DE PUBLICO GENERAL
+ If ObjPS.GetProductosModificados(CveEmpresa, 44, If(Todos, -1, 1)) Then
+ DtPS = ObjPS.DtResultados.Copy()
+ End If
+ End Using
+
+ If DtPS IsNot Nothing Then
+
+ Dim ArrayPS As New JArray
+ For Each RowPS As DataRow In DtPS.Rows
+
+ Dim PSData As String() = RowPS("PS").ToString().Split(" ".ToCharArray())
+
+ Dim Measurement As String = "", Size As String = "", alt_code As String = ""
+
+ If PSData.Length > 0 Then
+ Measurement = PSData(0)
+ End If
+
+ If PSData.Length > 1 Then
+ Size = PSData(1)
+ End If
+
+ alt_code = String.Concat(Measurement, Size)
+
+ Dim producto As New JObject(
+ New JProperty("clasificacion", RowPS("Clasificacion")),
+ New JProperty("category", "Prod"),
+ New JProperty("pza", RowPS("Unidad")),
+ New JProperty("sku", RowPS("Codigo")),
+ New JProperty("name", RowPS("PS")),
+ New JProperty("measurement", Measurement),
+ New JProperty("size", Size),
+ New JProperty("brand", RowPS("Marca")),
+ New JProperty("price", RowPS("Precio")),
+ New JProperty("active", RowPS("Estado")),
+ New JProperty("user", RowPS("UsuarioModifico")),
+ New JProperty("alt_code", alt_code),
+ New JProperty("short_description", ""),
+ New JProperty("description", ""),
+ New JProperty("currency", 1),
+ New JProperty("promo_price", RowPS("PrecioPromocion"))
+ )
+
+ ArrayPS.Add(producto)
+ Next
+ Retorno = New JObject(New JProperty("products", ArrayPS)).ToString()
+ End If
+
+ Return Retorno
+ End Function
+#End Region
+
+#Region "A C T U A L I Z A R - P R E C I O S"
+
+ Private Function ActualizarPrecios(Todos As Boolean) As String
+ Return EnviarInformacion($"{Me.URLBase}api/services/products/price-import", GetPreciosModificados(Todos))
+ End Function
+
+ Private Function GetPreciosModificados(Todos As Boolean) As String
+ Dim Retorno As String = "{}"
+
+ Dim DtPS As DataTable = Nothing
+ Using ObjPS As New ClsProductosServicios
+ 'OBTERNER PRECIOS DE PUBLICO GENERAL
+ If ObjPS.GetPreciosModificados(CveEmpresa, 44, If(Todos, -1, 1)) Then
+ DtPS = ObjPS.DtResultados.Copy()
+ End If
+ End Using
+
+ If DtPS IsNot Nothing Then
+
+ Dim ArrayPS As New JArray
+ For Each RowPS As DataRow In DtPS.Rows
+
+ Dim producto As New JObject(
+ New JProperty("sku", RowPS("Codigo")),
+ New JProperty("price", RowPS("Precio")),
+ New JProperty("promo_price", RowPS("PrecioPromocion"))
+ )
+
+ ArrayPS.Add(producto)
+ Next
+ Retorno = New JObject(New JProperty("products", ArrayPS)).ToString()
+ End If
+
+ Return Retorno
+ End Function
+#End Region
+
+#Region "A C T U A L I Z A R - E X I S T E N C I A S"
+
+ Private Function ActualizarExistencias() As String
+ Return EnviarInformacion($"{Me.URLBase}api/services/products/stock", GetPSExistencias())
+ End Function
+
+ Private Function GetPSExistencias() As String
+ Dim Retorno As String = "{}"
+
+ Dim DtPS As DataTable = Nothing
+ Using ObjPS As New ClsProductosServicios
+ 'OBTERNER PRECIOS DE PUBLICO GENERAL
+ If ObjPS.GetExistenciasEmpresa("-1", CveEmpresa) Then
+ DtPS = ObjPS.DtResultados.Copy()
+ End If
+ End Using
+
+ If DtPS IsNot Nothing Then
+
+ Dim ArrayPS As New JArray
+ For Each RowPS As DataRow In DtPS.Rows
+
+ Dim producto As New JObject(
+ New JProperty("sku", RowPS("Codigo")),
+ New JProperty("branch_office_code", "01"),
+ New JProperty("stock", RowPS("Existencia"))
+ )
+
+ ArrayPS.Add(producto)
+ Next
+ Retorno = New JObject(New JProperty("stock", ArrayPS)).ToString()
+ End If
+
+ Return Retorno
+ End Function
+#End Region
+
+
+#Region "A C T U A L I Z A R - E X I S T E N C I A S"
+
+ Private Function ActualizarVendedores(Todos As Boolean) As String
+ Return EnviarInformacion($"{Me.URLBase}api/v1/sellers/import", GetVendedores(Todos))
+ End Function
+
+ Private Function GetVendedores(Todos As Boolean) As String
+ Dim Retorno As String = "{}"
+
+ Dim DtVendedores As DataTable = Nothing
+ Using ObjPS As New ClsProductosServicios
+ 'OBTERNER PRECIOS DE PUBLICO GENERAL
+ If ObjPS.GetVendedoresModificados(CveEmpresa, If(Todos, -1, 1)) Then
+ DtVendedores = ObjPS.DtResultados.Copy()
+ End If
+ End Using
+
+ If DtVendedores IsNot Nothing Then
+
+ Dim ArrayVendedores As New JArray
+ For Each RowVendedor As DataRow In DtVendedores.Rows
+
+ Dim VendedorData As String() = RowVendedor("Vendedor").ToString().Split(" ".ToCharArray())
+
+ Dim Nombre As String = "", Apellido As String = ""
+
+ Select Case VendedorData.Length
+ Case 1
+ Nombre = VendedorData(0)
+ Case 2
+ Nombre = VendedorData(1)
+ Apellido = VendedorData(0)
+ Case 3
+ Nombre = VendedorData(2)
+ Apellido = String.Concat(VendedorData(0), " ", VendedorData(1))
+ Case 4
+ Nombre = String.Concat(VendedorData(2), " ", VendedorData(3))
+ Apellido = String.Concat(VendedorData(0), " ", VendedorData(1))
+ End Select
+
+ Dim vendedor As New JObject(
+ New JProperty("email", RowVendedor("Correo")),
+ New JProperty("password", RowVendedor("Correo")),
+ New JProperty("name", Nombre),
+ New JProperty("last_name", Apellido),
+ New JProperty("type_seller", "Administrador"),
+ New JProperty("state", RowVendedor("Estado")),
+ New JProperty("city", RowVendedor("Municipio")),
+ New JProperty("age", 0),
+ New JProperty("gender", 0),
+ New JProperty("address", ""),
+ New JProperty("code", "")
+ )
+
+ ArrayVendedores.Add(vendedor)
+ Next
+ Retorno = New JObject(New JProperty("sellers", ArrayVendedores)).ToString()
+ End If
+
+ Return Retorno
+ End Function
+#End Region
+
+#Region "D E S C A R G A - P D F"
+
+ Private Function DescargarFactura(FilePDF As String) As Byte()
+ Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?TipoDocto=Ing&File={1}&TipoArchivo=PDF", "http://localhost/", FilePDF))
+ Dim File As Byte() = Nothing
+ Try
+ Using httpClient = New HttpClient()
+ httpClient.Timeout = New TimeSpan(0, 1, 0)
+ Using request = New HttpRequestMessage(HttpMethod.Get, Url)
+ request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO=100", CveEmpresa, DateTime.UtcNow.Ticks)))
+ Dim response = httpClient.SendAsync(request).Result
+ If response.StatusCode = Net.HttpStatusCode.OK Then
+ File = response.Content.ReadAsByteArrayAsync().Result
+ End If
+ End Using
+ End Using
+ Catch ex As Exception
+ File = Nothing
+ OnError("Ocurrió un error al descargar la factura", ex)
+ End Try
+
+ Return File
End Function
Public Sub ImprimirbytesPDF(ByVal context As HttpContext, bytes As Byte(), NombreArchivo As String)
@@ -118,18 +479,20 @@ Public Class E141 : Implements IHttpHandler
End Try
End Sub
- 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 Region
+
+ 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
End Class
\ No newline at end of file
diff --git a/Inventarios/RecepcionUsados.aspx b/Inventarios/RecepcionUsados.aspx
index 0a80a9302..f5b6dcc47 100644
--- a/Inventarios/RecepcionUsados.aspx
+++ b/Inventarios/RecepcionUsados.aspx
@@ -752,7 +752,7 @@
diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb
index 7c83727db..22e3f17ec 100644
--- a/Inventarios/RecepcionUsados.aspx.vb
+++ b/Inventarios/RecepcionUsados.aspx.vb
@@ -2489,7 +2489,6 @@ Partial Class Inventarios_RecepcionUsados
For Each Row As GridViewRow In GvM.Rows
If Row.RowType = DataControlRowType.DataRow Then
- Dim CvePS As Integer = Row.DataKey("CvePS").ToEntero()
Dim Cantidad As Decimal = Row.DataKey("Cantidad").ToDecimal()
Dim PU As Decimal = Row.DataKey("PU").ToDecimal()
Dim CveTamaño As Integer = Row.DataKey("CveTamaño").ToEntero()
@@ -2502,29 +2501,45 @@ Partial Class Inventarios_RecepcionUsados
Dim PS As String = ""
Dim PorcentajeIVA As Decimal = 0D
Dim IVA As Decimal = 0D
- If CvePS > 0 Then
- If SubTotal > 0 Then
- Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).Rows(0)
- If Dr IsNot Nothing Then
- CveUnidadMedida = Dr("CveUnidadMedida").ToString.ToEntero
- CveClasificacion = Dr("CveClasificacion").ToString.ToEntero
- PS = Dr("PSCodigo").ToString
- UnidadMedida = Dr("UnidadMedida").ToString
- Clasificacion = Dr("Clasificacion").ToString
+
+ Dim CvePS As Integer = 0
+
+ Select Case RblUsadosAjuste.SelectedValue
+ Case "0" ' USADOS
+ CvePS = Row.DataKey("CvePS").ToEntero()
+ Case "1" ' AJUSTE/GARANTIA
+ Dim drDatos As DataRow = GlobalDTAcumTamaños().FiltroPrimero(String.Format("CveTamaño = {0} AND CveEmpresa = {1}", CveTamaño, UsuarioActual.CveEmpresa))
+
+ If drDatos IsNot Nothing Then
+ CvePS = drDatos.Item("CvePSCargo").ToString.ToEntero
End If
- PorcentajeIVA = 0.16D
- IVA = SubTotal * PorcentajeIVA
+ End Select
+
+ If CvePS > 0 Then
+ Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0)
+ If Dr IsNot Nothing Then
+ CveUnidadMedida = Dr("CveUnidadMedida").ToString.ToEntero
+ CveClasificacion = Dr("CveClasificacion").ToString.ToEntero
+ PS = Dr("PSCodigo").ToString
+ UnidadMedida = Dr("UnidadMedida").ToString
+ Clasificacion = Dr("Clasificacion").ToString
End If
+ PorcentajeIVA = 0.16D
+ IVA = SubTotal * PorcentajeIVA
+
+ AddPSRNC(ObjRemisionNC.DtDetalle, Cantidad, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePS, PS, "", PU, 0, -1, "",
+ ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA, CveTamaño:=CveTamaño)
+ Else
+ Alert("No se pudo cargar el producto", TipoMensaje.MsgError)
End If
- AddPSRNC(ObjRemisionNC.DtDetalle, Cantidad, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePS, PS, "", PU, 0, -1, "",
- ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA, CveTamaño:=CveTamaño)
End If
Next
+ 'SI ES AJUSTE/GARANTIA
If RblUsadosAjuste.SelectedValue = "1" Then
'agrego un registro extra del importe de ajuste
- Dim PU As Decimal = TxtImporteAjuste.Text.ToDecimal
+ Dim PU As Decimal = TmpDTAjustes.SUMD("Importe")
'CONSULTA EL CONCEPTO DE NC
Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray())
Dim NCAjuste As Integer = -1
@@ -2540,7 +2555,18 @@ Partial Class Inventarios_RecepcionUsados
CveClasificacion = Dr("CveClasificacion").ToString.ToEntero
CvePS = Dr("CvePS").ToString.ToEntero
Dim PorcentajeIVA As Decimal = 0.16D
- Dim Obs As String = $"Descuento por garantía. BCI: {DdlBCIAjuste.SelectedValue}"
+
+ Dim SbBCI As New StringBuilder()
+ SbBCI.Append("BCI: ")
+ 'AGREGA LOS PRODUCTOS COMO OBSERVACION
+ For Each GvRow As GridViewRow In GvM.Rows
+ If GvRow.RowType = DataControlRowType.DataRow Then
+ SbBCI.AppendFormat("{0},", GvRow.DataKey("CodigoPS"))
+ End If
+ Next
+ SbBCI.Remove(SbBCI.Length - 1, 1)
+
+ Dim Obs As String = SbBCI.ToString()
AddPSRNC(ObjRemisionNC.DtDetalle, 1, CveUnidadMedida, "", CveClasificacion, "", CvePS, "", Obs, PU, 0, -1, "",
ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA)
@@ -2570,7 +2596,6 @@ Partial Class Inventarios_RecepcionUsados
ObjRemisionNC.Total = Total
ObjRemisionNC.TotalOtrosConceptos = 0
-
ObjRemisionNC.DtMovimientosUsados = DtMovimientos
ObjRemisionNC.CveAlmacen = DdlAlmacen.SelectedValue.ToEntero()
ObjRemisionNC.ObservacionesMovimiento = TxtObservaciones.Text
@@ -2646,6 +2671,10 @@ Partial Class Inventarios_RecepcionUsados
End Sub
Private Sub CargaPSAjuste()
DdlPSAjuste.setEsWebService(True)
+ DdlPSAjuste.Attributes.Add("data-cvesubproyecto", "-1")
+ DdlPSAjuste.ddlWS.Attributes.Add("data-cveclasificacion", "-1")
+ DdlPSAjuste.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
+ DdlPSAjuste.ddlWS.Attributes.Add("data-Estatus", "1")
End Sub
Protected Sub DdlPSAjuste_selectedindexchange(sender As Object, e As EventArgs)
@@ -2996,28 +3025,38 @@ Partial Class Inventarios_RecepcionUsados
End If
Dim ObjPS As New ClsProductosServicios
- Dim CveTamaño As Integer = -1
- If ObjPS.GetPS(CvePS, -1, UsuarioActual.CveEmpresa) Then
- CveTamaño = ObjPS.DtResultados.FiltroPrimeroValor("CveTamaño").ToEntero
- End If
- Dim drDatos As DataRow = GlobalDTAcumTamaños().FiltroPrimero(String.Format("CveTamaño = {0} AND CveEmpresa = {1}", CveTamaño, UsuarioActual.CveEmpresa))
-
- If drDatos IsNot Nothing Then
- Dim Importe As Decimal = drDatos("Cargo").ToString.ToDecimal
- Dim drTamañoPS As DataRow = Nothing
-
- DtMovimientos.Rows.Clear()
-
- If ObjPS.GetPS(drDatos.Item("CvePSCargo").ToString.ToEntero, -1, UsuarioActual.CveEmpresa) Then
- drTamañoPS = ObjPS.DtResultados.FiltroPrimero("")
- 'CveTamaño = -1 'limpio esta variable para que no se registre dos veces en la clase Modelos
- AddNew(drTamañoPS.Item("CvePS").ToString.ToEntero, drTamañoPS.Item("PSCodigo").ToString, drTamañoPS.Item("CveUM").ToString.ToEntero, drTamañoPS.Item("UnidadMedida").ToString, 1.0, Importe,
- "", "-1", "-1", "-1", "", "", -1, "", "", CveTamaño)
-
+ Try
+ Dim CveTamaño As Integer = -1
+ If ObjPS.GetPS(CvePS, -1, UsuarioActual.CveEmpresa) Then
+ CveTamaño = ObjPS.DtResultados.FiltroPrimeroValor("CveTamaño").ToEntero
End If
- Else
- Alert("No se pudo cargar el producto", TipoMensaje.MsgError)
- End If
+ Dim drDatos As DataRow = GlobalDTAcumTamaños().FiltroPrimero(String.Format("CveTamaño = {0} AND CveEmpresa = {1}", CveTamaño, UsuarioActual.CveEmpresa))
+
+ If drDatos IsNot Nothing Then
+ Dim Importe As Decimal = drDatos("Cargo").ToString.ToDecimal
+ Dim drTamañoPS As DataRow = Nothing
+
+ DtMovimientos.Rows.Clear()
+
+ Select Case RblUsadosAjuste.SelectedValue
+ Case "0" ' USADOS
+ CvePS = drDatos.Item("CvePSCargo").ToString.ToEntero
+ Case "1" ' AJUSTE/GARANTIA
+ CvePS = DdlPSAjuste.SelectedValue.ToEntero
+ End Select
+
+ If ObjPS.GetPS(CvePS, -1, UsuarioActual.CveEmpresa) Then
+ drTamañoPS = ObjPS.DtResultados.FiltroPrimero("")
+ 'CveTamaño = -1 'limpio esta variable para que no se registre dos veces en la clase Modelos
+ AddNew(drTamañoPS.Item("CvePS").ToString.ToEntero, drTamañoPS.Item("PSCodigo").ToString, drTamañoPS.Item("CveUM").ToString.ToEntero, drTamañoPS.Item("UnidadMedida").ToString, 1.0, Importe,
+ "", "-1", "-1", "-1", "", "", -1, "", "", CveTamaño)
+ End If
+ Else
+ Alert("No se pudo cargar el producto", TipoMensaje.MsgError)
+ End If
+ Catch ex As Exception
+ OnError("Ocurrió un error al agregar el producto", ex)
+ End Try
ObjPS.Dispose()
GuardaAjuste()
diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx
index bab59dcf6..b168f7b82 100644
--- a/Ventas/Clientes.aspx
+++ b/Ventas/Clientes.aspx
@@ -4155,61 +4155,7 @@
-
-
-
-
-
-
-
- Usados resumen
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Puntos
-
-
-
-
-
-
Importe Cargo
-
$
-
-
-
-
-
-
-
-
Importe Bonificación
-
$
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -4219,23 +4165,28 @@
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb
index a996cf41b..55ce1f097 100644
--- a/Ventas/Clientes.aspx.vb
+++ b/Ventas/Clientes.aspx.vb
@@ -4783,7 +4783,7 @@ Partial Class Clientes
Exit Select
Case 6
TxtCuentaValor.Visible = True
- TxtCuentaValor.TextMode = TextBoxMode.Number
+ TxtCuentaValor.TextMode = TextBoxMode.SingleLine
If Requerido = 1 Then
RFVCuentaValor1.Enabled = True
@@ -4893,7 +4893,7 @@ Partial Class Clientes
Exit Select
Case 6
TxtCuentaValor.Visible = True
- TxtCuentaValor.TextMode = TextBoxMode.Number
+ TxtCuentaValor.TextMode = TextBoxMode.SingleLine
If Requerido = 1 Then
RFVCuentaValor2.Enabled = True
@@ -9135,45 +9135,27 @@ Partial Class Clientes
Dim ObjAcum As New ClsAcumuladores
Dim ImporteCargo As Decimal = 0D
- Dim ImporteBonificacion As Decimal = 0D
If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, TxtFechaIUsados.Text.ToDate, TxtFechaFUsados.Text.ToDate, CveConcepto:=DdlConceptoUsado.SelectedValue.ToEntero()) Then
-
GvAcum.DataSource = ObjAcum.DtResultados
-
- LblUsadosPuntos.Text = (ObjAcum.DtResultados.SUM("Puntos", " CveConcepto = 2 ") - ObjAcum.DtResultados.SUM("Puntos", " CveConcepto IN (1,3) ")).ToDecimal.FormatoNumero(2)
-
- ImporteCargo = ObjAcum.DtResultados.SUM("ImporteCargo", "(FacturadoCargo = 0 OR FacturadoCargo IS NULL) AND CveConcepto = 1 ").ToDecimal
- ImporteBonificacion = ObjAcum.DtResultados.SUM("ImporteBonificacion", "(FacturadoBonificacion = 0 OR FacturadoBonificacion IS NULL) AND CveConcepto = 1 ").ToDecimal
-
- LblUsadosImpCargo.Text = ImporteCargo.FormatoNumero(2)
- LblusadosImpBonificacion.Text = ImporteBonificacion.FormatoNumero(2)
-
- Else
- GvAcum.DataSource = Nothing
-
- ImporteCargo = 0D
- ImporteBonificacion = 0D
-
- LblUsadosImpCargo.Text = ""
- LblusadosImpBonificacion.Text = ""
- LblUsadosPuntos.Text = ""
-
- End If
-
- If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
+ End If
+
+ Dim ImporteBonificacion As Decimal = 0
+ If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) AndAlso ObjAcum.DtResultados.Rows.Count > 0 Then
GvUsadosResumen.DataSource = ObjAcum.DtResultados
+ ImporteBonificacion = ObjAcum.DtResultados.Rows(4)("Valor").ToString().ToDecimal()
End If
- GvUsadosResumen.DataBind()
-
- 'LnkFacturaUsadosCargos.Visible = If(ImporteCargo > 0, True, False)
- LnkFacturaUsadosBonificacion.Visible = If(ImporteBonificacion > 0, True, False)
-
+ GvUsadosResumen.DataBind()
+
+
+ 'LnkFacturaUsadosCargos.Visible = If(ImporteCargo > 0, True, False)
+ LnkFacturaUsadosBonificacion.Visible = If(ImporteBonificacion > 0, True, False)
+
ObjAcum.Dispose()
GvAcum.DataBind()
UpAcciones.Update()
- UpUsadosResumen.Update()
+ 'UpUsadosResumen.Update()
UpGvUsadosResumen.Update()
UpAcum.Update()
@@ -10187,7 +10169,7 @@ Partial Class Clientes
Private Sub LnkUsadosReset_Click(sender As Object, e As EventArgs) Handles LnkUsadosReset.Click
Dim Acum As New ClsAcumuladores
- Dim Puntos As Decimal = -LblUsadosPuntos.Text.ToDecimal
+ Dim Puntos As Decimal = -GvUsadosResumen.Rows.Cast(Of GridViewRow).Where(Function(x) x.RowType = DataControlRowType.DataRow).FirstOrDefault(Function(gvr) gvr.RowIndex = 3).DataKey("Puntos").ToEntero()
If Acum.DistribuidorMovtosAdd(CveCliente, 1, 1, 3, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Puntos, "Saldo Inicializado") Then
Alert("Puntuación Inicializada")
End If
diff --git a/Ventas/RepComisionesJAM.aspx b/Ventas/RepComisionesJAM.aspx
index 8fac2b313..cf06867b3 100644
--- a/Ventas/RepComisionesJAM.aspx
+++ b/Ventas/RepComisionesJAM.aspx
@@ -102,7 +102,7 @@
diff --git a/Ventas/RepComisionesJAM.aspx.cs b/Ventas/RepComisionesJAM.aspx.cs
index 1dfcf5071..721d3f7cf 100644
--- a/Ventas/RepComisionesJAM.aspx.cs
+++ b/Ventas/RepComisionesJAM.aspx.cs
@@ -113,28 +113,24 @@ public partial class Ventas_RepComisionesJAM : ClsPaginas
if (e.Row.DBCampo("Transaccion").ToString() == "Pago" && ChkEsquemaNuevo.Checked)
{
e.Row.FCLinkButton("LnkInfo").Visible = true;
- //if (e.Row.DBCampo("CveCategoria").ToEntero() < 1 && e.Row.DBCampo("Comision").ToDouble() == 0)
- //{
- // //if (UsuarioActual.TienePermisoProceso(201))
- // //{
- // // e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
- // // e.Row.Cells[22].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
- // //}
- // //else
- // //{
- // e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
- // e.Row.Cells[22].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
- // //}
- //}else if (e.Row.DBCampo("CveCategoria").ToEntero() > 0 )
- //{
- // e.Row.Cells[21].ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria",$"CveCategoria = {e.Row.DBCampo("CveCategoria").ToString()}")}.";
- // e.Row.Cells[22].ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {e.Row.DBCampo("CveCategoria").ToString()}")}.";
- //}else if(e.Row.DBCampo("Comision").ToDouble() > 0)
- //{
- // e.Row.Cells[21].ToolTip = "El producto obtuvo comision porque esta dentro de los de las comisiones especiales.";
- // e.Row.Cells[22].ToolTip = "El producto obtuvo comision porque esta dentro de los de las comisiones especiales.";
- //}
- }else
+ if (!Convert.ToBoolean(e.Row.DataKey("TieneCategoriaValida")) && e.Row.DataKey("Comision").ToDouble() == 0)
+ {
+ e.Row.FCLinkButton("LnkInfo").ToolTip = $"No se encuentra dentro de alguna categoria que de comision ni alguno de los productos especiales. La categoria del producto es: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { e.Row.DataKey("CveCategoria").ToString()}")}. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}.";
+ }
+ else if (Convert.ToBoolean(e.Row.DataKey("TieneCategoriaValida")) && e.Row.DataKey("Comision").ToDouble() > 0)
+ {
+ e.Row.FCLinkButton("LnkInfo").ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {e.Row.DataKey("CveCategoria").ToString()}")} y esta dentro de los rangos de precio publico y dias validos. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}.";
+ }
+ else if (Convert.ToBoolean(e.Row.DataKey("TieneCategoriaValida")) && e.Row.DataKey("Comision").ToDouble() == 0)
+ {
+ e.Row.FCLinkButton("LnkInfo").ToolTip = $"El producto se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {e.Row.DataKey("CveCategoria").ToString()}")} que da comision, pero no se encuentra dentro de los rangos de precio publico y dias validos. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}.";
+ }
+ else if (e.Row.DataKey("Comision").ToDouble() > 0)
+ {
+ e.Row.FCLinkButton("LnkInfo").ToolTip = $"El producto obtuvo comision porque esta dentro de los de las comisiones especiales. La categoria del producto es: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { e.Row.DataKey("CveCategoria").ToString()}")}. El producto es: {e.Row.DataKey("CodigoPS").ToString()}. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}.";
+ }
+ }
+ else
{
e.Row.FCLinkButton("LnkInfo").Visible = false;
}
@@ -357,19 +353,19 @@ public partial class Ventas_RepComisionesJAM : ClsPaginas
if (!Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() == 0)
{
- LblInfo.Text = $"No se encuentra dentro de alguna categoria que de comision ni alguno de los productos especiales. La categoria del producto es: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { gvRow.DataKey("CveCategoria").ToString()}")}. ";
+ LblInfo.Text = $"No se encuentra dentro de alguna categoria que de comision ni alguno de los productos especiales. La categoria del producto es: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { gvRow.DataKey("CveCategoria").ToString()}")}. % Precio Publico: {gvRow.DataKey("PorcentajePrecioPublico").ToString()} Dias Pago: {gvRow.DataKey("DiasPago").ToString()}";
}
else if (Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() > 0)
{
- LblInfo.Text = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {gvRow.DataKey("CveCategoria").ToString()}")} y esta dentro de los rangos de precio publico y dias validos. ";
+ LblInfo.Text = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {gvRow.DataKey("CveCategoria").ToString()}")} y esta dentro de los rangos de precio publico y dias validos. % Precio Publico: {gvRow.DataKey("PorcentajePrecioPublico").ToString()} Dias Pago: {gvRow.DataKey("DiasPago").ToString()}";
}
else if (Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() == 0)
{
- LblInfo.Text = $"El producto se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {gvRow.DataKey("CveCategoria").ToString()}")} que da comision, pero no se encuentra dentro de los rangos de precio publico y dias validos.";
+ LblInfo.Text = $"El producto se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {gvRow.DataKey("CveCategoria").ToString()}")} que da comision, pero no se encuentra dentro de los rangos de precio publico y dias validos. % Precio Publico: {gvRow.DataKey("PorcentajePrecioPublico").ToString()} Dias Pago: {gvRow.DataKey("DiasPago").ToString()}";
}
else if (gvRow.DataKey("Comision").ToDouble() > 0)
{
- LblInfo.Text = $"El producto obtuvo comision porque esta dentro de los de las comisiones especiales. La categoria del producto es: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { gvRow.DataKey("CveCategoria").ToString()}")}. El producto es: {gvRow.DataKey("CodigoPS").ToString()}. ";
+ LblInfo.Text = $"El producto obtuvo comision porque esta dentro de los de las comisiones especiales. La categoria del producto es: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { gvRow.DataKey("CveCategoria").ToString()}")}. El producto es: {gvRow.DataKey("CodigoPS").ToString()}. % Precio Publico: {gvRow.DataKey("PorcentajePrecioPublico").ToString()} Dias Pago: {gvRow.DataKey("DiasPago").ToString()}";
}
this.RegistraScript("$('#DModalInfo').modal();");
UpModalInformacion.Update();
diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx
index cb3ea762a..d4a7c2227 100644
--- a/Ventas/Ventas.aspx
+++ b/Ventas/Ventas.aspx
@@ -6273,12 +6273,21 @@
+
+
+
+
+
+
+
+
+
- Cargos
+
@@ -6305,7 +6314,7 @@
-
+
@@ -8086,75 +8095,75 @@
function LimpiaModal() {
$('#<%= TxtDireccion.ClientID %>').val('');
- $('#<%= TxtColonia.ClientID %>').val('');
- $('#<%= TxtCiudad.ClientID %>').val('');
- $('#<%= TxtEstado.ClientID %>').val('');
- $('#<%= TxtCP.ClientID %>').val('');
- }
+ $('#<%= TxtColonia.ClientID %>').val('');
+ $('#<%= TxtCiudad.ClientID %>').val('');
+ $('#<%= TxtEstado.ClientID %>').val('');
+ $('#<%= TxtCP.ClientID %>').val('');
+ }
- function BtnMateriales() {
- $('#BtnMateriales').click();
- }
+ function BtnMateriales() {
+ $('#BtnMateriales').click();
+ }
- function BtnEnviarMailCancelacion() {
- $('#BtnEnviarMailCancelacion').click();
- }
- function BtnRefacturacionConfirmar() {
- $('#BtnRefacturacionConfirmar').click();
- }
- function BtnRefacturacionConfirmarAceptacion(Liga) {
- $('#BtnRefacturacionConfirmarAceptacion').click();
- }
- function BtnRefrescarPagina() {
- $('#BtnRefrescarPagina').click();
- }
- function Recargar() {
- $('#BtnRefrescarPagina').click();
- }
- function BtnAplicaNuevaNC() {
- $('#BtnAplicaNuevaNC').click();
- }
+ function BtnEnviarMailCancelacion() {
+ $('#BtnEnviarMailCancelacion').click();
+ }
+ function BtnRefacturacionConfirmar() {
+ $('#BtnRefacturacionConfirmar').click();
+ }
+ function BtnRefacturacionConfirmarAceptacion(Liga) {
+ $('#BtnRefacturacionConfirmarAceptacion').click();
+ }
+ function BtnRefrescarPagina() {
+ $('#BtnRefrescarPagina').click();
+ }
+ function Recargar() {
+ $('#BtnRefrescarPagina').click();
+ }
+ function BtnAplicaNuevaNC() {
+ $('#BtnAplicaNuevaNC').click();
+ }
- $('.DdlPS').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
- $('.DdlPSPyME').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
+ $('.DdlPS').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
+ $('.DdlPSPyME').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
- $("body").on("mouseenter", ".select2-container.select2-container--default.select2-container--open .select2-dropdown li", function (event) {
- var $this = $(this);
- var ind = $this.index();
- $(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable tr.active").removeClass('active');
- $(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable tr:nth-child(" + (ind + 2) + ")").addClass('active');
- //log($this);
- });
- var scrollfuncion = function () {
- var stop = this.scrollTop;
- $(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable").scrollTop(stop);
- }
- function CargaExistenciaAlmacenes(data, params) {
- var div = $('');
- $('.select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable').remove();
- $('.select2-container.select2-container--default.select2-container--open .select2-dropdown').prepend(div);
- var table = $('
'); div.append(table);
- var tbody = $(''); table.append(tbody);
- $(".select2-container--default .select2-results>.select2-results__options").off("scroll", scrollfuncion);
- $(".select2-container--default .select2-results>.select2-results__options").scroll(scrollfuncion);
- var indexd = 0;
- data.forEach(function (item) {
- if (indexd == 0) {
+ $("body").on("mouseenter", ".select2-container.select2-container--default.select2-container--open .select2-dropdown li", function (event) {
+ var $this = $(this);
+ var ind = $this.index();
+ $(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable tr.active").removeClass('active');
+ $(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable tr:nth-child(" + (ind + 2) + ")").addClass('active');
+ //log($this);
+ });
+ var scrollfuncion = function () {
+ var stop = this.scrollTop;
+ $(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable").scrollTop(stop);
+ }
+ function CargaExistenciaAlmacenes(data, params) {
+ var div = $('');
+ $('.select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable').remove();
+ $('.select2-container.select2-container--default.select2-container--open .select2-dropdown').prepend(div);
+ var table = $('
'); div.append(table);
+ var tbody = $(''); table.append(tbody);
+ $(".select2-container--default .select2-results>.select2-results__options").off("scroll", scrollfuncion);
+ $(".select2-container--default .select2-results>.select2-results__options").scroll(scrollfuncion);
+ var indexd = 0;
+ data.forEach(function (item) {
+ if (indexd == 0) {
+ var tr = $('
'); tbody.append(tr);
+ var td;
+ for (var key in item) {
+ if (!(key == "text" || key == "id")) { td = $('
' + key + '
'); tr.append(td); }
+ }
+ }
var tr = $('
'); tbody.append(tr);
+
var td;
for (var key in item) {
- if (!(key == "text" || key == "id")) { td = $('
' + key + '
'); tr.append(td); }
- }
- }
- var tr = $('
'); tbody.append(tr);
-
- var td;
- for (var key in item) {
- if (!(key == "text" || key == "id")) {
- if ((item[key] > 0)) {
- td = $('