valida lote/caducidad

This commit is contained in:
2021-03-22 07:58:30 -07:00
parent b7a08ff716
commit 3e18e2399b

View File

@@ -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