diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 6e51b4464..aef28ee58 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -1991,6 +1991,7 @@ Partial Class Inventarios_EntregaAlmacen Dim ValidaSeccion As Boolean = False : Dim ValidaCaducidad As Boolean = False : Dim ValidaLote As Boolean = False 'VALIDA CANTIDAD DE SALIDA 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 @@ -2007,8 +2008,34 @@ Partial Class Inventarios_EntregaAlmacen Exit For End If + Next + + Dim NumRegistros As Integer = 0 + + For Each Gvr As GridViewRow In GvDatos.Rows + If Gvr.RowType = DataControlRowType.DataRow Then + If Gvr.FCCheckBox("cbInv").Checked Then + NumRegistros += 1 + End If + End If Next + 'LIMITAR EL NUMERO DE PARTIDAS QUE SE PUEDEN ENTREGAR + If UsuarioActual.CveEmpresa = 186 Then + 'SI EL CLIENTE ES OPERADORA DE HOSPITALES ANGELES SOLO SE PUEDEN RECIBIR MAXIMO 5 + If CveCliente = 819998 Then + If NumRegistros > 5 Then + Alert("Solo se pueden recibir maximo 5 partidas.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + Else + If NumRegistros > 10 Then + Alert("Solo se pueden recibir maximo 10 partidas.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + End If + End If + ValidaSeccion = False ValidaCaducidad = False ValidaLote = False