From ae4085bc992c56c079eb6e7077dea9b06d439252 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 21 Sep 2023 07:59:48 -0700 Subject: [PATCH] option explciit --- Inventarios/RecepcionAlmacen.aspx.vb | 36 +++++++++++++--------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 03cf16805..144a7ed28 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -1040,7 +1040,7 @@ Partial Class Inventarios_RecepcionAlmacen ArchivoBitacora = String.Format("{0}Temp\RecepcionDT_{1}_{2}.xml", UsuarioActual.Empresa.Ruta, UsuarioActual.CveUsuario, pCveCompra) ArchivoBitacoraDetalle = String.Format("{0}Temp\RecepcionDTD_{1}_{2}.xml", UsuarioActual.Empresa.Ruta, UsuarioActual.CveUsuario, pCveCompra) If ArchivoBitacora <> "" Then - Dim Archivo = New System.IO.FileInfo(ArchivoBitacora) + Dim Archivo As New System.IO.FileInfo(ArchivoBitacora) If Archivo.Exists() Then HplCargaBitacora.Visible = True uppCargaBitacora.Update() @@ -1467,7 +1467,7 @@ Partial Class Inventarios_RecepcionAlmacen e.Row.FCTextBox("TbCantidadF").Enabled = False e.Row.FCCheckBox("cbInv").Enabled = False - Dim Contador = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", e.Row.DataKey("Consec"))).Rows.Count + Dim Contador As Integer = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", e.Row.DataKey("Consec"))).Rows.Count e.Row.FCTextBox("TbCantidadF").Text = Contador.ToString '' Empresa Acumuladores @@ -1612,7 +1612,7 @@ Partial Class Inventarios_RecepcionAlmacen For Each Gvr As GridViewRow In GvInv.Rows If Gvr.DataKey("CodigoBarras") = TxtCodigoPS.Text.Trim Then - Dim TxtCantidad = GvInv.Rows(Gvr.RowIndex).FCTextBox("TbCantidadF") + Dim TxtCantidad As TextBox = GvInv.Rows(Gvr.RowIndex).FCTextBox("TbCantidadF") If Gvr.DataKey("CantidadF").ToDecimal - TxtCantidad.Text.ToDecimal - 1 >= 0 Then If Gvr.DataKey("AplicaSerie") = "True" Then @@ -1625,7 +1625,7 @@ Partial Class Inventarios_RecepcionAlmacen Exit Sub End If - Dim CantidadEspecial = Gvr.DataKey("CveClasificacion").ToString.ToEntero.Contiene(17601, 17881) OrElse Gvr.DataKey("CvePS").ToString.ToEntero.Contiene(343032, 343033) + Dim CantidadEspecial As Boolean = Gvr.DataKey("CveClasificacion").ToString.ToEntero.Contiene(17601, 17881) OrElse Gvr.DataKey("CvePS").ToString.ToEntero.Contiene(343032, 343033) If CantidadEspecial Then RegistraScript("CantidadEspecial();window.setTimeout(FocusCantidadEspecial,200);") @@ -1639,9 +1639,9 @@ Partial Class Inventarios_RecepcionAlmacen 'VERIFICA EXISTENCIAS Dim MensajeSinExistencias As New StringBuilder If TipoMovimiento > 1 Then - Dim ExistenciaActual = DtInv.SUM("CantidadSurtidaPantalla", $"CvePS = {Gvr.DataKey("CvePS").ToEntero} AND CveUM = {Gvr.DataKey("CveUM").ToEntero} ") + 1 + Dim ExistenciaActual As Decimal = DtInv.SUMD("CantidadSurtidaPantalla", $"CvePS = {Gvr.DataKey("CvePS").ToEntero} AND CveUM = {Gvr.DataKey("CveUM").ToEntero} ") + 1 Dim ObjInventarios As New ClsInventarios - Dim Existencia = ObjInventarios.GetExistenciasPS(Gvr.DataKey("CvePS").ToEntero, Gvr.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm")) + Dim Existencia As Decimal = ObjInventarios.GetExistenciasPS(Gvr.DataKey("CvePS").ToEntero, Gvr.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm")) ObjInventarios.Dispose() If Existencia < ExistenciaActual Then @@ -1662,20 +1662,16 @@ Partial Class Inventarios_RecepcionAlmacen TxtCodigoPS.Text = "" RegistraScript("playsonidito('beep-07.wav')") UPInv.Update() - Dim Dr = DtInv.Select($"Consec = {Gvr.DataKey("Consec")}")(0) + Dim Dr As DataRow = DtInv.Select($"Consec = {Gvr.DataKey("Consec")}")(0) Dr("CantidadSurtidaPantalla") = TxtCantidad.Text.ToDecimal DtInv.AcceptChanges() Exit Sub End If - End If - Alert($"Ya se ha cargado la totalidad del Producto ""{Gvr.DataKey("PS").ToString}"" con el Codigo ""{TxtCodigoPS.Text}"".", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus,200);") RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") End If Next - - Alert($"No se ha encontrado un producto para surtir con el Codigo ""{TxtCodigoPS.Text}"". ", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus,200);") RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") TxtCodigoPS.Text = "" @@ -1695,7 +1691,7 @@ Partial Class Inventarios_RecepcionAlmacen AgregaCantidadEspecial() End Sub Private Sub AgregaCantidadEspecial() - Dim TxtCantidad = GvInv.Rows(RowIndexCantidadEspecial).FCTextBox("TbCantidadF") + Dim TxtCantidad As TextBox = GvInv.Rows(RowIndexCantidadEspecial).FCTextBox("TbCantidadF") If CantidadEspecialTemp - TxtCantidadEspecialDiv.Text.ToDecimal - TxtCantidad.Text.ToDecimal >= 0 Then TxtCantidad.Text = (TxtCantidad.Text.ToDecimal + TxtCantidadEspecialDiv.Text.ToDecimal).ToString.FormatoNumero 'RegistraScript("$('#ModalCantidad').modal('hide');") @@ -1848,7 +1844,7 @@ Partial Class Inventarios_RecepcionAlmacen For Each Serie In SeriesArreglo If Serie <> "" Then - Dim Row = DtDatosDetalle.NewRow + Dim Row As DataRow = DtDatosDetalle.NewRow Index = Index + 1 If Index > Cantidad Then Exit For @@ -1859,7 +1855,7 @@ Partial Class Inventarios_RecepcionAlmacen 'VERIFICA EXISTENCIAS If TipoMovimiento > 1 Then - Dim Existencia = ObjInventarios.GetExistenciasPS(CvePSSerie, CveUMSerie, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Serie) + Dim Existencia As Decimal = ObjInventarios.GetExistenciasPS(CvePSSerie, CveUMSerie, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Serie) If Existencia < 1 Then MensajeSinExistencias.Append($"Serie: {Serie}.
") Continue For @@ -2002,10 +1998,10 @@ Partial Class Inventarios_RecepcionAlmacen End If 'SI TIENE ENTRADA POR LOTE, BLOQUEAMOS CHECK Y TXTCANTIDAD - Dim Contador = 0.0 + Dim Contador As Decimal = 0 For Each Gvr As GridViewRow In GvInv.Rows If Gvr.DataKey("CvePS").ToEntero = CvePSSerie Then - Contador = DtDatosLoteDetalle.SUM("Cantidad", String.Format("ConsecId = {0}", Gvr.DataKey("Consec"))) + Contador = DtDatosLoteDetalle.SUMD("Cantidad", String.Format("ConsecId = {0}", Gvr.DataKey("Consec"))) Gvr.FCCheckBox("cbInv").Enabled = False Gvr.FCTextBox("TbCantidadF").Enabled = False If DtDatosLoteDetalle IsNot Nothing AndAlso Contador > 0 Then @@ -2017,7 +2013,7 @@ Partial Class Inventarios_RecepcionAlmacen End If End If - Dim Dr = DtInv.Select($"Consec = {Gvr.DataKey("Consec")}")(0) + Dim Dr As DataRow = DtInv.Select($"Consec = {Gvr.DataKey("Consec")}")(0) Dr("CantidadSurtidaPantalla") = Gvr.FCTextBox("TbCantidadF").Text.ToDecimal DtInv.AcceptChanges() Next @@ -2070,7 +2066,7 @@ Partial Class Inventarios_RecepcionAlmacen 'VERIFICA EXISTENCIAS If TipoMovimiento > 1 Then - Dim Existencia = ObjInventarios.GetExistenciasPS(CvePSSerie, CveUMSerie, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Lote:=Lote) + Dim Existencia As Decimal = ObjInventarios.GetExistenciasPS(CvePSSerie, CveUMSerie, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Lote:=Lote) If Existencia < CantidadLote Then Alert($"
El numero de Lote ""{Lote}"" proporcionado ya se encuentra ingresado.", TipoMensaje.MsgAdvertencia) RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") @@ -4799,7 +4795,7 @@ Partial Class Inventarios_RecepcionAlmacen SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) Dim dt As DataTable = Nothing - Dim ErrorArchivo = False + Dim ErrorArchivo As Boolean = False Try dt = ReadExcelFile(Ruta + FileName, True) @@ -4846,7 +4842,7 @@ Partial Class Inventarios_RecepcionAlmacen For Each RowExcel As DataRow In dt.Rows If RowExcel("Código").ToString() <> "" Then - Dim RowPS = DtInv.FiltroPrimero(String.Format("Codigo='{0}'", RowExcel("Código").ToString())) + Dim RowPS As DataRow = DtInv.FiltroPrimero(String.Format("Codigo='{0}'", RowExcel("Código").ToString())) If RowPS IsNot Nothing AndAlso RowPS("CvePS").ToString().ToEntero() > 0 Then