From 9d9303407ffb889ff0601331d46bcaec4a3b0c99 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Wed, 8 Jan 2025 17:14:06 -0700 Subject: [PATCH] Entradas salidas fix acumulado AddNew --- Inventarios/EntradasSalidas.aspx.vb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index a760288cf..356ddef0c 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -1629,7 +1629,14 @@ Partial Class Inventarios_EntradasSalidas Dim Existencia As Decimal = GetExistencias(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, -1, If(Serie = "", "-1", Serie), If(Lote = "", "-1", Lote), FechaCaducidadVal) ' LbAgregar.ToolTip = Existencia.ToString - If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} {If(Serie <> "", $" AND Serie = '{Serie}'", "")}") < 0 Then + + Dim Acunmulado As Decimal = DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} {If(Serie <> "", $" AND Serie = '{Serie}'", "")}") + + If FechaCaducidadVal > MinFecha Then + Acunmulado = DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} and Lote = '{Lote}' and FechaCaducidad = '{FechaCaducidadVal}' ") + End If + + If Existencia - Cantidad - Acunmulado < 0 Then If Existencia <= 0 Then Alert("No hay existencia del producto: " & PS, TipoMensaje.MsgAdvertencia) RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")