--Validaciones de entrega
This commit is contained in:
@@ -1991,37 +1991,52 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
Dim ValidaSeccion As Boolean = False : Dim ValidaCaducidad As Boolean = False : Dim ValidaLote As Boolean = False
|
Dim ValidaSeccion As Boolean = False : Dim ValidaCaducidad As Boolean = False : Dim ValidaLote As Boolean = False
|
||||||
'VALIDA CANTIDAD DE SALIDA
|
'VALIDA CANTIDAD DE SALIDA
|
||||||
Dim Cantidad As Decimal = 0.0D
|
Dim Cantidad As Decimal = 0.0D
|
||||||
|
|
||||||
For Each Gvr As GridViewRow In GvDatos.Rows
|
|
||||||
If CBool(Gvr.DataKey("AplicaSeccion")) AndAlso Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero() <= 0 Then
|
|
||||||
ValidaSeccion = True
|
|
||||||
End If
|
|
||||||
If CBool(Gvr.DataKey("AplicaCaducidad")) AndAlso Gvr.FCTextBox("TxtCaducidad").Text.Trim = "" Then
|
|
||||||
ValidaCaducidad = True
|
|
||||||
End If
|
|
||||||
If CBool(Gvr.DataKey("AplicaLote")) AndAlso Gvr.FCTextBox("TxtLote").Text.Trim = "" Then
|
|
||||||
ValidaLote = True
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Gvr.FCCheckBox("cbInv").Checked AndAlso Gvr.FCTextBox("TbCantidadF").Text.ToDecimal > 0 Then
|
|
||||||
Cantidad = Gvr.FCTextBox("TbCantidadF").Text.ToDecimal
|
|
||||||
Exit For
|
|
||||||
End If
|
|
||||||
|
|
||||||
Next
|
|
||||||
|
|
||||||
Dim NumRegistros As Integer = 0
|
Dim NumRegistros As Integer = 0
|
||||||
|
|
||||||
For Each Gvr As GridViewRow In GvDatos.Rows
|
For Each Gvr As GridViewRow In GvDatos.Rows
|
||||||
If Gvr.RowType = DataControlRowType.DataRow Then
|
If Gvr.RowType = DataControlRowType.DataRow Then
|
||||||
If Gvr.FCCheckBox("cbInv").Checked Then
|
If Gvr.FCCheckBox("cbInv").Checked Then
|
||||||
NumRegistros += 1
|
NumRegistros += 1
|
||||||
|
|
||||||
|
If CBool(Gvr.DataKey("AplicaSeccion")) AndAlso Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero() <= 0 Then
|
||||||
|
ValidaSeccion = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If CBool(Gvr.DataKey("AplicaCaducidad")) Then
|
||||||
|
If GvDatos.Columns(8).Visible Then
|
||||||
|
If String.IsNullOrEmpty(Gvr.FCDropDownList("DdlCaducidadProducto").SelectedValue.Trim()) OrElse Gvr.FCDropDownList("DdlCaducidadProducto").SelectedValue.Trim() = "|" Then
|
||||||
|
ValidaCaducidad = True
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
If String.IsNullOrEmpty(Gvr.FCTextBox("TxtCaducidad").Text.Trim) Then
|
||||||
|
ValidaCaducidad = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If CBool(Gvr.DataKey("AplicaLote")) Then
|
||||||
|
If GvDatos.Columns(8).Visible Then
|
||||||
|
If String.IsNullOrEmpty(Gvr.FCDropDownList("DdlCaducidadProducto").SelectedValue.Trim()) OrElse Gvr.FCDropDownList("DdlCaducidadProducto").SelectedValue.Trim() = "|" Then
|
||||||
|
ValidaLote = True
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
If String.IsNullOrEmpty(Gvr.FCTextBox("TxtLote").Text.Trim) Then
|
||||||
|
ValidaLote = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Gvr.FCCheckBox("cbInv").Checked AndAlso Gvr.FCTextBox("TbCantidadF").Text.ToDecimal > 0 Then
|
||||||
|
Cantidad = Gvr.FCTextBox("TbCantidadF").Text.ToDecimal
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
'LIMITAR EL NUMERO DE PARTIDAS QUE SE PUEDEN ENTREGAR
|
'LIMITAR EL NUMERO DE PARTIDAS QUE SE PUEDEN ENTREGAR
|
||||||
If UsuarioActual.CveEmpresa = 186 Then
|
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
|
||||||
'SI EL CLIENTE ES OPERADORA DE HOSPITALES ANGELES SOLO SE PUEDEN RECIBIR MAXIMO 5
|
'SI EL CLIENTE ES OPERADORA DE HOSPITALES ANGELES SOLO SE PUEDEN RECIBIR MAXIMO 5
|
||||||
If CveCliente = 819998 Then
|
If CveCliente = 819998 Then
|
||||||
If NumRegistros > 5 Then
|
If NumRegistros > 5 Then
|
||||||
@@ -2036,9 +2051,9 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
ValidaSeccion = False
|
'ValidaSeccion = False
|
||||||
ValidaCaducidad = False
|
'ValidaCaducidad = False
|
||||||
ValidaLote = False
|
'ValidaLote = False
|
||||||
|
|
||||||
If ValidaSeccion Then
|
If ValidaSeccion Then
|
||||||
Alert("La sección de almacen no ha sido especificada en todos los productos.", TipoMensaje.MsgAdvertencia)
|
Alert("La sección de almacen no ha sido especificada en todos los productos.", TipoMensaje.MsgAdvertencia)
|
||||||
@@ -2053,12 +2068,13 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
If Not Cantidad > 0 Then
|
If Not Cantidad > 0 Then
|
||||||
Alert("No se detecto ningun movimiento por hacer. Por favor verifique e intente nuevamente.", TipoMensaje.MsgAdvertencia)
|
Alert("No se detecto ningun movimiento por hacer. Por favor verifique e intente nuevamente.", TipoMensaje.MsgAdvertencia)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'PROCESO , si tiene proceso "176" no lo valida
|
'PROCESO , si tiene proceso "176" no lo valida
|
||||||
If Not UsuarioActual.TienePermisoProceso(176) Then
|
If Not UsuarioActual.TienePermisoProceso(176) Then
|
||||||
For Each Gvr As GridViewRow In GvDatos.Rows
|
For Each Gvr As GridViewRow In GvDatos.Rows
|
||||||
|
|||||||
Reference in New Issue
Block a user