validación de campos en los pop up
This commit is contained in:
@@ -94,72 +94,77 @@ Partial Class Inventarios_Default
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaDatos(CvePS As Integer, Tipo As Integer)
|
||||
Dim ObjInventarios As New ClsInventarios()
|
||||
If ObjInventarios.GetExistenciasProducto(CvePS, -1, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), ExcluyeApartados:=-1, ExcluyeAdelantado:=1, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then
|
||||
Dim dr As Data.DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
||||
|
||||
If dr IsNot Nothing Then
|
||||
LtPs.Text = $"Producto: <b>{dr("PSCodigo").ToString}</b>"
|
||||
Dim CvePrecioLista As Integer = -1
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(404).ToString = "1" Then 'sino manneja precios de lista
|
||||
CvePrecioLista = -2
|
||||
End If
|
||||
If ValidarFiltrosSeleccionados() Then
|
||||
Dim ObjInventarios As New ClsInventarios()
|
||||
If ObjInventarios.GetExistenciasProducto(CvePS, -1, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), ExcluyeApartados:=-1, ExcluyeAdelantado:=1, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then
|
||||
Dim dr As Data.DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
||||
|
||||
Dim ObjVta As New ClsVentas
|
||||
Dim objPS As New ClsProductosServicios
|
||||
If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then
|
||||
If ObjVta.DtResultados.Rows.Count > 0 Then
|
||||
If CvePrecioLista = -1 Then CvePrecioLista = ObjVta.DtResultados.Rows(0)("CvePrecioLista").ToString.ToEntero
|
||||
If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioLista, -1, DDlPS.SelectedValue.ToEntero) Then
|
||||
If objPS.DtResultados.Rows.Count > 0 Then
|
||||
LtPrecioPS.Text = $"Precio de venta: <b>$: {objPS.DtResultados.Rows(0)("PrecioLista").ToString.FormatoNumero} {dr("Abreviatura").ToString}</b>"
|
||||
If dr IsNot Nothing Then
|
||||
LtPs.Text = $"Producto: <b>{dr("PSCodigo").ToString}</b>"
|
||||
Dim CvePrecioLista As Integer = -1
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(404).ToString = "1" Then 'sino manneja precios de lista
|
||||
CvePrecioLista = -2
|
||||
End If
|
||||
|
||||
Dim ObjVta As New ClsVentas
|
||||
Dim objPS As New ClsProductosServicios
|
||||
If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then
|
||||
If ObjVta.DtResultados.Rows.Count > 0 Then
|
||||
If CvePrecioLista = -1 Then CvePrecioLista = ObjVta.DtResultados.Rows(0)("CvePrecioLista").ToString.ToEntero
|
||||
If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioLista, -1, DDlPS.SelectedValue.ToEntero) Then
|
||||
If objPS.DtResultados.Rows.Count > 0 Then
|
||||
LtPrecioPS.Text = $"Precio de venta: <b>$: {objPS.DtResultados.Rows(0)("PrecioLista").ToString.FormatoNumero} {dr("Abreviatura").ToString}</b>"
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
ObjVta.Dispose()
|
||||
objPS.Dispose()
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
If CBool(dr("AplicaIEPS")) Then
|
||||
LtlIEPS.Visible = True
|
||||
LtlIEPSPorcentaje.Visible = True
|
||||
LtlIEPSPorcentaje.Text = $"<b>% {(dr("IEPSPorcentaje").ToString.ToDouble * 100).FormatoNumero}</b>"
|
||||
Else
|
||||
LtlIEPS.Visible = False
|
||||
LtlIEPSPorcentaje.Visible = False
|
||||
End If
|
||||
If dr("IVA").ToString = "-1" OrElse dr("IVA").ToString.ToDecimal > 0 Then
|
||||
LtlIVA.Visible = True
|
||||
LtlIVAPorcentaje.Visible = True
|
||||
LtlIVAPorcentaje.Text = $"<b>Si</b>"
|
||||
Else
|
||||
LtlIVA.Visible = False
|
||||
LtlIVAPorcentaje.Visible = False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
ObjVta.Dispose()
|
||||
objPS.Dispose()
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
If CBool(dr("AplicaIEPS")) Then
|
||||
LtlIEPS.Visible = True
|
||||
LtlIEPSPorcentaje.Visible = True
|
||||
LtlIEPSPorcentaje.Text = $"<b>% {(dr("IEPSPorcentaje").ToString.ToDouble * 100).FormatoNumero}</b>"
|
||||
Else
|
||||
LtlIEPS.Visible = False
|
||||
LtlIEPSPorcentaje.Visible = False
|
||||
End If
|
||||
If dr("IVA").ToString = "-1" OrElse dr("IVA").ToString.ToDecimal > 0 Then
|
||||
LtlIVA.Visible = True
|
||||
LtlIVAPorcentaje.Visible = True
|
||||
LtlIVAPorcentaje.Text = $"<b>Si</b>"
|
||||
Else
|
||||
LtlIVA.Visible = False
|
||||
LtlIVAPorcentaje.Visible = False
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveUsuario = 100 Then
|
||||
HlPendiente.Visible = True
|
||||
HlPendiente.NavigateUrl = String.Format("/Inventarios/RepVentasXSurtir.aspx?CvePS={0}", CvePS)
|
||||
End If
|
||||
|
||||
If ObjInventarios.DtResultados.Rows.Count > 0 Then
|
||||
GV.DataSource = ObjInventarios.DtResultados
|
||||
Else
|
||||
GV.DataSource = Nothing
|
||||
Dim Js = If(Tipo = 1, "", "window.setTimeout(Focus,200);")
|
||||
Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveUsuario = 100 Then
|
||||
HlPendiente.Visible = True
|
||||
HlPendiente.NavigateUrl = String.Format("/Inventarios/RepVentasXSurtir.aspx?CvePS={0}", CvePS)
|
||||
End If
|
||||
ObjInventarios.Dispose()
|
||||
GV.DataBind()
|
||||
|
||||
If ObjInventarios.DtResultados.Rows.Count > 0 Then
|
||||
GV.DataSource = ObjInventarios.DtResultados
|
||||
Else
|
||||
GV.DataSource = Nothing
|
||||
Dim Js = If(Tipo = 1, "", "window.setTimeout(Focus,200);")
|
||||
Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
|
||||
UPDatos.Update()
|
||||
TblBusqueda.Visible = True
|
||||
Else
|
||||
Alert("Seleccione un producto o servicio", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
ObjInventarios.Dispose()
|
||||
GV.DataBind()
|
||||
|
||||
|
||||
|
||||
UPDatos.Update()
|
||||
TblBusqueda.Visible = True
|
||||
End Sub
|
||||
Private Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
@@ -227,6 +232,7 @@ Partial Class Inventarios_Default
|
||||
End Sub
|
||||
|
||||
Private Sub CargarDatosMedRin()
|
||||
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
If ObjInventarios.GetExistenciasMedRin(DDlPS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlRin.SelectedValue.ToEntero, DdlMedidas.SelectedValue.ToEntero) Then
|
||||
GvMedRin.DataSource = ObjInventarios.DtResultados
|
||||
@@ -236,4 +242,9 @@ Partial Class Inventarios_Default
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Function ValidarFiltrosSeleccionados() As Boolean
|
||||
If DDlPS.SelectedValue.ToEntero > 0 Then Return True
|
||||
Return False
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user