diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index bab5eb6ef..749ad971a 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -269,14 +269,6 @@ Partial Class Inventarios_EntregaAlmacen End Set End Property - Private Property ValidaLoteCaducidad As Boolean - Get - Return CType(ViewState("ValidaLoteCaducidad"), Boolean) - End Get - Set(value As Boolean) - ViewState("ValidaLoteCaducidad") = value - End Set - End Property #End Region @@ -997,39 +989,36 @@ Partial Class Inventarios_EntregaAlmacen e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = False End If - If (ValidaLoteCaducidad) OrElse (UsuarioActual.CveEmpresa <> 119) Then - If CBool(e.Row.DBCampo("AplicaCaducidad")) Then - e.Row.FCTextBox("TxtCaducidad").Visible = True - e.Row.FCLinkButton("LnkCaducidad").Visible = True - e.Row.FCTextBox("TxtCaducidad").ReadOnly = True - CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False + If CBool(e.Row.DBCampo("AplicaCaducidad")) Then + e.Row.FCTextBox("TxtCaducidad").Visible = True + e.Row.FCLinkButton("LnkCaducidad").Visible = True + e.Row.FCTextBox("TxtCaducidad").ReadOnly = True + CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False - 'si aplica caducidad y viene vacía (posible por venta anterior), que se active su registro - If e.Row.FCTextBox("TxtCaducidad").Text = "" OrElse e.Row.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha Then - e.Row.FCTextBox("TxtCaducidad").ReadOnly = False - CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = True - e.Row.FCTextBox("TxtCaducidad").Enabled = True - End If - Else - e.Row.FCTextBox("TxtCaducidad").Visible = False - e.Row.FCLinkButton("LnkCaducidad").Visible = False + 'si aplica caducidad y viene vacía (posible por venta anterior), que se active su registro + If e.Row.FCTextBox("TxtCaducidad").Text = "" OrElse e.Row.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha Then + e.Row.FCTextBox("TxtCaducidad").ReadOnly = False + CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = True e.Row.FCTextBox("TxtCaducidad").Enabled = True End If + Else + e.Row.FCTextBox("TxtCaducidad").Visible = False + e.Row.FCLinkButton("LnkCaducidad").Visible = False + e.Row.FCTextBox("TxtCaducidad").Enabled = True + End If - If CBool(e.Row.DBCampo("AplicaLote")) Then - e.Row.FCTextBox("TxtLote").Visible = True - 'si aplica caducidad y viene vacía (posible por venta anterior), que se active su registro - If e.Row.FCTextBox("TxtLote").Text = "" Then - e.Row.FCTextBox("TxtLote").ReadOnly = False - e.Row.FCTextBox("TxtLote").Enabled = True - Else - e.Row.FCTextBox("TxtLote").ReadOnly = True - End If - + If CBool(e.Row.DBCampo("AplicaLote")) Then + e.Row.FCTextBox("TxtLote").Visible = True + 'si aplica caducidad y viene vacía (posible por venta anterior), que se active su registro + If e.Row.FCTextBox("TxtLote").Text = "" Then + e.Row.FCTextBox("TxtLote").ReadOnly = False + e.Row.FCTextBox("TxtLote").Enabled = True Else - e.Row.FCTextBox("TxtLote").Visible = False + e.Row.FCTextBox("TxtLote").ReadOnly = True End If + Else + e.Row.FCTextBox("TxtLote").Visible = False End If e.Row.FCButton("BtnDividir").Attributes.Add("onclick", String.Format("Dividir('{0}');", e.Row.FCTextBox("TxtDividir").ClientID)) @@ -1708,11 +1697,9 @@ Partial Class Inventarios_EntregaAlmacen Next - If (Not ValidaLoteCaducidad) OrElse (UsuarioActual.CveEmpresa <> 119) Then - ValidaSeccion = False - ValidaCaducidad = False - ValidaLote = False - End If + ValidaSeccion = False + ValidaCaducidad = False + ValidaLote = False If ValidaSeccion Then Alert("La sección de almacen no ha sido especificada en todos los productos.", TipoMensaje.MsgAdvertencia) @@ -1855,11 +1842,6 @@ Partial Class Inventarios_EntregaAlmacen FechaCaducidad = If(CBool(Dr("AplicaCaducidad")) AndAlso Dr("FechaCaducidad").ToString() <> "", Dr("FechaCaducidad").ToString().ToDate, MinFecha) Lote = If(CBool(Dr("AplicaLote")), Dr("Lote").ToString().Trim, "-1") - If Not ValidaLoteCaducidad Then - FechaCaducidad = MinFecha - Lote = "-1" - End If - If Dr("CantidadGV").ToString().ToDecimal > 0 Then If CBool(Dr("AplicaSerie")) Then DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec"))) diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 81721ec42..d533f8438 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -28,14 +28,6 @@ Partial Class Inventarios_RecepcionAlmacen End Set End Property - Private Property ValidaLoteCaducidad As Boolean - Get - Return CType(ViewState("ValidaLoteCaducidad"), Boolean) - End Get - Set(value As Boolean) - ViewState("ValidaLoteCaducidad") = value - End Set - End Property Private Property CveTipoAlmacen As Integer Get Return CType(ViewState("CveTipoAlmacen"), Integer) @@ -1537,8 +1529,7 @@ Partial Class Inventarios_RecepcionAlmacen e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = False End If - If (ValidaLoteCaducidad) OrElse (UsuarioActual.CveEmpresa <> 119) Then - If CBool(e.Row.DBCampo("AplicaCaducidad")) Then + If CBool(e.Row.DBCampo("AplicaCaducidad")) Then e.Row.FCTextBox("TxtCaducidad").Visible = True e.Row.FCLinkButton("LnkCaducidad").Visible = True e.Row.FCTextBox("TxtCaducidad").Text = Now.ToShortDateString @@ -1548,12 +1539,10 @@ Partial Class Inventarios_RecepcionAlmacen e.Row.FCLinkButton("LnkCaducidad").Visible = False End If - If CBool(e.Row.DBCampo("AplicaLote")) Then - e.Row.FCTextBox("TxtLote").Visible = True - Else - e.Row.FCTextBox("TxtLote").Visible = False - End If - + If CBool(e.Row.DBCampo("AplicaLote")) Then + e.Row.FCTextBox("TxtLote").Visible = True + Else + e.Row.FCTextBox("TxtLote").Visible = False End If e.Row.FCButton("BtnDividir").Attributes.Add("onclick", String.Format("Dividir('{0}');", e.Row.FCTextBox("TxtDividir").ClientID)) @@ -2271,12 +2260,6 @@ Partial Class Inventarios_RecepcionAlmacen Index += 1 Next - If (Not ValidaLoteCaducidad) OrElse (UsuarioActual.CveEmpresa <> 119) Then - ValidaSeccion = False - ValidaCaducidad = False - ValidaLote = False - End If - If ValidaSeccion Then Alert("La sección de almacen no ha sido especificada en todos los productos.", TipoMensaje.MsgAdvertencia) Return False