From 3e18e2399bd5f1184ff926d85e1779d575d43f91 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 22 Mar 2021 07:58:30 -0700 Subject: [PATCH] valida lote/caducidad --- Inventarios/RecepcionAlmacen.aspx.vb | 52 +++++++++++++++++++++------- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index fa8443cc1..304e33b82 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -28,6 +28,15 @@ Partial Class Inventarios_RecepcionAlmacen ViewState("EstatusFinalOK") = value 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 DtInv As DataTable Get If ViewState("DtInv") Is Nothing Then @@ -966,6 +975,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim DtRecepcion As DataTable = Nothing Dim NumUsados = ObjInventario.DtResultados.COUNT("EsUsado", "EsUsado = True").ToEntero() Dim NumProductos = ObjInventario.DtResultados.COUNT("EsUsado", "EsUsado = False").ToEntero() + Dim CveSubProyecto As Integer 'SI LA COMPRA TIENE PRODUCTOS Y USADOS SOLO MOSTRAR LOS PRODUCTOS If NumProductos > 0 AndAlso NumUsados > 0 Then @@ -994,6 +1004,11 @@ Partial Class Inventarios_RecepcionAlmacen End If + CveSubProyecto = DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero + If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyecto = 10276 Then + ValidaLoteCaducidad = True + End If + CveAlmacenDevolucionProveedor = DtRecepcion.Rows(0)("CveAlmacenDevolucionProveedor").ToString.ToEntero 'SI ES MOTOBATERIA NO GENERA MOVIMIENTO VIRTUAL @@ -1439,21 +1454,25 @@ Partial Class Inventarios_RecepcionAlmacen e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = False End If - 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 - e.Row.FCTextBox("TxtDividir").Visible = True - Else - e.Row.FCTextBox("TxtCaducidad").Visible = False - e.Row.FCLinkButton("LnkCaducidad").Visible = False + 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").Text = Now.ToShortDateString + e.Row.FCTextBox("TxtDividir").Visible = True + Else + e.Row.FCTextBox("TxtCaducidad").Visible = False + 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 + 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)) e.Row.FCButton("BtnDividir").CommandArgument = e.Row.RowIndex.ToString @@ -2162,6 +2181,13 @@ Partial Class Inventarios_RecepcionAlmacen End If 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