From 0e6969ff838b2fe7b1c42170f211a0444825408c Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 12 Mar 2021 23:35:44 -0700 Subject: [PATCH] -- aplcia lote/caducidad --- Inventarios/PrestamosdeProveedor.aspx | 4 ++-- Inventarios/PrestamosdeProveedor.aspx.vb | 17 +++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Inventarios/PrestamosdeProveedor.aspx b/Inventarios/PrestamosdeProveedor.aspx index c409b281a..0363de115 100644 --- a/Inventarios/PrestamosdeProveedor.aspx +++ b/Inventarios/PrestamosdeProveedor.aspx @@ -126,7 +126,7 @@ - + <%-- @@ -138,7 +138,7 @@ - + diff --git a/Inventarios/PrestamosdeProveedor.aspx.vb b/Inventarios/PrestamosdeProveedor.aspx.vb index d8c61f1b8..9bc0babf6 100644 --- a/Inventarios/PrestamosdeProveedor.aspx.vb +++ b/Inventarios/PrestamosdeProveedor.aspx.vb @@ -69,8 +69,8 @@ Partial Class Inventarios_PrestamosdeProveedor End If GvD.Columns(6).Visible = ObjInv.DtResultados.MAX("Serie") <> "" - GvD.Columns(7).Visible = ObjInv.DtResultados.MAX("Lote") <> "" - GvD.Columns(8).Visible = ObjInv.DtResultados.MAX("FechaCaducidad").ToDate > MinFecha + GvD.Columns(7).Visible = ObjInv.DtResultados.MAX("AplicaLote") = "True" 'MAX("Lote") <> "" + GvD.Columns(8).Visible = ObjInv.DtResultados.MAX("AplicaCaducidad") = "True" 'MAX("FechaCaducidad").ToDate > MinFecha GvD.Columns(8).HeaderText = UsuarioActual.Empresa.Funcionalidad(147) ObjInv.Dispose() @@ -141,10 +141,11 @@ Partial Class Inventarios_PrestamosdeProveedor Dim Lote As String = "-1" Dim FechaCaducidad As Date = MinFecha If gvr.DataKey("Serie") <> "" Then Serie = gvr.DataKey("Serie") - If gvr.DataKey("Lote") <> "" Then Lote = gvr.DataKey("Lote") - If gvr.DataKey("FechaCaducidad").ToDate > MinFecha Then FechaCaducidad = gvr.DataKey("FechaCaducidad") + If gvr.DataKey("AplicaLote") = "True" Then Lote = gvr.FCTextBox("TxtLote").Text ' gvr.DataKey("Lote") + If gvr.DataKey("AplicaCaducidad") = "True" Then FechaCaducidad = gvr.FCTextBox("TxtFechaCaducidad").Text.todate ' gvr.DataKey("Lote") + 'If gvr.DataKey("FechaCaducidad").ToDate > MinFecha Then FechaCaducidad = gvr.DataKey("FechaCaducidad") - Dim Valido = ValidaExistencia(gvr.FCTextBox("TxtCantidad").Text.ToDecimal, gvr.DataKey("CvePS").ToEntero, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CveSeccionAlmacen").ToEntero, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad) + Dim Valido = ValidaExistencia(gvr.FCTextBox("TxtCantidad").Text.ToDecimal, gvr.DataKey("CvePS").ToEntero, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CveSeccionAlmacen").ToEntero, Serie, Lote, FechaCaducidad, gvr.DataKey("PS")) If Not Valido Then Alert("No hay existencia del producto a devolver.", TipoMensaje.MsgAdvertencia) Exit Sub @@ -273,7 +274,7 @@ Partial Class Inventarios_PrestamosdeProveedor End If End Sub - Private Function ValidaExistencia(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, CveSeccionAlmacen As Integer, Serie As String, Lote As String, FechaCaducidad As Date) As Boolean + Private Function ValidaExistencia(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, CveSeccionAlmacen As Integer, Serie As String, Lote As String, FechaCaducidad As Date, PS As String) As Boolean Dim Retorno = True Dim Inv As New ClsInventarios @@ -283,9 +284,9 @@ Partial Class Inventarios_PrestamosdeProveedor If Existencia - Cantidad < 0 Then If Existencia < 0 Then - Alert("No hay existencia del producto", TipoMensaje.MsgAdvertencia) + Alert(String.Format("No hay existencia del producto: ", PS), TipoMensaje.MsgAdvertencia) Else - Alert(String.Format("Solo hay en existencia: {0}", Existencia), TipoMensaje.MsgAdvertencia) + Alert(String.Format("Solo hay en existencia: {0} en el producto: {1}", Existencia, PS), TipoMensaje.MsgAdvertencia) End If Retorno = False End If