From cd62f9a238edfb9854b8312d786645b066efed15 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Fri, 19 Apr 2024 08:41:30 -0700 Subject: [PATCH] Kardex siguiente siguiente PS con movimientos (Ajustes) --- Inventarios/Kardex.aspx.vb | 39 ++++++++++++++++++++++++-- Inventarios/KardexAlmacen.aspx.vb | 39 +++++++++++++++++++++++++- Inventarios/RepEntradasSalidas.aspx.vb | 38 ++++++++++++++++++++++++- 3 files changed, 112 insertions(+), 4 deletions(-) diff --git a/Inventarios/Kardex.aspx.vb b/Inventarios/Kardex.aspx.vb index 29b52f758..5811d25d8 100644 --- a/Inventarios/Kardex.aspx.vb +++ b/Inventarios/Kardex.aspx.vb @@ -2,9 +2,11 @@ Option Explicit On Imports System.Data +Imports System.Security.Cryptography.Pkcs Imports ADSNetLibrary.SIGAPI.Models.CGame Imports Extensiones Imports Microsoft.Reporting.WebForms +Imports Telerik.Web.UI Partial Class Inventarios_Kardex Inherits ClsPaginas @@ -569,7 +571,10 @@ Partial Class Inventarios_Kardex Dim CvePS As Integer = ddlProducto2.SelectedValue.ToEntero If Not CvePS > 0 Then - Exit Sub + CvePS = ObtenerInicioPSNavegacion(Siguiente:=Siguiente) + If Not CvePS > 0 Then + Exit Sub + End If End If Dim dt As DataTable = New DataTable @@ -609,6 +614,34 @@ Partial Class Inventarios_Kardex ObjInventarios.Dispose() If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then + ddlProducto2.SelectedValue = dt.Rows(0)("CvePS").ToString + ddlProducto2.SelectedText = dt.Rows(0)("CodigoPS").ToString + ddlProducto2.txtValue.Value = dt.Rows(0)("CvePS").ToString + ddlProducto2.txtText.Value = dt.Rows(0)("CodigoPS").ToString + UPFiltros.Update() + UPDatos.Update() + End If + + End Sub + + Private Function ObtenerInicioPSNavegacion(Siguiente As Boolean) As Integer + + Dim CvePSRespuesta As Integer = -1 + Dim dt As DataTable = New DataTable + + If Siguiente Then + If TxtCodigoInicio.Text.Trim.Length > 0 Then + dt = GlobalDTPS(UsuarioActual.CveEmpresa, Codigo:=TxtCodigoInicio.Text.Trim) + End If + Else + If TxtCodigoFinal.Text.Trim.Length > 0 Then + dt = GlobalDTPS(UsuarioActual.CveEmpresa, Codigo:=TxtCodigoFinal.Text.Trim) + End If + End If + + + If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then + CvePSRespuesta = dt.Rows(0)("CvePS").ToString.ToEntero ddlProducto2.SelectedValue = dt.Rows(0)("CvePS").ToString ddlProducto2.SelectedText = dt.Rows(0)("CodigoPS").ToString ddlProducto2.txtValue.Value = dt.Rows(0)("CvePS").ToString @@ -617,7 +650,9 @@ Partial Class Inventarios_Kardex UPFiltros.Update() UPDatos.Update() End If - End Sub + Return CvePSRespuesta + + End Function End Class diff --git a/Inventarios/KardexAlmacen.aspx.vb b/Inventarios/KardexAlmacen.aspx.vb index f95e5c3b4..bfad31eaa 100644 --- a/Inventarios/KardexAlmacen.aspx.vb +++ b/Inventarios/KardexAlmacen.aspx.vb @@ -212,8 +212,12 @@ Partial Class Inventarios_KardexAlmacen Dim CvePS As Integer = ddlProducto2.SelectedValue.ToEntero If Not CvePS > 0 Then - Exit Sub + CvePS = ObtenerInicioPSNavegacion(Siguiente:=Siguiente) + If Not CvePS > 0 Then + Exit Sub + End If End If + Dim dt As DataTable = New DataTable Dim Entrada As Boolean = True @@ -261,4 +265,37 @@ Partial Class Inventarios_KardexAlmacen End If End Sub + Private Function ObtenerInicioPSNavegacion(Siguiente As Boolean) As Integer + + Dim CvePSRespuesta As Integer = -1 + Dim dt As DataTable = New DataTable + + If Siguiente Then + If TxtCodigoInicio.Text.Trim.Length > 0 Then + 'CvePSRespuesta = GlobalDTPS(UsuarioActual.CveEmpresa, Codigo:=TxtCodigoInicio.Text.Trim).FiltroPrimeroValor("CvePS").ToEntero + dt = GlobalDTPS(UsuarioActual.CveEmpresa, Codigo:=TxtCodigoInicio.Text.Trim) + End If + Else + If TxtCodigoFinal.Text.Trim.Length > 0 Then + 'CvePSRespuesta = GlobalDTPS(UsuarioActual.CveEmpresa, Codigo:=TxtCodigoFinal.Text.Trim).FiltroPrimeroValor("CvePS").ToEntero + dt = GlobalDTPS(UsuarioActual.CveEmpresa, Codigo:=TxtCodigoFinal.Text.Trim) + End If + End If + + + If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then + CvePSRespuesta = dt.Rows(0)("CvePS").ToString.ToEntero + ddlProducto2.SelectedValue = dt.Rows(0)("CvePS").ToString + ddlProducto2.SelectedText = dt.Rows(0)("CodigoPS").ToString + ddlProducto2.txtValue.Value = dt.Rows(0)("CvePS").ToString + ddlProducto2.txtText.Value = dt.Rows(0)("CodigoPS").ToString + UPFiltros.Update() + + End If + + + Return CvePSRespuesta + + End Function + End Class diff --git a/Inventarios/RepEntradasSalidas.aspx.vb b/Inventarios/RepEntradasSalidas.aspx.vb index 586d6d878..3e299a807 100644 --- a/Inventarios/RepEntradasSalidas.aspx.vb +++ b/Inventarios/RepEntradasSalidas.aspx.vb @@ -586,7 +586,10 @@ Partial Class Inventarios_ReporteEntradasSalidas Dim CvePS As Integer = DdlPS.SelectedValue.ToEntero If Not CvePS > 0 Then - Exit Sub + CvePS = ObtenerInicioPSNavegacion(Siguiente:=Siguiente) + If Not CvePS > 0 Then + Exit Sub + End If End If Dim dt As DataTable = New DataTable @@ -636,6 +639,39 @@ Partial Class Inventarios_ReporteEntradasSalidas End If End Sub + Private Function ObtenerInicioPSNavegacion(Siguiente As Boolean) As Integer + + Dim CvePSRespuesta As Integer = -1 + Dim dt As DataTable = New DataTable + + If Siguiente Then + If TxtCodigoInicio.Text.Trim.Length > 0 Then + 'CvePSRespuesta = GlobalDTPS(UsuarioActual.CveEmpresa, Codigo:=TxtCodigoInicio.Text.Trim).FiltroPrimeroValor("CvePS").ToEntero + dt = GlobalDTPS(UsuarioActual.CveEmpresa, Codigo:=TxtCodigoInicio.Text.Trim) + End If + Else + If TxtCodigoFinal.Text.Trim.Length > 0 Then + 'CvePSRespuesta = GlobalDTPS(UsuarioActual.CveEmpresa, Codigo:=TxtCodigoFinal.Text.Trim).FiltroPrimeroValor("CvePS").ToEntero + dt = GlobalDTPS(UsuarioActual.CveEmpresa, Codigo:=TxtCodigoFinal.Text.Trim) + End If + End If + + + If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then + CvePSRespuesta = dt.Rows(0)("CvePS").ToString.ToEntero + DdlPS.SelectedValue = dt.Rows(0)("CvePS").ToString + DdlPS.SelectedText = dt.Rows(0)("CodigoPS").ToString + DdlPS.txtValue.Value = dt.Rows(0)("CvePS").ToString + DdlPS.txtText.Value = dt.Rows(0)("CodigoPS").ToString + 'UPFiltros.Update() + UPPMov.Update() + End If + + + Return CvePSRespuesta + + End Function + 'Protected Sub Lnkcompuxlsinventarios_Click(sender As Object, e As EventArgs) ' Dim continuar = True ' Try