From 8a504f50153cabe134545f8be47a310ff26d6b01 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 18 Sep 2023 08:57:55 -0700 Subject: [PATCH 01/35] --option explicit --- OC/OC.aspx.vb | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index f986b9cfa..e71558a52 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -2071,7 +2071,7 @@ Partial Class OC_OC Dim Gvr As GridViewRow = CType(CType(sender, DropDownList).BindingContainer, GridViewRow) 'Dim filtro As String = "" - Dim CveClasificacion = DirectCast(sender, DropDownList).SelectedValue.ToEntero + Dim CveClasificacion As Integer = DirectCast(sender, DropDownList).SelectedValue.ToEntero ' filtro = String.Format("CveClasificacion={0}", CveClasificacion) @@ -2085,7 +2085,7 @@ Partial Class OC_OC Dim Gvr As GridViewRow = CType(CType(sender, DropDownList).BindingContainer, GridViewRow) Dim filtro As String = "" - Dim Cvepsgvd = DirectCast(sender, DropDownList).SelectedValue.ToEntero + Dim Cvepsgvd As Integer = DirectCast(sender, DropDownList).SelectedValue.ToEntero If Cvepsgvd > 0 Then Dim CboUM As DropDownList = Gvr.FCDropDownList("CboUnidadMedidaEdit") Dim TxtPU As TextBox = Gvr.FCTextBox("TxtImporteEdit") @@ -5216,7 +5216,7 @@ Partial Class OC_OC UPEventoBitacora.Update() End Sub Private Function GuardaBitacoraTemporal(ObjEventoBitacora As ClsOIEventos) As Boolean - Dim Retorno = False + Dim Retorno As Boolean = False Dim Archivo As System.IO.FileInfo = Nothing For Each Dr As DataRow In DtBitacora.Rows @@ -5848,7 +5848,7 @@ Partial Class OC_OC 'CORREO MODIFICADA If EsNuevo = False And DtHistorial IsNot Nothing Then - Dim Bitacora = DtHistorial.FiltraParametros("CveConceptoHistorialBitacora <> 1").Rows.Count + Dim Bitacora As Integer = DtHistorial.FiltraParametros("CveConceptoHistorialBitacora <> 1").Rows.Count Dim ObjGral As New ClsGenerales If ObjGral.GetHistorialBitacora(-1, CveOrdenCompra, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then DtHistorial = ObjGral.DtResultados.FiltraParametros("CveConceptoHistorialBitacora <> 1") @@ -5862,7 +5862,7 @@ Partial Class OC_OC 'CORREO PROVEEDOR - SE GENERO OC If CveOCGeneradas.Count > 0 Then - For i = 0 To CveOCGeneradas.Count - 1 + For i As Integer = 0 To CveOCGeneradas.Count - 1 EnviarCorreoOrdenCompra(CveOCGeneradas(i)) Next @@ -6053,7 +6053,7 @@ Partial Class OC_OC Dim OCsGeneradas As New StringBuilder If FolioOCGeneradas.Count > 0 Then OCsGeneradas.Append("Se generaron la(s) siguiente(s) orden(es) de compra: ") - For Each FolioOC In FolioOCGeneradas + For Each FolioOC As Integer In FolioOCGeneradas OCsGeneradas.Append($" #{FolioOC} ") Next End If @@ -6507,7 +6507,7 @@ Partial Class OC_OC Dim dt As New DataTable dt = ReadExcelFile(Ruta + FileName, True) - Dim ErrorArchivo = False + Dim ErrorArchivo As Boolean = False 'Dim Conexion As Odbc.OdbcConnection = Nothing 'Try @@ -6640,7 +6640,7 @@ Partial Class OC_OC 'Agregar PS If DtDetalle IsNot Nothing Then Dim dr As DataRow = DtDetalle.NewRow - Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=CvePS).FiltroPrimero("") + Dim DrPS As DataRow = GlobalDTPS(CveEmpresaActual, CvePS:=CvePS).FiltroPrimero("") If DrPS Is Nothing Then Alert("Ocurrió un error al cargar la información de los productos del archivo. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia) Continue For @@ -6660,7 +6660,7 @@ Partial Class OC_OC Dim IEPSPSIVA As Decimal = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDecimal, 0) Dim CveClasificacion As Integer = DrPS("CveClasificacion").ToString.ToEntero Dim Clasificacion As String = DrPS("Clasificacion").ToString - Dim CveActivoFijo = HdnCveActivoFijo.Value.ToEntero + Dim CveActivoFijo As Integer = HdnCveActivoFijo.Value.ToEntero Dim IdCuentaPorEjercer As Integer = If(HdnCveCuentaPorEjercer.Value = String.Empty, -1, HdnCveCuentaPorEjercer.Value.ToEntero) Dim IdCuentaComprometido As Integer = If(HdnCveCuentaComprometido.Value = String.Empty, -1, HdnCveCuentaComprometido.Value.ToEntero) Dim CveOrdenCompraDetalle As Integer = DtDetalle.MAX("CveOrdenCompraDetalle").ToEntero + 100 @@ -6672,7 +6672,6 @@ Partial Class OC_OC End If Next - 'Cargo el GridView GvD.DataSource = DtDetalle GvD.DataBind() From 820f19607d093c62dfa07f9e5a1308798b73339f Mon Sep 17 00:00:00 2001 From: rakcsle Date: Mon, 18 Sep 2023 08:58:55 -0700 Subject: [PATCH 02/35] Compras actualizar partidas con cambios ne observaciones --- Compras/Compras.aspx.vb | 5 +++-- OC/OC.aspx | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index a8905c129..4e67162f6 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -8813,8 +8813,9 @@ Partial Class Compras_Compras (row1("CveActivoFijo").ToString.ToEntero <> row2("CveActivoFijo").ToString.ToEntero) Or (row1("AFMedida").ToString.ToEntero <> row2("AFMedida").ToString.ToEntero) Or (row1("TipoAF").ToString.ToEntero <> row2("TipoAF").ToString.ToEntero) Or - (row1("CvePS").ToString.ToEntero <> row2("CvePS").ToString.ToEntero Or - DdlTipoCompra.SelectedValue.ToEntero <> TipoCompraOriginal) Then + (row1("CvePS").ToString.ToEntero <> row2("CvePS").ToString.ToEntero) Or + (row1("Obs").ToString <> row2("Obs").ToString) Or + (DdlTipoCompra.SelectedValue.ToEntero <> TipoCompraOriginal) Then Return False End If End If diff --git a/OC/OC.aspx b/OC/OC.aspx index 99ea66ee2..863375582 100644 --- a/OC/OC.aspx +++ b/OC/OC.aspx @@ -1270,8 +1270,9 @@ - - + + From 1b1a6e9a65bae6184a1c22300b9da984bce32e2d Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 18 Sep 2023 09:02:31 -0700 Subject: [PATCH 03/35] -option explicit --- App_Code/ClsInventarios.vb | 10 ++--- App_Code/Modelos.vb | 84 +++++++++++++++++++------------------- App_Code/Timbrado.vb | 16 ++++---- 3 files changed, 55 insertions(+), 55 deletions(-) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 502282246..c31d7663f 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -1898,7 +1898,7 @@ Public Class ClsInventarios Return Retorno End Function Public Function RepNotasSinAlmacen(Opcion As Integer, CveClienteProveedor As Integer, FechaIni As Date, FechaFin As Date, TipoDocumento As String, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno = False + Dim Retorno As Boolean = False DataAdapter("PA_Inv_RepNotasSinAlmacen") With SqlAdapter.SelectCommand.Parameters @@ -2213,7 +2213,7 @@ Public Class ClsInventarios Return Retorno End Function Public Function GetExistenciasPSXML(XML As String, CveAlmacen As Integer, Fecha As String, CveSubProyecto As Integer, CveVendedor As Integer, CveCliente As Integer, ExcluyeApartados As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno = False + Dim Retorno As Boolean = False If Fecha = "-1" Then Fecha = String.Format("{0} 00:00", Now.AddDays(1).ToString("yyyy/MM/dd")) @@ -3440,7 +3440,7 @@ Public Class ClsInventarios End Function Public Function VentaDetallePadreGet(CveVentaDetallePadre As Integer) As Integer - Dim Retorno = -1 + Dim Retorno As Integer = -1 DataAdapter("PA_Inv_VentaDetallePadreGet") With SqlAdapter.SelectCommand.Parameters .Add("@CveVentaDetallePadre", SqlDbType.Int).Value = CveVentaDetallePadre @@ -3455,7 +3455,7 @@ Public Class ClsInventarios Return Retorno End Function - Public Function GetPendietePorSurtirVenta(CvePS As Integer, CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional CveUsuarioConsulta As Integer = -1, Optional Tipo As Integer = -1) As Boolean + Public Function GetPendientePorSurtirVenta(CvePS As Integer, CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional CveUsuarioConsulta As Integer = -1, Optional Tipo As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_VentasPendientesPorSurtirGet") @@ -4387,7 +4387,7 @@ Public Class ClsInventarios #Region " INVENTARIOS - SOLICITUD DE TRASPASOS " Public Function AddTrasladoSolicitud(Observaciones As String, CveAlmacenOrigen As Integer, CveAlmacenDestino As Integer, CveTrasladoEstatus As Integer, CveMovimientoAlmacen As Integer, Fecha As DateTime, CveUsuario As Integer, CveEmpresa As Integer, Optional CveContrato As Integer = -1, Optional Guia As String = "", Optional CvePaqueteria As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional CveOS As Integer = -1, Optional EstatusAlmacen As Integer = -1) As Integer - Dim Retorno = -1 + Dim Retorno As Integer = -1 DataAdapter("PA_Inv_TraspasoSolicitudAdd") With SqlAdapter.SelectCommand.Parameters diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index bf9510f6a..6e28e3d25 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -495,7 +495,7 @@ Namespace Modelos Timbre = New CFDITimbre End Sub Private Sub SetTotales(dtVentas As DataTable, ObjVentas As ClsVentas) - Dim TmpDTImpuestos = New DataTable + Dim TmpDTImpuestos As New DataTable TmpDTImpuestos.Columns.Add("ImpuestoLocal", GetType(String)) TmpDTImpuestos.Columns.Add("Importe", GetType(Double)) TmpDTImpuestos.Columns.Add("Orden", GetType(Integer)) @@ -530,7 +530,7 @@ Namespace Modelos Dim dtImpuesto As DataTable = ObjVentas.DtResultados If dtImpuesto.Rows.Count > 0 Then For Each Row As DataRow In dtImpuesto.Rows - Dim Orden = 80 + Dim Orden As Integer = 80 If Row("Importe").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = Row("ImpuestoLocal").ToString DR("Importe") = Row("Importe").ToString.ToDouble @@ -819,7 +819,7 @@ Namespace Modelos Dim ObjDocCliente As New ClsEdocumentacion(ObjVentas.IniciaTransacSQL()) Dim ObjGeneral As New ClsGenerales(ObjVentas.IniciaTransacSQL()) Dim ObjAcum As New ClsAcumuladores(ObjVentas.IniciaTransacSQL()) - Dim MensajeAlert = New StringBuilder + Dim MensajeAlert As New StringBuilder Try @@ -1031,7 +1031,7 @@ Namespace Modelos Dim SeTimbro As Boolean = False Dim SeTimbroNC As Boolean = False - Dim EstatusSMS = 0 + Dim EstatusSMS As Integer = 0 'TIMBRADO Y CASO ESPECIAL NOTA DE CREDITO If (TipoDoctoDevolucion = "" OrElse Not TipoDoctoDevolucion.Contiene("Rem", "Cot", "Ped", "DPe", "PA", "Pd2")) Then @@ -1054,7 +1054,7 @@ Namespace Modelos 'DOCUMENTO ACTUAL If DebeTimbrar Then If Me.EmitirCartaPorte AndAlso CveTimbreCartaPorte > 0 Then - Dim RespCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorte, UsuarioActual) + Dim RespCartaPorte As Timbres.MMensajeCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorte, UsuarioActual) If Not RespCartaPorte.TieneError Then Me.Timbre.Complementos.CartaPorte = RespCartaPorte.CartaPorte Else @@ -1129,7 +1129,7 @@ Namespace Modelos ' DESCARGA XML - SI SE TIMBRA MANDA CORREO CON FACTURA If SeTimbro Then - Dim ArchivoXML = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, Me.TipoDocto, Me.SerieFolio) + Dim ArchivoXML As String = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, Me.TipoDocto, Me.SerieFolio) If File.Exists(ArchivoXML) Then MensajeAlert.AppendFormat("", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", Me.SerieFolio, Me.TipoDocto))) End If @@ -1775,7 +1775,7 @@ Namespace Modelos tPS = tPS.Replace("|", " ") If tPS.Length >= 1000 Then - Dim tPSRecortado = tPS.Remove(999, tPS.Length - 999) + Dim tPSRecortado As String = tPS.Remove(999, tPS.Length - 999) tPS = tPSRecortado End If @@ -1840,14 +1840,14 @@ Namespace Modelos End Sub Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, Optional GetBytes As Boolean = True) As Byte() - Dim Url = New Uri(String.Format("http://{0}:{1}/Compras/PopUpVerFactura.aspx?P={2}", HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))) + Dim Url As New Uri(String.Format("http://{0}:{1}/Compras/PopUpVerFactura.aspx?P={2}", HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))) Dim File As Byte() = Nothing Try - Using httpClient = New HttpClient() + Using httpClient As New HttpClient() httpClient.Timeout = New TimeSpan(0, 15, 0) - Using request = New HttpRequestMessage(HttpMethod.Get, Url) + Using request As New HttpRequestMessage(HttpMethod.Get, Url) request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}", CveEmpresa, DateTime.UtcNow.Ticks))) - Dim response = httpClient.SendAsync(request).Result + Dim response As HttpResponseMessage = httpClient.SendAsync(request).Result If GetBytes AndAlso response.StatusCode = Net.HttpStatusCode.OK Then File = response.Content.ReadAsByteArrayAsync().Result End If @@ -2023,10 +2023,10 @@ Namespace Modelos End Sub Private Function EnviarSMSTimbrado(ByRef ObjEventos As ClsOIEventos) As Integer - Dim Mensaje = UsuarioActual.Empresa.Funcionalidad(152) + Dim Mensaje As String = UsuarioActual.Empresa.Funcionalidad(152) If Mensaje = "" Then Return 0 - Dim Celular = Me.Cliente.CobranzaTelefono + Dim Celular As String = Me.Cliente.CobranzaTelefono If Celular.Length <> 10 Then Return 3 'ARMA MENSAJE @@ -2315,7 +2315,7 @@ Namespace Modelos 'BONIFICACION USADOS If UsadosBonificacion IsNot Nothing AndAlso UsadosBonificacion.Count > 0 AndAlso TipoBonificacion > 0 Then - For Each CveMovto In UsadosBonificacion + For Each CveMovto As Integer In UsadosBonificacion If Not ObjAcum.DistribuidorActualizarFacturados(CveMovto, UsuarioActual.CveEmpresa, TipoBonificacion, CveVenta) Then ErrorList.Add("Ocurrió un error al actualizar el distribuidor.") End If @@ -2765,7 +2765,7 @@ Namespace Modelos End If - Dim Dr = DtVentasNC.NewRow + Dim Dr As DataRow = DtVentasNC.NewRow Dr("CveVenta") = pCveVenta Dr("Importe") = Importe Dr("FolioFiscal") = FolioFiscal @@ -2963,8 +2963,8 @@ Namespace Modelos If GenerarPrePoliza AndAlso CveMovimiento > 0 Then Dim Concepto As String = "Cancelación Usado" & factura.SerieFolio - Dim CvePrePoliza = ObjConta.AddPrePolizas("Mod/CancSalUsados", 74, DtMovimientosEntrada.SUMD("Total"), DtMovimientosEntrada.SUMD("Total"), 1, tFecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - Dim tCveSubProyecto = ClsPaginas.GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero + Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Mod/CancSalUsados", 74, DtMovimientosEntrada.SUMD("Total"), DtMovimientosEntrada.SUMD("Total"), 1, tFecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + Dim tCveSubProyecto As Integer = ClsPaginas.GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero Dim tCveConcepto As Integer = 278 Dim ValorInventario As Decimal = 0 Dim MovAlmacen As Boolean = False 'debe quedar como el anterior, pero negativo @@ -3647,7 +3647,7 @@ Namespace Modelos importeMovimiento = 0 Case 91 'Amortizacion Nota de Credito - Dim Contabilizable = If(UsuarioActual.CveEmpresa = 119, False, True) + Dim Contabilizable As Boolean = If(UsuarioActual.CveEmpresa = 119, False, True) If ValorMultiplicador = -1 Then Dim TipoCambioNC As Decimal = 1 @@ -3834,9 +3834,9 @@ Namespace Modelos Else If Not ObjFactura.TipoDocto.Contiene("Rem", "Ant", "Egs", "Dev", "RNC") Then - Dim ConceptoContableAplicar = 4 - Dim CveVentaAplicar = ObjFactura.CveVenta - Dim CveVentaAmortizacionAplicar = -1 + Dim ConceptoContableAplicar As Integer = 4 + Dim CveVentaAplicar As Integer = ObjFactura.CveVenta + Dim CveVentaAmortizacionAplicar As Integer = -1 If ObjFactura.TipoDocto.Contiene("Egs") And ObjFactura.TipoDocto = "Ant" And CveDevolucion > 0 And NuevaFactura = 1 Then ConceptoContableAplicar = 11 @@ -3871,9 +3871,9 @@ Namespace Modelos Case 150 'Descuento sobre ventas If ObjFactura.TipoDocto.Contiene("Egs", "Dev") AndAlso Not EsNCAmortizacion Then - Dim ConceptoContableAplicar = 150 - Dim CveVentaAplicar = ObjFactura.CveVenta - Dim CveVentaAmortizacionAplicar = -1 + Dim ConceptoContableAplicar As Integer = 150 + Dim CveVentaAplicar As Integer = ObjFactura.CveVenta + Dim CveVentaAmortizacionAplicar As Integer = -1 If ObjFactura.TipoDocto.Contiene("Egs") And ObjFactura.CveAnticipo > 0 Then ConceptoContableAplicar = 11 @@ -4547,9 +4547,9 @@ Namespace Modelos 'Agregamos los detalles For Each MovDet As DataRow In DtMovDetalle.Rows - Dim Cantidad = 0.0 - Dim CantidadRemision = DtRemisiones.FiltroPrimeroValor("Cantidad", $"CveVentaDetalleRemision={MovDet("CveVentaDetalle").ToString}").ToDouble - Dim CantidadInventario = MovDet("Cantidad").ToString.ToDecimal + Dim Cantidad As Decimal = 0 + Dim CantidadRemision As Decimal = DtRemisiones.FiltroPrimeroValor("Cantidad", $"CveVentaDetalleRemision={MovDet("CveVentaDetalle").ToString}").ToDecimal + Dim CantidadInventario As Decimal = MovDet("Cantidad").ToString.ToDecimal If RemisionesLista.Count > 0 AndAlso CantidadInventario >= CantidadRemision Then Cantidad = CantidadRemision @@ -4596,12 +4596,12 @@ Namespace Modelos If Not OcurrioError Then If MovimientoPrePoliza AndAlso CveMovimientoInventario > 0 Then If ObjInventario.GetMovimientosDetalle(CveMovimientoInventario, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then - Dim DtCostos = ObjInventario.DtResultados.Copy + Dim DtCostos As DataTable = ObjInventario.DtResultados.Copy Dim DtCostosDistinct As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"}) Dim ValorInventario As Decimal For Each RowInv As DataRow In DtCostosDistinct.Rows - ValorInventario = DtCostos.SUM("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).ToString.ToDecimal + ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))) Try If ValorInventario <> 0 Then If Not ObjConta.AddPrePolizasDetalle(Me.CvePrePoliza, False, ValorInventario, ValorInventario, 69, Me.SerieFolio, Me.SerieFolio, CveVenta:=CveVenta, CveCliente:=Me.CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoInventario, CveSubProyecto:=Me.CveSubProyecto) Then @@ -5309,7 +5309,7 @@ Namespace Modelos End If 'CUANDO SE CANCELA, Y TIENE RELACIONADA UNA REMISIÓN, Y ESTA NO SE CANCELARÁ. DEBE DE HACER EN AUTOMÁTICO LOS MOVIMIENTOS AL ALMACEN DE ENTREGA POR ADELANTADO - Dim RevivirRemisiones = Not EsRefacturacion AndAlso ((TieneRemisionesRelacionadas AndAlso ListaRemisionesCancelar Is Nothing) OrElse (DtRemisionesRelacionadas.Rows.Count > ListaRemisionesCancelar.Count)) + Dim RevivirRemisiones As Boolean = Not EsRefacturacion AndAlso ((TieneRemisionesRelacionadas AndAlso ListaRemisionesCancelar Is Nothing) OrElse (DtRemisionesRelacionadas.Rows.Count > ListaRemisionesCancelar.Count)) 'REMISION YA SE DEBE HACER POR EL PROCESO DE DEVOLUCION DE ALMACEN If Not EsRefacturacion AndAlso (ObjFactura.SaldoAlmacen <> 0 AndAlso ObjFactura.EsDevolucionVenta.Contiene(0, 1)) AndAlso Not RealizarDevolucionAlmacen And RevivirRemisiones = False Then @@ -5418,11 +5418,11 @@ Namespace Modelos 'VERIFICA EN EL SERVICIO SI SE CANCELO Try - Dim solicitud = New WSGF.Service1SoapClient() - Dim acuse = solicitud.GetAcuse(UsuarioActual.Empresa.RFC, "rene.molina@adsistemas.mx", "rene2018", FolioFiscal) + Dim solicitud As New WSGF.Service1SoapClient() + Dim acuse As WSGF.StructXml = solicitud.GetAcuse(UsuarioActual.Empresa.RFC, "rene.molina@adsistemas.mx", "rene2018", FolioFiscal) If acuse.Estado = 0 Then - Dim xmlAcuse = New System.Xml.XmlDocument() + Dim xmlAcuse As New System.Xml.XmlDocument() xmlAcuse.LoadXml(DecodeBase64(acuse.CfdiB64)) CancelacionAcuse = xmlAcuse.GetElementsByTagName("SignatureValue")(0).InnerText CancelacionFecha = xmlAcuse.SelectSingleNode("Acuse").Attributes("Fecha").Value.ToDate() @@ -5685,7 +5685,7 @@ Namespace Modelos 'CUANDO SE VAYA A REALIZAR LA DEVOLUCION AQUI DEBE MARCALA PARA NO SOLICITARLA DE NUEVO, SI NO LA SOLICITARA If ObjFactura.EsDevolucionVenta = 0 Then - Dim EstatusDevolucion = 1 + Dim EstatusDevolucion As Integer = 1 If Not ObjVentas.UpdateVentasDevolucionAlmacen(EstatusDevolucion, CveVenta) Then ErrorCancelar = True MensajeError = "Ocurrió un error al solicitar la devolución de almacen." @@ -5907,7 +5907,7 @@ Namespace Modelos 'AGREGA BITACORA A VENTA If Not ErrorCancelar AndAlso RealizarDevolucionAlmacen AndAlso CveMovimientoDevolucion > 0 Then - Dim MensajeBitacora = "Devuelta" + Dim MensajeBitacora As String = "Devuelta" If Not ObjEventos.AddEventoBitacora(String.Format("Venta {2} en Folio: {1}", CveMovimientoDevolucion, Folio, MensajeBitacora), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then MensajeError = "Ocurrió un error al agregar la bitacora." ErrorCancelar = True @@ -6316,7 +6316,7 @@ Namespace Modelos If SeCancelaRemisionProceso Then If Not ErrorCancelar Then - For Each CveRemisionCancelar In ListaRemisionesCancelar + For Each CveRemisionCancelar As Integer In ListaRemisionesCancelar If Not ObjVentas.AddRemisionesXCancelar(CveVenta, CveRemisionCancelar) Then ErrorCancelar = True MensajeError = "Ocurrió un error al guardar la remisión x cancelar." @@ -6332,7 +6332,7 @@ Namespace Modelos End If Else If Not ErrorCancelar Then - For Each CveRemisionCancelar In ListaRemisionesCancelar + For Each CveRemisionCancelar As Integer In ListaRemisionesCancelar If Not ObjVentas.UpdateEstatusFactura(12, "", "", CancelacionFecha, CveRemisionCancelar) Then ErrorCancelar = True MensajeError = "Ocurrió un error al guardar el estatus de cancelación de la remisión." @@ -7335,7 +7335,7 @@ Namespace Modelos Public ReadOnly Property FormaPagoText As String Get - Dim retorno = "" + Dim retorno As String = "" Select Case FormaPago Case 0 retorno = "PAGO EN UNA SOLA EXHIBICIÓN" @@ -7350,7 +7350,7 @@ Namespace Modelos Public ReadOnly Property CondicionesPagoText As String Get - Dim retorno = "" + Dim retorno As String = "" Select Case CondicionesPago Case 0 retorno = "contado" @@ -7793,7 +7793,7 @@ Namespace Modelos Public ReadOnly Property LugarExp As String Get - Dim arr = {Calle, NoExt, NoInt, Colonia, Localidad, Municipio, Estado, Pais, CP} + Dim arr As Array = {Calle, NoExt, NoInt, Colonia, Localidad, Municipio, Estado, Pais, CP} Return String.Join(",", arr) End Get End Property @@ -7862,7 +7862,7 @@ Namespace Modelos Public ReadOnly Property LugarExp As String Get - Dim arr = {Calle, NoExt, NoInt, Colonia, Localidad, Municipio, Estado, Pais, CP, SubProyecto} + Dim arr As Array = {Calle, NoExt, NoInt, Colonia, Localidad, Municipio, Estado, Pais, CP, SubProyecto} Return String.Join(",", arr) End Get End Property @@ -8036,7 +8036,7 @@ Namespace Modelos Public ReadOnly Property LugarExp As String Get - Dim arr = {EnvioDireccion, EnvioColonia, EnvioCiudad, EnvioEstado, EnvioCP, EnvioTel} + Dim arr As Array = {EnvioDireccion, EnvioColonia, EnvioCiudad, EnvioEstado, EnvioCP, EnvioTel} Return String.Join(",", arr) End Get End Property diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index 65fcf95b2..c99190c6a 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -851,7 +851,7 @@ Public Class Timbrado Private Function EnviarInformacionCancelacionPADESOAP(ByVal url As String, UsuarioServicio As String, PassServicio As String, contrato As String, rfcEmisor As String, rfcReceptor As String, certBase64 As String, keyBase64 As String, keyPass As String, arregloUUID As String, Total As Decimal, TimbraProduccion As Boolean, Optional MotivoCancelacion As String = "", Optional FolioSustitucion As String = "") As String - Dim retorno = "" + Dim retorno As String = "" Try Dim request As HttpWebRequest = CType(WebRequest.Create($"{url}"), HttpWebRequest) @@ -895,7 +895,7 @@ Public Class Timbrado End Using If Not String.IsNullOrEmpty(response) Then - Dim xmlRetorno = New XmlDocument() + Dim xmlRetorno As New XmlDocument() xmlRetorno.LoadXml(response) Dim elemList As XmlNodeList = xmlRetorno.GetElementsByTagName("return") @@ -1270,13 +1270,13 @@ Public Class Timbrado Private Function EnviarInformacionPADE(url As String, payload As String, tokenAuth As String) As String Dim Retorno As String = "" Try - Using httpClient = New HttpClient() + Using httpClient As New HttpClient() httpClient.Timeout = New TimeSpan(0, 1, 0) - Using request = New HttpRequestMessage(HttpMethod.Post, New Uri(url)) + Using request As New HttpRequestMessage(HttpMethod.Post, New Uri(url)) request.Headers.Add("Authorization", $"Basic {tokenAuth}") - Using content = New StringContent(payload, Encoding.UTF8, "application/json") + Using content As New StringContent(payload, Encoding.UTF8, "application/json") request.Content = content - Dim response = httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).Result + Dim response As HttpResponseMessage = httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).Result Retorno = response.Content.ReadAsStringAsync().Result End Using @@ -1569,7 +1569,7 @@ Public Class Timbrado Dim w As Integer = 0 - For Each Ret In ObjCFDITimbre.Retenciones + For Each Ret As CFDIRetenciones In ObjCFDITimbre.Retenciones comprobante.Impuestos.Retenciones(w) = New Profact.TimbraCFDI40.ComprobanteImpuestosRetencion() comprobante.Impuestos.Retenciones(w).Impuesto = Ret.Impuesto comprobante.Impuestos.Retenciones(w).Importe = Ret.Importe @@ -1624,7 +1624,7 @@ Public Class Timbrado If ObjCFDITimbre.Complementos.ComercioExterior11 IsNot Nothing Then 'DATOS GENERALES - Dim ComExt = New Profact.TimbraCFDI33.Complementos.ComercioExterior11.ComercioExterior() + Dim ComExt As New Profact.TimbraCFDI33.Complementos.ComercioExterior11.ComercioExterior() ComExt.Version = "1.1" ComExt.MotivoTrasladoSpecified = True ComExt.MotivoTraslado = ObjCFDITimbre.Complementos.ComercioExterior11.MotivoTraslado From a66043a7ba18482c123f3e426141818329a5772f Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 18 Sep 2023 09:02:58 -0700 Subject: [PATCH 04/35] =?UTF-8?q?--=20IVA=20Acreditable=20de=20importaci?= =?UTF-8?q?=C3=B3n,=20--=20Acumulados=20de=20IVA=20Acreditable=20importaci?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Contabilidad/RepIVA.aspx | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Contabilidad/RepIVA.aspx b/Contabilidad/RepIVA.aspx index 030dbd568..9277a203e 100644 --- a/Contabilidad/RepIVA.aspx +++ b/Contabilidad/RepIVA.aspx @@ -186,11 +186,10 @@

IVA por Porcentaje

- + - @@ -253,29 +252,27 @@ <%----%> <%----%> <%-- --%> - - - RetIVA
Hon/Ser.Prof.
+ Ret IVA
Hon/Ser.Prof.
- - - - + + + + - - - + + + - + <%-- @@ -313,6 +310,7 @@ + From 98017286c9a1785f12fcbebbc3cf4a78cf707917 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 18 Sep 2023 09:04:21 -0700 Subject: [PATCH 05/35] -- option explicit --- Compras/PopUpVerFactura.aspx.vb | 165 +++++++++++++----------------- Compras/Proveedores.aspx.vb | 44 ++++---- Ventas/ProductosServicios.aspx.vb | 8 +- 3 files changed, 98 insertions(+), 119 deletions(-) diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 0ec2f8250..51bfb7927 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -96,7 +96,7 @@ Partial Class PopUpVerFactura Dim CveEmpresaToken As Integer = UserParams("CVEEMPRESA").ToString().ToEntero() Dim CveUsuario As Integer = IfNull(UserParams("CVEUSUARIO"), 100, UserParams("CVEUSUARIO").ToString().ToEntero()).ToString().ToEntero() - Dim UsuarioToken = ValidaUsuarioSistema(CveEmpresaToken, CveUsuario) + Dim UsuarioToken As Usuario = ValidaUsuarioSistema(CveEmpresaToken, CveUsuario) If UsuarioToken IsNot Nothing AndAlso Context.Session("UsuarioSIG") Is Nothing Then Context.Session("UsuarioSIG") = UsuarioToken @@ -319,7 +319,7 @@ Partial Class PopUpVerFactura cvePersonal = Request("cvePersonal").ToString.ToEntero() End If Dim RFCs As New StringBuilder - Dim contador = 0 + Dim contador As Integer = 0 Using objnom As New ClsNominas If objnom.PreNominaTotalSemana(numeroPeriodo, UsuarioActual.CveEmpresa, cveSubProyecto, cveTipoNomina, tipoTrabajador, ejercicio, facturado) Then For Each item As DataRow In objnom.DtResultados.Select("CvePersonal > 0") @@ -384,7 +384,7 @@ Partial Class PopUpVerFactura lrds.Add(rds2) '"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc" - Dim rutardlc = "Formatos\RepAgroInventarioDiario.rdlc" + Dim rutardlc As String = "Formatos\RepAgroInventarioDiario.rdlc" If EnviarCorrreo Then Dim para As String = "caudillo.90d@gmail.com" Dim dtCorreos As DataTable = New DataTable() @@ -537,7 +537,7 @@ Partial Class PopUpVerFactura lrds.Add(rds) '"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc" - Dim rutardlc = "Formatos\Agro\EmbarqueManifiesto.rdlc" + Dim rutardlc As String = "Formatos\Agro\EmbarqueManifiesto.rdlc" If Not IsNothing(tablaReporte.FiltroPrimero("TipoManifiesto=1")) Then rutardlc = "Formatos\Agro\EmbarqueManifiesto2.rdlc" End If @@ -847,7 +847,7 @@ Partial Class PopUpVerFactura lrds.Add(rds) '"Empresas/Grales/Formatos/EquiposGPS.rdlc" '"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc" - Dim pdf = StreamPDF("Formatos\Agro\EmbarqueManifiestoCartaPorte.rdlc", lrds, params, "DatosCartaPorte") + Dim pdf As Byte() = StreamPDF("Formatos\Agro\EmbarqueManifiestoCartaPorte.rdlc", lrds, params, "DatosCartaPorte") Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail) LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = pdf, .NombreArchivo = String.Format("{0}.pdf", "DatosCartaPorte")}) @@ -913,9 +913,9 @@ Partial Class PopUpVerFactura Dim bcode As New BarcodeLib.Barcode() - Dim img = bcode.Encode(BarcodeLib.TYPE.CODE128, String.Format("{0}", noPallet), 500, 100) + Dim img As Drawing.Image = bcode.Encode(BarcodeLib.TYPE.CODE128, String.Format("{0}", noPallet), 500, 100) Dim barcodebyte As Byte() - Using ms = New MemoryStream() + Using ms As New MemoryStream() img.Save(ms, System.Drawing.Imaging.ImageFormat.Png) barcodebyte = ms.ToArray() End Using @@ -1021,9 +1021,9 @@ Partial Class PopUpVerFactura Dim bcode As New BarcodeLib.Barcode() - Dim img = bcode.Encode(BarcodeLib.TYPE.CODE128, String.Format("{0}", GTIN), 500, 200) + Dim img As Drawing.Image = bcode.Encode(BarcodeLib.TYPE.CODE128, String.Format("{0}", GTIN), 500, 200) Dim barcodebyte As Byte() - Using ms = New MemoryStream() + Using ms As New MemoryStream() img.Save(ms, System.Drawing.Imaging.ImageFormat.Png) barcodebyte = ms.ToArray() End Using @@ -1035,14 +1035,12 @@ Partial Class PopUpVerFactura rds2.Value = dtqr lrds.Add(rds2) 'endimg - - Dim dtqr2 As DataTable = dtqr.Clone() Dim bcode2 As New BarcodeLib.Barcode() - Dim img2 = bcode2.Encode(BarcodeLib.TYPE.CODE128, String.Format("{0}", GTINAll.Replace("(", "").Replace(")", "")), 900, 100) + Dim img2 As Drawing.Image = bcode2.Encode(BarcodeLib.TYPE.CODE128, String.Format("{0}", GTINAll.Replace("(", "").Replace(")", "")), 900, 100) Dim barcodebyte2 As Byte() - Using ms = New MemoryStream() + Using ms As New MemoryStream() img2.Save(ms, System.Drawing.Imaging.ImageFormat.Png) barcodebyte2 = ms.ToArray() End Using @@ -1052,8 +1050,6 @@ Partial Class PopUpVerFactura Dim rds22 As New ReportDataSource With {.Name = "dsImagenesGTIN", .Value = dtqr2} lrds.Add(rds22) - - Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = tablaReporte} lrds.Add(rds) @@ -1137,9 +1133,9 @@ Partial Class PopUpVerFactura Dim bcode As New BarcodeLib.Barcode() - Dim img = bcode.Encode(BarcodeLib.TYPE.CODE128, String.Format("{0}", noPallet), 500, 100) + Dim img As Drawing.Image = bcode.Encode(BarcodeLib.TYPE.CODE128, String.Format("{0}", noPallet), 500, 100) Dim barcodebyte As Byte() - Using ms = New MemoryStream() + Using ms As New MemoryStream() img.Save(ms, System.Drawing.Imaging.ImageFormat.Png) barcodebyte = ms.ToArray() End Using @@ -1171,8 +1167,8 @@ Partial Class PopUpVerFactura Dim ObjUsuarios As New ClsSisUsuarios If ObjUsuarios.GetUsuarios(CveUsuario) Then If ObjUsuarios.DtResultados.Rows.Count > 0 Then - Dim Usuario = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString() - Dim Contrasenia = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString() + Dim Usuario As String = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString() + Dim Contrasenia As String = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString() UsuarioToken = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, IMEI, CveEmpresa) UsuarioToken.CveEmpresa = CveEmpresa CreaObjetoEmpresa(UsuarioToken) @@ -1557,10 +1553,9 @@ Partial Class PopUpVerFactura Dim ObjPuntoVenta As New ClsPuntoVenta Dim DtCortesVentasResumen As DataTable = Nothing Dim DtCortesVentas As DataTable = Nothing - Dim Fecha = "", Nombre = "" + Dim Fecha As String = "", Nombre As String = "" If ObjVenta.GetCortesDetalleVentasResumen(CveCorte, CveSubProyecto, UsuarioActual.CveEmpresa) Then DtCortesVentasResumen = ObjVenta.DtResultados - End If If ObjPuntoVenta.GetCortesDetalleVentas(CveCorte, CveSubProyecto, UsuarioActual.CveEmpresa) Then @@ -1967,7 +1962,7 @@ Partial Class PopUpVerFactura XmlDoc.Load(PathXML) Dim nodo As XmlNode = XmlDoc.DocumentElement - Dim Version = ValorXML(nodo, "version") + Dim Version As String = ValorXML(nodo, "version") Dim namespaces As New XmlNamespaceManager(XmlDoc.NameTable) Dim Prefijo As String = If(XmlDoc.DocumentElement.Prefix = "", "cfd", XmlDoc.DocumentElement.Prefix) @@ -2122,7 +2117,7 @@ Partial Class PopUpVerFactura End Function Private Sub ImprimeFormatoCartaPorteTimbrado(CveTimbre As Integer) - Dim resp = PreParaImpresionCartaPorte(CveTimbre) + Dim resp As Modelos.MSubReportData = PreParaImpresionCartaPorte(CveTimbre) If resp.DataSources.Count > 0 AndAlso resp.Parametros.Count > 0 Then ImprimirPDF("Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc", resp.DataSources, resp.Parametros, resp.SerieFolio) End If @@ -2260,7 +2255,7 @@ Partial Class PopUpVerFactura XMLDoc.Load(Path) Catch ex As Exception Try - Dim oReader = New StreamReader(Path, Encoding.GetEncoding("ISO-8859-1")) + Dim oReader As New StreamReader(Path, Encoding.GetEncoding("ISO-8859-1")) XMLDoc.Load(oReader) oReader.Dispose() Catch ex2 As Exception @@ -2277,7 +2272,7 @@ Partial Class PopUpVerFactura Dim Prefijo As String = If(XMLDoc.DocumentElement.Prefix = "", "cfd", XMLDoc.DocumentElement.Prefix) Dim cfdVer As String = "http://www.sat.gob.mx/cfd/3" Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable) - Dim Version = ValorXML(XMLDoc.DocumentElement, "version") + Dim Version As String = ValorXML(XMLDoc.DocumentElement, "version") If Version = "3.3" Then cfdVer = "http://www.sat.gob.mx/cfd/3" Else ' se considera que es la version 4.0 @@ -2304,7 +2299,7 @@ Partial Class PopUpVerFactura If nodeCliente IsNot Nothing Then ClienteRFC = ValorXML(nodeCliente, "RFC") ClienteNombre = ValorXML(nodeCliente, "Nombre") - Dim UsoCFDI = ValorXML(nodeCliente, "UsoCFDI") + Dim UsoCFDI As String = ValorXML(nodeCliente, "UsoCFDI") ClienteUsoCFDi = String.Format("{0} - {1}", UsoCFDI, GlobalDTSATUsosCFDI().FiltroPrimeroValor("Descripcion", String.Format("UsoCFDI = '{0}'", UsoCFDI))) End If @@ -2391,9 +2386,9 @@ Partial Class PopUpVerFactura Dim nodeMercanciaPadre As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:Mercancias", "cartaporte20"), namespaces) If UsuarioActual.CveEmpresa = 13 AndAlso nodeMercanciaPadre IsNot Nothing Then - Dim PesoNetoTotal = ValorXML(nodeMercanciaPadre(0), "PesoNetoTotal", "") - Dim UnidadPeso = ValorXML(nodeMercanciaPadre(0), "UnidadPeso", "") - Dim NumTotalMercancias = ValorXML(nodeMercanciaPadre(0), "NumTotalMercancias", "") + Dim PesoNetoTotal As String = ValorXML(nodeMercanciaPadre(0), "PesoNetoTotal", "") + Dim UnidadPeso As String = ValorXML(nodeMercanciaPadre(0), "UnidadPeso", "") + Dim NumTotalMercancias As String = ValorXML(nodeMercanciaPadre(0), "NumTotalMercancias", "") params.Add(New ReportParameter("PesoNetoTotal", PesoNetoTotal)) params.Add(New ReportParameter("UnidadPeso", UnidadPeso)) @@ -2423,14 +2418,14 @@ Partial Class PopUpVerFactura Row("RFC") = ValorXML(node, "RFCRemitenteDestinatario", "") Row("Nombre") = ValorXML(node, "NombreRemitenteDestinatario", "") - Dim nodeDomicilio = node.ChildNodes.Cast(Of XmlNode).FirstOrDefault(Function(x) x.Name = "cartaporte20:Domicilio") 'node.SelectSingleNode(String.Format("//{0}:Domicilio", "cartaporte"), namespaces) + Dim nodeDomicilio As XmlNode = node.ChildNodes.Cast(Of XmlNode).FirstOrDefault(Function(x) x.Name = "cartaporte20:Domicilio") 'node.SelectSingleNode(String.Format("//{0}:Domicilio", "cartaporte"), namespaces) If nodeDomicilio IsNot Nothing Then Dim Estado As String = "" Dim Municipio As String = "" Dim Colonia As String = "" - Dim calle = ValorXML(nodeDomicilio, "Calle", "") - Dim CP = ValorXML(nodeDomicilio, "CodigoPostal", "") + Dim calle As String = ValorXML(nodeDomicilio, "Calle", "") + Dim CP As String = ValorXML(nodeDomicilio, "CodigoPostal", "") Dim dr As DataRow = GlobalDTGralColonias(ValorXML(nodeDomicilio, "Estado", ""), ValorXML(nodeDomicilio, "Municipio", ""), ValorXML(nodeDomicilio, "Colonia", "")).FiltroPrimero("") If dr IsNot Nothing Then @@ -2449,7 +2444,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("DistanciaTotal", DistanciaTotal.ToString())) End If - Dim nodeRelacion = XMLDoc.SelectSingleNode(String.Format("//{0}:CfdiRelacionados", Prefijo), namespaces) + Dim nodeRelacion As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:CfdiRelacionados", Prefijo), namespaces) If nodeRelacion IsNot Nothing Then Dim RelacionCodigo As String = ValorXML(nodeRelacion, "TipoRelacion") @@ -2474,17 +2469,16 @@ Partial Class PopUpVerFactura Relacion = "08 - Factura generada por pagos en parcialidades" Case "09" Relacion = "09 - Factura generada por pagos diferidos" - End Select - Dim nodoDocumentosRealcionados = XMLDoc.SelectNodes(String.Format("//{0}:CfdiRelacionados", Prefijo), namespaces) - For Each node As XmlNode In nodoDocumentosRealcionados + Dim nodoDocumentosRelacionados As XmlNodeList = XMLDoc.SelectNodes(String.Format("//{0}:CfdiRelacionados", Prefijo), namespaces) + For Each node As XmlNode In nodoDocumentosRelacionados Dim nRow As DataRow = DTRelacionados.NewRow nRow("Relacion") = Relacion Try - Dim nodoUUID = node.ChildNodes.Cast(Of XmlNode).FirstOrDefault(Function(x) x.Name = "cfdi:CfdiRelacionado") + Dim nodoUUID As XmlNode = node.ChildNodes.Cast(Of XmlNode).FirstOrDefault(Function(x) x.Name = "cfdi:CfdiRelacionado") nRow("UUID") = ValorXML(nodoUUID, "UUID", "") Catch ex As Exception nRow("UUID") = "" @@ -2724,7 +2718,7 @@ Partial Class PopUpVerFactura End Using If Folio > 0 AndAlso DtDetalle IsNot Nothing AndAlso DtDetalle.Rows.Count > 0 Then - Dim ObjFactura = New Modelos.Factura + Dim ObjFactura As New Modelos.Factura ObjFactura.Version = "3.3" ObjFactura.CveUsuario = UsuarioActual.CveUsuario ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa @@ -2934,12 +2928,12 @@ Partial Class PopUpVerFactura Dim PathArchivo As String = "" 'String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio) - Dim TmpDTImpuestos = New DataTable + Dim TmpDTImpuestos As New DataTable TmpDTImpuestos.Columns.Add("ImpuestoLocal", GetType(String)) TmpDTImpuestos.Columns.Add("Importe", GetType(Double)) TmpDTImpuestos.Columns.Add("Orden", GetType(Integer)) - Dim TmpDTImpuestosIVAIEPS = New DataTable + Dim TmpDTImpuestosIVAIEPS As New DataTable TmpDTImpuestosIVAIEPS.Columns.Add("Impuesto", GetType(String)) TmpDTImpuestosIVAIEPS.Columns.Add("tasa", GetType(String)) TmpDTImpuestosIVAIEPS.Columns.Add("Importe", GetType(Double)) @@ -2962,7 +2956,7 @@ Partial Class PopUpVerFactura 'Vta.Subproyecto = ObjVentas.DtResultados.Rows(0).DataRowToObject(Of Modelos.SucursalModel) Dim CveSubProyecto As Integer = dtVentas(0)("CveSubProyecto").ToString().ToEntero() - Dim DtSubProyecto = GlobalDTSubProyectos(-1, CveSubProyecto:=CveSubProyecto, CveEmpresa:=dtVentas(0)("CveEmpresa").ToString().ToEntero()) + Dim DtSubProyecto As DataTable = GlobalDTSubProyectos(-1, CveSubProyecto:=CveSubProyecto, CveEmpresa:=dtVentas(0)("CveEmpresa").ToString().ToEntero()) Vta.SubProyecto = DtSubProyecto.Rows(0).DataRowToObject(Of Modelos.SubProyectoModel) 'Vta.SubProyecto = ObjVentas.DtResultados.Rows(0).DataRowToObject(Of Modelos.SubProyectoModel) @@ -3076,7 +3070,7 @@ Partial Class PopUpVerFactura Dim dtImpuesto As DataTable = ObjVentas.DtResultados If dtImpuesto.Rows.Count > 0 Then For Each Row As DataRow In dtImpuesto.Rows - Dim Orden = 80 + Dim Orden As Integer = 80 If Row("Importe").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = Row("ImpuestoLocal").ToString DR("Importe") = Row("Importe").ToString.ToDouble @@ -3340,15 +3334,11 @@ Partial Class PopUpVerFactura Optional EsTransitorio As Boolean = False, Optional CveAlmacenRecepcion As Integer = -1, Optional CveAlmacenTransitorioRecepcion As Integer = -1, Optional FolioBusquedaTrasitorio As Integer = -1) Dim ObjInventarios As New ClsInventarios - - - - ObjInventarios.GetMovimientos(CveMovimiento, -1, -1, UsuarioActual.CveEmpresa) Dim CveConcepto As Integer = ObjInventarios.CveConcepto Dim Folio As String = ObjInventarios.Folio.ToString - Dim CveCompra = ObjInventarios.CveCompra + Dim CveCompra As Integer = ObjInventarios.CveCompra Dim Fecha As String = ObjInventarios.Fecha.ToShortDateString Dim FechaHora As DateTime = ObjInventarios.FechaHora Dim Almacen As String = ObjInventarios.Almacen @@ -3439,8 +3429,6 @@ Partial Class PopUpVerFactura End If End If - - Dim CantidadProductos As Decimal = 0 Dim CantidadUsados As Decimal = 0 @@ -3531,12 +3519,7 @@ Partial Class PopUpVerFactura keys(0) = DtMovimientos.Columns("No") DtMovimientos.PrimaryKey = keys End If - End If - - - - End If If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CveCompra > 0 Then @@ -4282,8 +4265,8 @@ Partial Class PopUpVerFactura Dim SBDireccionD As New StringBuilder() Dim CveCliente As Integer = 0 Dim CveDireccionEnvio As Integer = 0 - Dim ClienteNombre = "", EnvioContacto = "", EnvioDireccion = "", EnvioColonia = "", EnvioCiudad = "", EnvioEstado = "", ClientePais = "", EnvioCP = "", Contrato = "", - Paqueteria = "", NumContrato = "", Guia = "" + Dim ClienteNombre As String = "", EnvioContacto As String = "", EnvioDireccion As String = "", EnvioColonia As String = "", EnvioCiudad As String = "", EnvioEstado As String = "", ClientePais As String = "", EnvioCP As String = "", Contrato As String = "", + Paqueteria As String = "", NumContrato As String = "", Guia As String = "" Dim CveContrato As Integer = 0 If DtMovimientos IsNot Nothing AndAlso DtMovimientos.Rows.Count > 0 Then @@ -5449,7 +5432,7 @@ Partial Class PopUpVerFactura Private Sub GenerarPDFOS(CveOS As Integer) Dim ObjOS As New ClsOS() Dim params As New List(Of ReportParameter) - Dim CveFolio = "" + Dim CveFolio As String = "" CreaDT() Dim FIRutaReporte As New System.IO.FileInfo(String.Format("{0}Formatos/OrdenServicio.rdlc", UsuarioActual.Empresa.Ruta)) @@ -5716,7 +5699,7 @@ Partial Class PopUpVerFactura If UsuarioActual.CveEmpresa.Contiene(72) Then Dim SBDomicilioSucursal As New StringBuilder() - Dim DRSucursal = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa, CveSubProyecto:=dr("CveSubProyecto").ToString.ToEntero, Estatus:=1).FiltroPrimero("") + Dim DRSucursal As DataRow = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa, CveSubProyecto:=dr("CveSubProyecto").ToString.ToEntero, Estatus:=1).FiltroPrimero("") If DRSucursal IsNot Nothing Then Dim CiudadSucursal As String = String.Format("{0},{1}", DRSucursal("Municipio"), DRSucursal("Estado")) @@ -5866,21 +5849,21 @@ Partial Class PopUpVerFactura ObjVentas.Dispose() If drv IsNot Nothing Then - Dim Total = drv("Total").ToString().ToDecimal() - Dim CveEstatusFactura = drv("CveEstatusFactura").ToString().ToEntero() - Dim FolioFiscal = drv("FolioFiscal").ToString() - Dim RFCReceptor = drv("RFCReceptor").ToString() - Dim SelloCancelacion = drv("SelloCancelacion").ToString() - Dim SelloSolicitudCancelacion = drv("SelloSolicitudCancelacion").ToString() - Dim EstadoCancelacion = drv("EstadoCancelacion").ToString() - Dim FechaCancelacion = drv("FechaCancelacion").ToString.ToDateTime + Dim Total As Decimal = drv("Total").ToString().ToDecimal() + Dim CveEstatusFactura As Integer = drv("CveEstatusFactura").ToString().ToEntero() + Dim FolioFiscal As String = drv("FolioFiscal").ToString() + Dim RFCReceptor As String = drv("RFCReceptor").ToString() + Dim SelloCancelacion As String = drv("SelloCancelacion").ToString() + Dim SelloSolicitudCancelacion As String = drv("SelloSolicitudCancelacion").ToString() + Dim EstadoCancelacion As String = drv("EstadoCancelacion").ToString() + Dim FechaCancelacion As DateTime = drv("FechaCancelacion").ToString.ToDateTime Dim MotivoCancelacion As String = "" Dim FolioSustitucion As String = "" Dim DirectorioArchivo As String = "Empresas/Grales/Formatos/AcuseCancelacion.mrt" - Dim RFCEmisor = UsuarioActual.Empresa.RFC + Dim RFCEmisor As String = UsuarioActual.Empresa.RFC Dim Titulo As String = "Acuse de cancelación de CFDI" Dim EstadoCFDI As String = "Cancelado" @@ -5906,9 +5889,9 @@ Partial Class PopUpVerFactura Using ObjV As New ClsVentas If ObjV.GetVentasPendientesCancelacion(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, CveVenta:=CveVenta) Then - Dim RowCancelacion = ObjV.DtResultados.FiltroPrimero("") + Dim RowCancelacion As DataRow = ObjV.DtResultados.FiltroPrimero("") If RowCancelacion IsNot Nothing Then - Dim CveMotivoCancelacion = RowCancelacion("CveMotivoCancelacion").ToString().ToEntero() + Dim CveMotivoCancelacion As Integer = RowCancelacion("CveMotivoCancelacion").ToString().ToEntero() FolioSustitucion = RowCancelacion("FolioFiscalSustitucion").ToString() If CveMotivoCancelacion > 0 Then @@ -5954,7 +5937,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("MsgError", "")) params.Add(New ReportParameter("FechaCancelacion", FechaCancelacion.ToString("dd/MM/yyyy HH:mm:ss"))) - Dim DtAcuse = New DataTable("DtAcuse") + Dim DtAcuse As New DataTable("DtAcuse") DtAcuse.Columns.Add(New DataColumn("FolioFiscal", GetType(String))) DtAcuse.Columns.Add(New DataColumn("Estatus", GetType(String))) DtAcuse.Columns.Add(New DataColumn("MotivoCancelacion", GetType(String))) @@ -5962,7 +5945,7 @@ Partial Class PopUpVerFactura If CveEstatusFactura = 20 Then - Dim RowCFDI = DtAcuse.NewRow() + Dim RowCFDI As DataRow = DtAcuse.NewRow() RowCFDI("FolioFiscal") = FolioFiscal RowCFDI("Estatus") = "Solicitud de cancelación recibida" @@ -6018,7 +6001,7 @@ Partial Class PopUpVerFactura #Region "I E C H E Q U E S" Private Sub ImprimirIE(CveIE As Integer, CveEmpresa As Integer) - Dim CveTipoTransaccion = -1 + Dim CveTipoTransaccion As Integer = -1 Dim ObjIE As New ClsBancos() ObjIE.GetBancosIE(CveIE, UsuarioActual.CveEmpresa) If ObjIE.DtResultados.Rows.Count > 0 Then @@ -6027,13 +6010,13 @@ Partial Class PopUpVerFactura Dim params As New List(Of ReportParameter) If CveTipoTransaccion = 1 Then - Dim Folio = ObjIE.Folio - Dim Importe = ObjIE.Importe - Dim Observacion = ObjIE.Observaciones - Dim ImporteLetra = String.Format("--- {0} ---", Importe.Texto2Letras(ObjIE.CveMoneda)) - Dim Beneficiario = ObjIE.PagueseA - Dim Fecha = ObjIE.FechaDocumento.ToShortDateString - Dim CveCuenta = ObjIE.CveCuenta + Dim Folio As String = ObjIE.Folio + Dim Importe As Double = ObjIE.Importe + Dim Observacion As String = ObjIE.Observaciones + Dim ImporteLetra As String = String.Format("--- {0} ---", Importe.Texto2Letras(ObjIE.CveMoneda)) + Dim Beneficiario As String = ObjIE.PagueseA + Dim Fecha As String = ObjIE.FechaDocumento.ToShortDateString + Dim CveCuenta As Integer = ObjIE.CveCuenta params.Add(New ReportParameter("Fecha", Fecha)) params.Add(New ReportParameter("Folio", Folio)) params.Add(New ReportParameter("Beneficiario", Beneficiario)) @@ -6042,11 +6025,8 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Observaciones", Observacion)) params.Add(New ReportParameter("Tipo", If(ObjIE.EsAbonoEnCuenta, "PARA ABONO EN CUENTA DEL BENEFICIARIO", ""))) - If UsuarioActual.CveEmpresa.Contiene(141) Then - Dim InicialesUsuarioGenero As String = "" - Try Dim NombreUsuarioRenero As String = GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("Nombre", $"CveUsuario ={ObjIE.CveUsuario}") If NombreUsuarioRenero.Trim.Length > 0 Then @@ -6055,7 +6035,6 @@ Partial Class PopUpVerFactura Catch ex As Exception End Try - params.Add(New ReportParameter("InicialesUsuarioGenero", InicialesUsuarioGenero)) End If @@ -6080,7 +6059,7 @@ Partial Class PopUpVerFactura DtMovimientosPoliza.Columns.Add("Cargo", GetType(Double)) DtMovimientosPoliza.Columns.Add("Abono", GetType(Double)) - Dim Dr = DtMovimientosPoliza.NewRow + Dim Dr As DataRow = DtMovimientosPoliza.NewRow Dr("CODIGO") = "" Dr("Cuenta") = "" Dr("Cargo") = 0 @@ -6099,7 +6078,7 @@ Partial Class PopUpVerFactura If ObjIE.DtResultados.Rows.Count > 0 Then For Each drt As DataRow In ObjIE.DtResultados.Rows - Dim Dr = DtMovimientosPoliza.NewRow + Dim Dr As DataRow = DtMovimientosPoliza.NewRow Dr("CODIGO") = drt("CuentaCodigo") Dr("Cuenta") = drt("CuentaNombre") Dr("Cargo") = If(drt("TipoMovto").ToString = "False", drt("ImporteMN"), "0") @@ -6387,7 +6366,7 @@ Partial Class PopUpVerFactura End If - Dim rds = New ReportDataSource("DataSet1", dtMovs) + Dim rds As New ReportDataSource("DataSet1", dtMovs) reportDataSetsList.Add(rds) Dim dtnc As New DataTable @@ -6396,7 +6375,7 @@ Partial Class PopUpVerFactura dtnc = ObjCompra.DtResultados End If ObjCompra.Dispose() - Dim rds2 = New ReportDataSource("DataSet2", dtnc) + Dim rds2 As New ReportDataSource("DataSet2", dtnc) reportDataSetsList.Add(rds2) dtnc.Dispose() @@ -6536,7 +6515,7 @@ Partial Class PopUpVerFactura Dim FechaCaducidad As Date = DetalleRow.Item("FechaCaducidad").ToString.ToDate PS = String.Format("{0} - {1}", DetalleRow.Item("Codigo").ToString, DetalleRow.Item("PS").ToString) If Modalidad = "Individual" Then - Dim reporteByte = New MemoryStream(GenerarEtiqueta(CvePS, Lote, FechaCaducidad, PS)) + Dim reporteByte As New MemoryStream(GenerarEtiqueta(CvePS, Lote, FechaCaducidad, PS)) Dim docEtiqueta As New iText.Kernel.Pdf.PdfDocument(New iText.Kernel.Pdf.PdfReader(reporteByte)) docEtiqueta.CopyPagesTo(1, docEtiqueta.GetNumberOfPages(), pdfdoc) @@ -6545,7 +6524,7 @@ Partial Class PopUpVerFactura Dim Cant As Integer = DetalleRow.Item("Cantidad").ToString.ToEntero - 1 For i As Integer = 0 To Cant - Dim reporteByte = New MemoryStream(GenerarEtiqueta(CvePS, Lote, FechaCaducidad, PS)) + Dim reporteByte As New MemoryStream(GenerarEtiqueta(CvePS, Lote, FechaCaducidad, PS)) Dim docEtiqueta As New iText.Kernel.Pdf.PdfDocument(New iText.Kernel.Pdf.PdfReader(reporteByte)) docEtiqueta.CopyPagesTo(1, docEtiqueta.GetNumberOfPages(), pdfdoc) @@ -6584,7 +6563,7 @@ Partial Class PopUpVerFactura Dim Lote As String = DetalleRow.Item("Lote").ToString Dim FechaCaducidad As Date = DetalleRow.Item("FechaCaducidad").ToString.ToDate If Modalidad = "Individual" Then - Dim reporteByte = New MemoryStream(GenerarEtiqueta(CvePS, Lote, FechaCaducidad, PS)) + Dim reporteByte As New MemoryStream(GenerarEtiqueta(CvePS, Lote, FechaCaducidad, PS)) Dim docEtiqueta As New iText.Kernel.Pdf.PdfDocument(New iText.Kernel.Pdf.PdfReader(reporteByte)) docEtiqueta.CopyPagesTo(1, docEtiqueta.GetNumberOfPages(), pdfdoc) @@ -6593,7 +6572,7 @@ Partial Class PopUpVerFactura Dim Cant As Integer = DetalleRow.Item("Cantidad").ToString.ToEntero - 1 For i As Integer = 0 To Cant - Dim reporteByte = New MemoryStream(GenerarEtiqueta(CvePS, Lote, FechaCaducidad, PS)) + Dim reporteByte As New MemoryStream(GenerarEtiqueta(CvePS, Lote, FechaCaducidad, PS)) Dim docEtiqueta As New iText.Kernel.Pdf.PdfDocument(New iText.Kernel.Pdf.PdfReader(reporteByte)) docEtiqueta.CopyPagesTo(1, docEtiqueta.GetNumberOfPages(), pdfdoc) @@ -6714,7 +6693,7 @@ Partial Class PopUpVerFactura ObjPS.Dispose() - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + Dim logouri As String = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) Dim DtDatos As New DataTable Dim params As New List(Of ReportParameter) @@ -6954,7 +6933,7 @@ Partial Class PopUpVerFactura Dim CveMonedaImp As Integer Dim TipoPolImp As String Dim RutaReporte As String - Dim params = New List(Of ReportParameter) + Dim params As New List(Of ReportParameter) TipoPolImp = If(drp("CveTipoPoliza").ToString.ToEntero = 1, "Ingreso", If(drp("CveTipoPoliza").ToString.ToEntero = 2, "Egreso", "Diario")) CveTipoPolizaImp = drp("CveTipoPoliza").ToString.ToEntero diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index 30dd0ee1c..8cfa32948 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -1338,7 +1338,7 @@ Partial Class Compras_Proveedores If UsuarioActual.TienePermisoProceso(273) Then If CType(sender, GridView).ID = "GvA" And e.Row.DBCampo("CveCompra").ToEntero > 0 And e.Row.DBCampo("TipoDocto") = "NC" Then - Dim Parametros = Encripta($"CveCompra={e.Row.DBCampo("CveCompra").ToEntero}&SerieFolio={e.Row.DBCampo("SerieFolio")}&CveMoneda={e.Row.DBCampo("CveMoneda")}&CveProveedor={CveProveedor}&Saldo={e.Row.DBCampo("Saldo")}&Original={e.Row.DBCampo("Original")}&CvePrePoliza={e.Row.DBCampo("CvePrePoliza")}&FechaCompra={e.Row.DBCampo("Fecha")}") + Dim Parametros As String = Encripta($"CveCompra={e.Row.DBCampo("CveCompra").ToEntero}&SerieFolio={e.Row.DBCampo("SerieFolio")}&CveMoneda={e.Row.DBCampo("CveMoneda")}&CveProveedor={CveProveedor}&Saldo={e.Row.DBCampo("Saldo")}&Original={e.Row.DBCampo("Original")}&CvePrePoliza={e.Row.DBCampo("CvePrePoliza")}&FechaCompra={e.Row.DBCampo("Fecha")}") e.Row.FCHyperLink("HLDevolverDinero").Visible = True e.Row.FCHyperLink("HLDevolverDinero").NavigateUrl = $"/Bancos/IE.aspx?Opcion=DevDinC&P={Parametros}" End If @@ -1452,8 +1452,8 @@ Partial Class Compras_Proveedores Private Sub CargaCuentasDDL(Ddl As DropDownList, CveFuncionalidad As Integer) 'CARGA LO YA SELECCIONADO - Dim CveSeleccionado = -1 - Dim Seleccionado = "" + Dim CveSeleccionado As Integer = -1 + Dim Seleccionado As String = "" Seleccionado = Ddl.SelectedItem.Text CveSeleccionado = Ddl.SelectedValue.ToEntero @@ -1544,7 +1544,7 @@ Partial Class Compras_Proveedores Dim tIdContaProveedor As Integer Dim CuentaAbono As Integer - Dim ErrorBancos = False + Dim ErrorBancos As Boolean = False Dim ErrorConta As Boolean = False Dim ErrorContactos As Boolean = False Dim ErrorSucursales As Boolean = False @@ -1645,7 +1645,7 @@ Partial Class Compras_Proveedores If IdCuentaContable > 0 Then ObjContaAC.GetCuentas(IdCuentaContable, "-1", -1) - Dim dt = ObjContaAC.DtResultados + Dim dt As DataTable = ObjContaAC.DtResultados Dim CtaCodigo As String If dt.Rows.Count = 1 Then @@ -1836,7 +1836,7 @@ Partial Class Compras_Proveedores Dim CreoCuenta As Boolean = False If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso (UsuarioActual.Empresa.UsaAC Or (UsuarioActual.Empresa.UsaContabilidad And UsuarioActual.Empresa.Funcionalidad(322).ToString.Trim.ToEntero = 0)) Then - Dim ObjContaAC = New ClsContPAQi(UsuarioActual.Empresa) + Dim ObjContaAC As New ClsContPAQi(UsuarioActual.Empresa) Dim drCuenta As DataRow = ObjContaAC.DtResultados.FiltroPrimero("") If drCuenta IsNot Nothing Then CuentaAbono = drCuenta("Id").ToString.ToEntero @@ -2962,8 +2962,8 @@ Partial Class Compras_Proveedores If Adjunto.Trim.Length > 0 Then - Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Edoc/Proveedor/" & CveProveedor & "/" & Adjunto - Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "Edoc/Proveedor/" & CveProveedor & "/" & Adjunto + Dim linkDescarga As String = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Edoc/Proveedor/" & CveProveedor & "/" & Adjunto + Dim linkDescargaArchivo As String = UsuarioActual.Empresa.Ruta & "Edoc/Proveedor/" & CveProveedor & "/" & Adjunto If File.Exists(linkDescargaArchivo) Then ImgDownLoad.Visible = True @@ -3378,7 +3378,7 @@ Partial Class Compras_Proveedores If e.Row.RowType = DataControlRowType.DataRow Then If CveProveedor < 0 Then - For Index = 1 To TempDTCuentasBancos.Rows.Count + For Index As Integer = 1 To TempDTCuentasBancos.Rows.Count TempDTCuentasBancos.Rows(Index - 1)("CveCuentaDeposito") = Index Next TempDTCuentasBancos.AcceptChanges() @@ -3455,7 +3455,7 @@ Partial Class Compras_Proveedores Alert("No se pudo borrar la Cuenta Bancaria. Por favor intente nuevamente.", TipoMensaje.MsgError) End If Else - Dim index = GvRow.RowIndex + Dim index As Integer = GvRow.RowIndex TempDTCuentasBancos.Rows.RemoveAt(index) Alert("Cuenta Bancaria borrada con éxito.", TipoMensaje.MsgInformacion) End If @@ -3626,7 +3626,7 @@ Partial Class Compras_Proveedores 'Dim DtMonedas As New DataTable 'DtMonedas.Columns.Add("CveMoneda", GetType(Integer)) 'DtMonedas.Columns.Add("Abreviatura", GetType(String)) - Dim OcupaFiltro = False + Dim OcupaFiltro As Boolean = False If CType(GVHistorial.DataSource, DataTable) IsNot Nothing AndAlso CType(GVHistorial.DataSource, DataTable).MAX("CveMoneda").ToEntero > 1 Then OcupaFiltro = True @@ -3717,10 +3717,10 @@ Partial Class Compras_Proveedores Dim DTCxPTempral As DataTable = Nothing 'OBTENEMOS LOS DATOS - Dim FI = If(TxtFechaInicioCXP.Text = "" Or TxtFechaInicioCXP.Text = "__/__/____", "-1", TxtFechaInicioCXP.Text) - Dim FF = If(TxtFechaFinCXP.Text = "" Or TxtFechaFinCXP.Text = "__/__/____", "-1", TxtFechaFinCXP.Text) - Dim FVI = If(txtFechaVI.Text = "" Or txtFechaVI.Text = "__/__/____", "-1", txtFechaVI.Text) - Dim FVF = If(txtFechaVF.Text = "" Or txtFechaVF.Text = "__/__/____", "-1", txtFechaVF.Text) + Dim FI As String = If(TxtFechaInicioCXP.Text = "" Or TxtFechaInicioCXP.Text = "__/__/____", "-1", TxtFechaInicioCXP.Text) + Dim FF As String = If(TxtFechaFinCXP.Text = "" Or TxtFechaFinCXP.Text = "__/__/____", "-1", TxtFechaFinCXP.Text) + Dim FVI As String = If(txtFechaVI.Text = "" Or txtFechaVI.Text = "__/__/____", "-1", txtFechaVI.Text) + Dim FVF As String = If(txtFechaVF.Text = "" Or txtFechaVF.Text = "__/__/____", "-1", txtFechaVF.Text) Dim ObjMovtos As New ClsMovimientos() If ObjMovtos.GetCxPProveedor(CveProveedor, FI, FF, -1, -1, -1, -1, CveMonedaFiltro, -1, RBSucursal.SelectedValue.ToEntero, -1, FVI, FVF) Then @@ -3729,7 +3729,7 @@ Partial Class Compras_Proveedores If DTCxPTempral IsNot Nothing AndAlso DTCxPTempral.Rows.Count > 0 Then Dim dr As DataRow = DTCxPTempral.Rows(0) - Dim lista = New List(Of CrystalParametro) + Dim lista As New List(Of CrystalParametro) lista.Add(New CrystalParametro("Empresa", UsuarioActual.Empresa.Empresa)) lista.Add(New CrystalParametro("TipoCuentas", DdlTipoCuentasCxP.SelectedItem.Text)) @@ -4052,10 +4052,10 @@ Partial Class Compras_Proveedores If rblreporte.SelectedValue = "cxp" Then 'OBTENEMOS LOS DATOS - Dim FI = If(TxtFechaInicioCXP.Text = "" Or TxtFechaInicioCXP.Text = "__/__/____", "-1", TxtFechaInicioCXP.Text) - Dim FF = If(TxtFechaFinCXP.Text = "" Or TxtFechaFinCXP.Text = "__/__/____", "-1", TxtFechaFinCXP.Text) - Dim FVI = If(txtFechaVI.Text = "" Or txtFechaVI.Text = "__/__/____", "-1", txtFechaVI.Text) - Dim FVF = If(txtFechaVF.Text = "" Or txtFechaVF.Text = "__/__/____", "-1", txtFechaVF.Text) + Dim FI As String = If(TxtFechaInicioCXP.Text = "" Or TxtFechaInicioCXP.Text = "__/__/____", "-1", TxtFechaInicioCXP.Text) + Dim FF As String = If(TxtFechaFinCXP.Text = "" Or TxtFechaFinCXP.Text = "__/__/____", "-1", TxtFechaFinCXP.Text) + Dim FVI As String = If(txtFechaVI.Text = "" Or txtFechaVI.Text = "__/__/____", "-1", txtFechaVI.Text) + Dim FVF As String = If(txtFechaVF.Text = "" Or txtFechaVF.Text = "__/__/____", "-1", txtFechaVF.Text) Dim FechaIn As String = $" Fecha Inicio: {TxtFechaInicioCXP.Text}" Dim FechaFn As String = $" Fecha Fin: {TxtFechaFinCXP.Text}" @@ -4105,8 +4105,8 @@ Partial Class Compras_Proveedores 'OBTENEMOS LOS DATOS Dim DtANC As DataTable - Dim FI = If(TxtFechaInicioCXP.Text = "" Or TxtFechaInicioCXP.Text = "__/__/____", "-1", TxtFechaInicioCXP.Text) - Dim FF = If(TxtFechaFinCXP.Text = "" Or TxtFechaFinCXP.Text = "__/__/____", "-1", TxtFechaFinCXP.Text) + Dim FI As String = If(TxtFechaInicioCXP.Text = "" Or TxtFechaInicioCXP.Text = "__/__/____", "-1", TxtFechaInicioCXP.Text) + Dim FF As String = If(TxtFechaFinCXP.Text = "" Or TxtFechaFinCXP.Text = "__/__/____", "-1", TxtFechaFinCXP.Text) Dim CveProveedorSucursal As Integer = RBSucursal.SelectedValue.ToEntero() If ObjMovtos.GetAnticiposProveedor(CveProveedor, If(CveProveedorSucursal = 0, -1, CveProveedorSucursal), CveMoneda, -1, FI, FF) Then DtANC = If(DdlTipoCuentasCxP.SelectedValue = "-1", ObjMovtos.DtResultados, ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'", "Moneda, FechaVencimiento")) diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index fa0a64b08..ad3d30557 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -1869,10 +1869,10 @@ Partial Class ProductosyServicios CargaGvPSAdicionales() End Sub Private Sub GvPSAdicionales_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvPSAdicionales.RowDeleting - Dim TieneError = False + Dim TieneError As Boolean = False - Dim CvePSAdicional = GvPSAdicionales.Rows(e.RowIndex).DataKey("CvePSAdicional").ToEntero - Dim PSAdicional = GvPSAdicionales.Rows(e.RowIndex).DataKey("PS").ToString + Dim CvePSAdicional As Integer = GvPSAdicionales.Rows(e.RowIndex).DataKey("CvePSAdicional").ToEntero + Dim PSAdicional As String = GvPSAdicionales.Rows(e.RowIndex).DataKey("PS").ToString Dim ObjProductosServicios As New ClsProductosServicios() If Not ObjProductosServicios.RemovePSAdicionales(CvePS, CvePSAdicional) Then @@ -1912,7 +1912,7 @@ Partial Class ProductosyServicios Private Sub BtnAgregarPSAdicional_Click(sender As Object, e As EventArgs) Handles BtnAgregarPSAdicional.Click Dim ObjProductosServicios As New ClsProductosServicios() ObjProductosServicios.IniciaTransacSQL() - Dim TieneError = False + Dim TieneError As Boolean = False If CvePSAdicional < 0 Then If Not ObjProductosServicios.AddPSAdicionales(CvePS, DdlPSAdicional.SelectedValue.ToEntero, If(TxtCantidadPSAdicional.Visible, TxtCantidadPSAdicional.Text.ToDecimal, 0)) Then From 894a72b026b382daa0815ad7e1c30179cc68b285 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 18 Sep 2023 09:04:28 -0700 Subject: [PATCH 06/35] -- mejoras --- Ventas/FacturacionAcarreos.aspx | 17 ++++++++--------- Ventas/FacturacionAcarreos.aspx.vb | 17 +++++++++-------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Ventas/FacturacionAcarreos.aspx b/Ventas/FacturacionAcarreos.aspx index 3a81dce38..d071388a9 100644 --- a/Ventas/FacturacionAcarreos.aspx +++ b/Ventas/FacturacionAcarreos.aspx @@ -100,16 +100,15 @@ - - - - - + + + + + - - - - + + + diff --git a/Ventas/FacturacionAcarreos.aspx.vb b/Ventas/FacturacionAcarreos.aspx.vb index 586a7d3df..dc5bccc2d 100644 --- a/Ventas/FacturacionAcarreos.aspx.vb +++ b/Ventas/FacturacionAcarreos.aspx.vb @@ -4,6 +4,7 @@ Option Strict On Imports System.Data Imports System.IO +Imports ADSTimbrado Imports Extensiones Imports GemBox.Spreadsheet @@ -22,7 +23,7 @@ Partial Class Ventas_FacturacionAcarreos CveCliente = DdlClientes.SelectedValue.ToEntero() End If Using ObjVentas As New ClsVentas - If ObjVentas.GetFacturacionAcarreos(-1, CveCliente, -1, DdlEstatus.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa) Then + If ObjVentas.GetFacturacionAcarreos(-1, CveCliente, -1, DdlEstatus.SelectedValue.ToEntero(), Now, UsuarioActual.CveEmpresa) Then GvDatos.DataSource = ObjVentas.DtResultados End If End Using @@ -57,7 +58,7 @@ Partial Class Ventas_FacturacionAcarreos Dim FileExcel As New ExcelFile() - Dim worksheet = FileExcel.Worksheets.Add(DtExcel.TableName) + Dim worksheet As ExcelWorksheet = FileExcel.Worksheets.Add(DtExcel.TableName) worksheet.InsertDataTable(DtExcel, New InsertDataTableOptions() With { .ColumnHeaders = True, @@ -67,8 +68,8 @@ Partial Class Ventas_FacturacionAcarreos worksheet.Rows(0).Style.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(75, 119, 190), SpreadsheetColor.FromArgb(255, 255, 255)) worksheet.Rows(0).Style.Font.Color = SpreadsheetColor.FromArgb(255, 255, 255) - Dim columnCount = worksheet.CalculateMaxUsedColumns() - For i = 0 To columnCount + Dim columnCount As Integer = worksheet.CalculateMaxUsedColumns() + For i As Integer = 0 To columnCount worksheet.Columns(i).AutoFit(1, worksheet.Rows(0), worksheet.Rows(worksheet.Rows.Count - 1)) Next @@ -88,7 +89,7 @@ Partial Class Ventas_FacturacionAcarreos Private Sub CargarArchivo(Ruta As String, FileName As String) SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) Dim dt As DataTable = Nothing - Dim ErrorArchivo = False + Dim ErrorArchivo As Boolean = False Try dt = ReadExcelFile(Ruta + FileName, True) @@ -257,7 +258,7 @@ Partial Class Ventas_FacturacionAcarreos Dim CvePSMercancia As Integer = GvRow.DataKey("CvePSRelacionado").ToEntero() - Dim ObjFactura = Modelos.Factura.CrearVentaNueva(UsuarioActual, CveSubProyecto, CveCliente, CveMoneda) + Dim ObjFactura As Modelos.Factura = Modelos.Factura.CrearVentaNueva(UsuarioActual, CveSubProyecto, CveCliente, CveMoneda) ObjFactura.EmitirCartaPorte = True ObjFactura.CveFacturacionAcarreo = GvRow.DataKey("CveFacturacionAcarreo").ToEntero() @@ -267,7 +268,7 @@ Partial Class Ventas_FacturacionAcarreos ObjFactura.CalculaTotales() ObjFactura.PreparaTimbre() - Dim resp = ObjFactura.EmitirFactura(Timbrar:=True, Modulo:="FacturacionAcarreos") + Dim resp As Modelos.Factura.MMensajeFactura = ObjFactura.EmitirFactura(Timbrar:=True, Modulo:="FacturacionAcarreos") For Each m As String In resp.Mensajes msg.AppendFormat("{0}
", m) @@ -338,7 +339,7 @@ Partial Class Ventas_FacturacionAcarreos End Sub Private Function CreaDTMercancias(CvePS As Integer, Cantidad As Decimal) As DataTable - Dim DtMercancias = New DataTable() + Dim DtMercancias As New DataTable() DtMercancias.Columns.Add(New DataColumn("Consec", GetType(Integer))) DtMercancias.Columns.Add(New DataColumn("Cantidad", GetType(Decimal))) DtMercancias.Columns.Add(New DataColumn("CvePS", GetType(Integer))) From d8d818b4ce7e8e2d13f6c3251d16533904a06415 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 18 Sep 2023 09:04:50 -0700 Subject: [PATCH 07/35] -- option explciit -- bdh - se quita descuento de filtros/lub LTH --- Ventas/PV.aspx.vb | 196 +++++++++++++++++++++++----------------------- 1 file changed, 98 insertions(+), 98 deletions(-) diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index 3d7b18770..de98864d3 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -650,14 +650,14 @@ Partial Class PV End Set End Property - Private ReadOnly Property ClasificacionesDescuentos As Dictionary(Of Integer, Decimal) - Get - Return New Dictionary(Of Integer, Decimal) From { - {20516, 0.21D}, 'Descuento para lubricantes LTH - {20515, 0.25D} 'Descuento para filtros LTH - } - End Get - End Property + 'Private ReadOnly Property ClasificacionesDescuentos As Dictionary(Of Integer, Decimal) + ' Get + ' Return New Dictionary(Of Integer, Decimal) From { + ' {20516, 0.21D}, 'Descuento para lubricantes LTH + ' {20515, 0.25D} 'Descuento para filtros LTH + ' } + ' End Get + 'End Property Private Property CveAutorizacion As Integer Get Return (IfNull(ViewState("CveAutorizacion"), "-1", ViewState("CveAutorizacion"))).ToString().ToEntero() @@ -1484,7 +1484,7 @@ Partial Class PV TrRetIVA.Style.Add("display", "") UsuarioActual.Empresa.MostrarRetIVA = True If TmpDT IsNot Nothing Then - Dim PorcentajeRetIVA = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100) + Dim PorcentajeRetIVA As Decimal = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100) LblRetIVA.Text = PorcentajeRetIVA.FormatoNumero(2) End If @@ -1814,11 +1814,11 @@ Partial Class PV ViewState("CveClienteAnterior") = CveCliente 'SI EL DETALLE NO TIENE MOVIMIENTOS DE INVENTARIO ES VISIBLE - Dim CantidadFacturadaRemision = 0.0 + Dim CantidadFacturadaRemision As Decimal = 0 For Each Gvr As GridViewRow In GvPS.Rows Gvr.FCLinkButton("imgE").Visible = Not Gvr.DataKey("CantidadFacturadaRem").ToString.ToDouble > 0 AndAlso Gvr.DataKey("EsCargo") = "False" Gvr.FCLinkButton("imgD").Visible = Not Gvr.DataKey("CantidadInventario").ToString.ToDouble > 0 AndAlso Gvr.DataKey("EsCargo") = "False" - CantidadFacturadaRemision += Gvr.DataKey("CantidadFacturadaRem").ToString.ToDouble + CantidadFacturadaRemision += Gvr.DataKey("CantidadFacturadaRem").ToString.ToDecimal Next 'ACTIVA CAMBIO DE CLIENTE - SI NO TIENE NADA FACTURADO @@ -2156,7 +2156,7 @@ Partial Class PV If ObjPVenta.DtResultados.Rows.Count > 0 Then CveCorte = ObjPVenta.CveCorte - Dim FechaICorte = ObjPVenta.FechaInicial.Date '.AddDays(-1) + Dim FechaICorte As Date = ObjPVenta.FechaInicial.Date '.AddDays(-1) If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso FechaICorte < Now.Date Then DebeCerrarCorte = True LblMotivoBloqueo.Text = $"Existe un corte del día {FechaICorte.ToString("dd/MM/yyyy")}. Favor de cerrarlo para iniciar un nuevo corte." @@ -2223,32 +2223,32 @@ Partial Class PV Dt.Columns.Add("Descripcion", GetType(String)) Dt.Columns.Add("Importe", GetType(Decimal)) - Dim Dr1 = Dt.NewRow + Dim Dr1 As DataRow = Dt.NewRow Dr1("Descripcion") = "Fondo de Caja" Dr1("Importe") = ObjPVenta.DtResultados(0)("ImporteInicial").ToString.ToDouble Dt.Rows.Add(Dr1) - Dim Dr2 = Dt.NewRow + Dim Dr2 As DataRow = Dt.NewRow Dr2("Descripcion") = "Ventas en Efectivo" Dr2("Importe") = ObjPVenta.DtResultados(0)("VentasEfectivo").ToString.ToDouble Dt.Rows.Add(Dr2) - Dim Dr3 = Dt.NewRow + Dim Dr3 As DataRow = Dt.NewRow Dr3("Descripcion") = "Propinas" Dr3("Importe") = ObjPVenta.DtResultados(0)("Propina").ToString.ToDouble Dt.Rows.Add(Dr3) - Dim Dr4 = Dt.NewRow + Dim Dr4 As DataRow = Dt.NewRow Dr4("Descripcion") = "Entradas" Dr4("Importe") = ObjPVenta.DtResultados(0)("Ingresado").ToString.ToDouble Dt.Rows.Add(Dr4) - Dim Dr5 = Dt.NewRow + Dim Dr5 As DataRow = Dt.NewRow Dr5("Descripcion") = "Salidas" Dr5("Importe") = ObjPVenta.DtResultados(0)("Retirado").ToString.ToDouble Dt.Rows.Add(Dr5) - Dim Dr6 = Dt.NewRow + Dim Dr6 As DataRow = Dt.NewRow Dr6("Descripcion") = "Total" Dr6("Importe") = Total Dt.Rows.Add(Dr6) @@ -2318,7 +2318,7 @@ Partial Class PV If TxtEfectivoEnCaja.Text.Trim <> "" Then If ObjPVenta.UpdateFinalizadoVtaCortes(CveCorte, TxtEfectivoEnCaja.Text.ToDouble, LblDiferenciaCaja.Text.ToDouble, Now, UsuarioActual.CveEmpresa) Then RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=CORT&CVECORTE={0}&FORMATO={1}", CveCorte, "PDF"))}'", "Imprimir") - Dim Liga = "document.location.href=""/Ventas/PV.aspx"";" + Dim Liga As String = "document.location.href=""/Ventas/PV.aspx"";" Alert("Se ha cerrado el turno correctamente.", TipoMensaje.MsgInformacion, Liga) End If End If @@ -2329,7 +2329,7 @@ Partial Class PV If TxtEfectivoCajaBloqueo.Text.Trim <> "" Then If ObjPVenta.UpdateFinalizadoVtaCortes(CveCorte, TxtEfectivoCajaBloqueo.Text.ToDouble, LblDiferenciaCajaBloqueo.Text.ToDouble, Now, UsuarioActual.CveEmpresa) Then RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=CORT&CVECORTE={0}&FORMATO={1}", CveCorte, "PDF"))}'", "Imprimir") - Dim Liga = "document.location.href=""/Ventas/PV.aspx"";" + Dim Liga As String = "document.location.href=""/Ventas/PV.aspx"";" Alert("Se ha cerrado el turno correctamente.", TipoMensaje.MsgInformacion, Liga) End If Else @@ -2773,7 +2773,7 @@ Partial Class PV UpPS.Update() End Sub Private Sub CargaFormatoSucursal() - Dim dr = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveSubProyecto = {0}", If(DdlSubProyectoDatos.SelectedValue = "", "-1", DdlSubProyectoDatos.SelectedValue))) + Dim dr As DataRow = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveSubProyecto = {0}", If(DdlSubProyectoDatos.SelectedValue = "", "-1", DdlSubProyectoDatos.SelectedValue))) If dr IsNot Nothing Then ViewState("SucCalle") = dr("Calle") ViewState("SucNoExt") = dr("NoExt") @@ -2820,7 +2820,7 @@ Partial Class PV If CveClienteSuc > 0 Then If ObjCliente.GetSucursales(CveCliente, CveClienteSuc) Then If ObjCliente.DtResultados.Rows.Count > 0 Then - Dim Correo = ObjCliente.DtResultados.Rows(0)("Correo").ToString + Dim Correo As String = ObjCliente.DtResultados.Rows(0)("Correo").ToString If Correo.Trim.Length > 0 Then ViewState("Mail") = Correo End If @@ -2992,7 +2992,7 @@ Partial Class PV End Sub Private Sub CargaVendedores() - Dim CveVendedorActual = DdlVendedor.SelectedValue + Dim CveVendedorActual As Integer = DdlVendedor.SelectedValue.ToEntero DdlVendedor.Items.Clear() @@ -3127,10 +3127,11 @@ Partial Class PV TmpDT.Rows(row.RowIndex)("Orden") = row.FCTextBox("TxtOrden").Text.ToEntero Next - Dim resultados = From OrdenDT In TmpDT - Order By OrdenDT("Orden").ToString.ToEntero - Select OrdenDT - TmpDT = resultados.CopyToDataTable + 'Dim resultados = From OrdenDT In TmpDT + ' Order By OrdenDT("Orden").ToString.ToEntero + ' Select OrdenDT + 'TmpDT = resultados.CopyToDataTable + TmpDT = TmpDT.FiltraParametros("", "Orden") CalculaTotalesVenta() GvPS.DataSource = TmpDT.FiltraParametros("EliminarDB = False") @@ -3305,11 +3306,11 @@ Partial Class PV If DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing") Then Dim MensajeCosto As New StringBuilder - Dim CostoMenor = 0.0D - Dim CostoMayor = 0.0D - Dim Costo = 0.0D - Dim EsValido = False 'BANDERA - Dim EsValidoMayor = False + Dim CostoMenor As Decimal = 0 + Dim CostoMayor As Decimal = 0 + Dim Costo As Decimal = 0 + Dim EsValido As Boolean = False 'BANDERA + Dim EsValidoMayor As Boolean = False 'VALIDA PROMOCIONES Y EXISTENCIAS @@ -3321,7 +3322,7 @@ Partial Class PV Dim ObjInventarios As New ClsInventarios - Dim PU = 0.0D + Dim PU As Decimal = 0 For Each dr As DataRow In TmpDT.Rows 'SI ES SERVICIO NO VALIDA If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveTipoPS").ToString.ToEntero = 1 Then @@ -3450,7 +3451,7 @@ Partial Class PV Dim Retorno As Modelos.Factura.MMensajeFactura = Nothing Dim urlFactura As String = "" - Dim urlAjuste = "" + Dim urlAjuste As String = "" Dim SbAlert As New StringBuilder Try @@ -3536,7 +3537,7 @@ Partial Class PV Retorno.Mensajes(Retorno.Mensajes.Count - 1) = SbAlert.ToString() End If - For Each Mensaje In Retorno.Mensajes + For Each Mensaje As String In Retorno.Mensajes Alert(Mensaje, If(Retorno.TieneError, TipoMensaje.MsgError, TipoMensaje.MsgInformacion), If(Retorno.TieneError, "", Retorno.LigaPV), ShowCloseButton:=False) Next @@ -3553,14 +3554,14 @@ Partial Class PV End Sub Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, Optional GetBytes As Boolean = True) As Byte() - Dim Url = New Uri(String.Format("{0}://{1}:{2}/Compras/PopUpVerFactura.aspx?P={3}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))) + Dim Url As New Uri(String.Format("{0}://{1}:{2}/Compras/PopUpVerFactura.aspx?P={3}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))) Dim File As Byte() = Nothing Try - Using httpClient = New HttpClient() + Using httpClient As New HttpClient() httpClient.Timeout = New TimeSpan(0, 15, 0) - Using request = New HttpRequestMessage(HttpMethod.Get, Url) + Using request As New HttpRequestMessage(HttpMethod.Get, Url) request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CveUsuario=100", CveEmpresa, DateTime.UtcNow.Ticks))) - Dim response = httpClient.SendAsync(request).Result + Dim response As HttpResponseMessage = httpClient.SendAsync(request).Result If GetBytes AndAlso response.StatusCode = Net.HttpStatusCode.OK Then File = response.Content.ReadAsByteArrayAsync().Result End If @@ -3810,12 +3811,12 @@ Partial Class PV ObjFactura.CveAlmacenServicioDomicilio = ddlAlmacen.SelectedValue.ToEntero() 'GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 29 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString.ToEntero 'PREPARA DT INVENTARIO - Dim DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2") + Dim DtInv As DataTable = TmpDT.Copy.FiltraParametros("CveTipoPS = 2") For Each GvRow As GridViewRow In GvInv.Rows If GvRow.RowType = DataControlRowType.DataRow Then - Dim filtro = DtInv.Select(String.Format("CvePS = {0} AND Consec = {1}", GvRow.DataKey("CvePS"), GvRow.DataKey("Consec"))) + Dim filtro As DataRow() = DtInv.Select(String.Format("CvePS = {0} AND Consec = {1}", GvRow.DataKey("CvePS"), GvRow.DataKey("Consec"))) If filtro IsNot Nothing AndAlso filtro.Length > 0 Then - Dim Row = filtro(0) + Dim Row As DataRow = filtro(0) Row("Serie") = GvRow.FCTextBox("TxtSerie").Text.Trim End If End If @@ -4083,7 +4084,7 @@ Partial Class PV Dim PrecioSugerido As Decimal = 0 PrecioSugerido = drPS("Precio").ToString.ToDecimal If UsuarioActual.CveEmpresa.Contiene(80, 119) Then - Dim CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("CvePrecioLista", $"CveCliente = {CveCliente}").ToEntero + Dim CvePrecioListaPS As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("CvePrecioLista", $"CveCliente = {CveCliente}").ToEntero If CvePrecioListaPS > 0 Then Dim ObjPS As New ClsProductosServicios If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then @@ -4091,9 +4092,9 @@ Partial Class PV PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDecimal If PrecioSugerido = 0 Then Dim ObjInventarios As New ClsInventarios - Dim CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero) + Dim CostoPS As Decimal = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero) ObjInventarios.Dispose() - Dim PorcentajePrecio = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDecimal + Dim PorcentajePrecio As Decimal = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDecimal If CostoPS > 0 And PorcentajePrecio > 0 Then PrecioSugerido = ((PorcentajePrecio / 100) + 1) * CostoPS End If @@ -4343,26 +4344,26 @@ Partial Class PV If ValidaCondicionesComerciales AndAlso DtPorcentajeMarcas IsNot Nothing AndAlso DtPorcentajeMarcas.Rows.Count > 0 Then 'VERIFICA SI EL PRODUCTO TIENE ESPECIFICADA UNA MARCA If Not String.IsNullOrEmpty(DrPS("CveMarca").ToString()) AndAlso DrPS("CveMarca").ToString().ToEntero() > 0 Then - Dim RowPorcentaje = DtPorcentajeMarcas.FiltroPrimero($"CveMarca={DrPS("CveMarca").ToString()}") + Dim RowPorcentaje As DataRow = DtPorcentajeMarcas.FiltroPrimero($"CveMarca={DrPS("CveMarca").ToString()}") 'REALIZA LOS DESCUENTOS DE ACUERDO AL PORCENTAJE POR MARCA If RowPorcentaje IsNot Nothing Then '(AHORA LOS DESCUENTOS SON ACUMULABLES) 'Descuento = 0 - Dim PorcentajeProducto = RowPorcentaje("PorcentajeProducto").ToString().ToDecimal() / 100D - Dim PorcentajeProducto2 = RowPorcentaje("PorcentajeProducto2").ToString().ToDecimal() / 100D - Dim PorcentajeProducto3 = RowPorcentaje("PorcentajeProducto3").ToString().ToDecimal() / 100D + Dim PorcentajeProducto As Decimal = RowPorcentaje("PorcentajeProducto").ToString().ToDecimal() / 100D + Dim PorcentajeProducto2 As Decimal = RowPorcentaje("PorcentajeProducto2").ToString().ToDecimal() / 100D + Dim PorcentajeProducto3 As Decimal = RowPorcentaje("PorcentajeProducto3").ToString().ToDecimal() / 100D Dim TotalInicial As Decimal = (Cantidad * (PU)) '- Descuento - Dim TotalFinal = TotalInicial + Dim TotalFinal As Decimal = TotalInicial 'SI APLICA EL PRIMER DESCUENTO If PorcentajeProducto > 0 Then Dim Descuento1 As Decimal = (TotalInicial * PorcentajeProducto).RoundSQL(2) - Dim Total2 = (TotalInicial - Descuento1) + Dim Total2 As Decimal = (TotalInicial - Descuento1) 'SI APLICA EL SEGUNDO DESCUENTO If PorcentajeProducto2 > 0 Then Dim Descuento2 As Decimal = (Total2 * PorcentajeProducto2).RoundSQL(2) - Dim Total3 = (Total2 - Descuento2) + Dim Total3 As Decimal = (Total2 - Descuento2) 'SI APLICA EL TERCER DESCUENTO If PorcentajeProducto3 > 0 Then @@ -4385,20 +4386,20 @@ Partial Class PV 'SI TIENE PRONTO PAGO CALCULA EL IMPORTE If DdlTipoComprobante.SelectedValue = "Ing" AndAlso RowPorcentaje("ProntoPago").ToString().ToDecimal() > 0 Then Dim TotalProntoPago As Decimal = (Cantidad * (PU)) - Descuento - Dim PorcentajeProntoPago = RowPorcentaje("ProntoPago").ToString().ToDecimal() / 100D + Dim PorcentajeProntoPago As Decimal = RowPorcentaje("ProntoPago").ToString().ToDecimal() / 100D ObjDescuento.ImporteProntoPago = (TotalProntoPago * PorcentajeProntoPago).RoundSQL(2) End If End If End If - Else - 'If CveMarcaPS = 1092 Then ' E140 - alcalinas LTH - ' Descuento = ((Cantidad * PU) * 0.183D).RoundSQL(2) - 'End If - If DrPS("CveClasificacion").ToString.ToEntero.Contiene(20516, 20515) Then - Descuento = ((Cantidad * PU) * ClasificacionesDescuentos(DrPS("CveClasificacion").ToString.ToEntero)).RoundSQL(2) - End If + 'Else + ' 'If CveMarcaPS = 1092 Then ' E140 - alcalinas LTH + ' ' Descuento = ((Cantidad * PU) * 0.183D).RoundSQL(2) + ' 'End If + ' If DrPS("CveClasificacion").ToString.ToEntero.Contiene(20516, 20515) Then + ' Descuento = ((Cantidad * PU) * ClasificacionesDescuentos(DrPS("CveClasificacion").ToString.ToEntero)).RoundSQL(2) + ' End If End If ''condicion final, si es cambio de Vigencia, no aplica descuento @@ -4699,14 +4700,14 @@ Partial Class PV Exit Sub End If - Dim CveTipoInv = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("Inv_CveMetodoInventario").ToEntero + Dim CveTipoInv As Integer = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("Inv_CveMetodoInventario").ToEntero If Cantidad <> 1 And CveTipoInv = 5 AndAlso UsuarioActual.CveEmpresa <> 72 Then Alert("El producto se tiene que dar salida por serie y producto por producto (Cantidad = 1).", TipoMensaje.MsgAdvertencia) Exit Sub End If - Dim AplicaSerie = CBool(GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("AplicaSerie")) + Dim AplicaSerie As Boolean = CBool(GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("AplicaSerie")) If TmpDT.FiltraParametros("AsientoContableVentas <> '" & AsientoContableVentas.ToString & "'").Rows.Count = 0 Then Dim Row As DataRow = Nothing @@ -5211,10 +5212,10 @@ Partial Class PV If Not CveContrato > 0 Then 'BANDERAS PARA VALIDACIONES - Dim EsValido = False - Dim EsValidoMayor = False - Dim CostoMenor = 0.0D - Dim CostoMayor = 0.0D + Dim EsValido As Boolean = False + Dim EsValidoMayor As Boolean = False + Dim CostoMenor As Decimal = 0.0D + Dim CostoMayor As Decimal = 0.0D 'PRECIO MINIMO If UsuarioActual.Empresa.Funcionalidad(129).ToEntero > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then @@ -5331,7 +5332,7 @@ Partial Class PV GvPSRowIndexEdit = GvRow.RowIndex ConsecutivoVenta = GvRow.DataKey("Consec").ToEntero CveVentaDetalle = GvRow.DataKey("CveVentaDetalle").ToEntero - Dim EsCargo = CBool(GvRow.DataKey("EsCargo")) + Dim EsCargo As Boolean = CBool(GvRow.DataKey("EsCargo")) LnkAgregarPS.Text = "Actualizar" DdlClasificacion.SelectedValueExist(GvRow.DataKey("CveClasificacion")) CargaPS(DdlClasificacion.SelectedValue.ToEntero, DdlPS) @@ -5476,7 +5477,7 @@ Partial Class PV End If 'SELECCIONA EL PS DEPENDIENDO LA MODALIDAD (CODIGO BARRAS - DDL) - Dim CvePS = DdlPS.SelectedValue.ToEntero + Dim CvePS As Integer = DdlPS.SelectedValue.ToEntero Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") If ValidaAgregarPS(CvePS, DdlUnidadMedida.SelectedValue.ToEntero, TxtPrecio.Text.Trim.ToDouble, HdnTipoPS.Value.ToEntero, TxtCantidad.Text.ToDecimal) Then @@ -5494,9 +5495,9 @@ Partial Class PV End If Dim ObjDescuento As New Modelos.VentaDescuentos - If DrPS("CveClasificacion").ToString.ToEntero.Contiene(20516, 20515) Then - ObjDescuento.ImporteDescuento = ((Cantidad * PU) * ClasificacionesDescuentos(DrPS("CveClasificacion").ToString.ToEntero)) - End If + 'If DrPS("CveClasificacion").ToString.ToEntero.Contiene(20516, 20515) Then + ' ObjDescuento.ImporteDescuento = ((Cantidad * PU) * ClasificacionesDescuentos(DrPS("CveClasificacion").ToString.ToEntero)) + 'End If ObjDescuento = CalcularDescuentos(CvePS, Cantidad, PU) If ObjDescuento.EsPUModificado Then @@ -5512,7 +5513,7 @@ Partial Class PV Proyecto = RowSP("Proyecto").ToString End If - Dim Consec = AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero, DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text, + Dim Consec As Integer = AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero, DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text, CvePS, "", TxtObsPS.Text.Trim, PU, ObjDescuento.ImporteDescuento, CveProyecto, Proyecto, DdlSubProyectoDatos.SelectedValue.ToEntero, DdlSubProyectoDatos.SelectedItem.Text, Serie:="", TiempoEntrega:="", CuentaPredial:="", RegeneraIEPS:=ClienteDesglosaIEPS, CveVentaDetalle:=CveVentaDetalle, EsCargo:=EsCargo) @@ -5548,7 +5549,7 @@ Partial Class PV Exit Sub End If - Dim Total = 0.0D + Dim Total As Decimal = 0.0D Dim Descuento As Decimal = HdnDescuento.Value.ToDecimal Dim Porcentaje As Decimal = Descuento / TmpDT.SUMD("Total") Dim LastDr As DataRow = Nothing @@ -5661,7 +5662,7 @@ Partial Class PV #Region "CALCULA TOTALES" Private Sub CalculaTotalesVenta(Optional RecalculaImpuestosLocales As Boolean = True) - Dim TmpDT = Me.TmpDT.FiltraParametros("EliminarDB = False", Orderby:="Consec") + Dim TmpDT As DataTable = Me.TmpDT.FiltraParametros("EliminarDB = False", Orderby:="Consec") Dim TotalSubTotal As Decimal = TmpDT.SUM("TotalImporte").ToDecimal Dim TotalDescuentos As Decimal = TmpDT.SUM("Descuento").ToDecimal @@ -5744,7 +5745,7 @@ Partial Class PV Dim Cuerpo As String = String.Empty Dim ResultadoMail As Integer = 0 - Dim TipoComprobante = "" + Dim TipoComprobante As String = "" If DdlTipoComprobante.SelectedValue.ToString = "Ing" Then TipoComprobante = "Factura" If DdlTipoComprobante.SelectedValue.ToString = "Egs" Then TipoComprobante = "Nota de Crédito" @@ -6144,8 +6145,8 @@ Partial Class PV DtPagos.Rows.RemoveAt(e.RowIndex) 'JJMQ 20160506: Validacion para no pagar de mas a peticion de I.P. - Dim abonado = DtPagos.SUM("Importe") - Dim saldo = TxtTotal.Text.Replace(",", "").ToDouble - abonado + Dim abonado As Decimal = DtPagos.SUMD("Importe") + Dim saldo As Decimal = TxtTotal.Text.Replace(",", "").ToDecimal - abonado 'CVImporteContado.ValueToCompare = (saldo.FormatoNumero(2).ToDouble).ToString CargaGridContado() @@ -6173,7 +6174,7 @@ Partial Class PV 'Pago en Efectivo If TxtImporteEfectivo.Text.ToDecimal > 0 Then If DdlCuentaEfectivo.Items.Count > 0 Then - Dim DrEfectivo = DtPagos.NewRow + Dim DrEfectivo As DataRow = DtPagos.NewRow DrEfectivo("CveTipoMovimiento") = 13 DrEfectivo("TipoMovimiento") = "Pago en Efectivo" DrEfectivo("CveCuenta") = DdlCuentaEfectivo.SelectedValue @@ -6192,7 +6193,7 @@ Partial Class PV 'Pago Tarjeta Credito If TxtImporteCredito.Text.ToDecimal > 0 Then If DdlCuentaTarjetaCredito.Items.Count > 0 Then - Dim DrCredito = DtPagos.NewRow + Dim DrCredito As DataRow = DtPagos.NewRow DrCredito("CveTipoMovimiento") = 12 DrCredito("TipoMovimiento") = "Tarjeta de Crédito" DrCredito("CveCuenta") = DdlCuentaTarjetaCredito.SelectedValue @@ -6211,7 +6212,7 @@ Partial Class PV 'Pago Tarjeta Debito If TxtImporteDebito.Text.ToDecimal > 0 Then If DdlCuentaTarjetaDebito.Items.Count > 0 Then - Dim DrDebito = DtPagos.NewRow + Dim DrDebito As DataRow = DtPagos.NewRow DrDebito("CveTipoMovimiento") = 11 DrDebito("TipoMovimiento") = "Tarjeta de Debito" DrDebito("CveCuenta") = DdlCuentaTarjetaDebito.SelectedValue @@ -6231,7 +6232,7 @@ Partial Class PV 'Pago Tarjeta Debito If TxtImporteCheque.Text.ToDecimal > 0 Then If DdlCuentaCheque.Items.Count > 0 Then - Dim DrCheque = DtPagos.NewRow + Dim DrCheque As DataRow = DtPagos.NewRow DrCheque("CveTipoMovimiento") = 3 DrCheque("TipoMovimiento") = "Cheque" DrCheque("CveCuenta") = DdlCuentaCheque.SelectedValue @@ -6251,7 +6252,7 @@ Partial Class PV 'Pago Transferencia If TxtImporteTransferencia.Text.ToDecimal > 0 Then If DdlCuentaTransferencia.Items.Count > 0 Then - Dim DrCheque = DtPagos.NewRow + Dim DrCheque As DataRow = DtPagos.NewRow DrCheque("CveTipoMovimiento") = 8 DrCheque("TipoMovimiento") = "Transferencia" DrCheque("CveCuenta") = DdlCuentaTransferencia.SelectedValue @@ -6281,7 +6282,7 @@ Partial Class PV LimpiaEscondeContado() End Sub Private Function ValidaPagosContado() As Boolean - Dim Retorno = False + Dim Retorno As Boolean = False If DtPagos.SUM("Importe").ToString.ToDecimal > TxtTotal.Text.ToDecimal Then Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor verifique.", TipoMensaje.MsgAdvertencia) @@ -6308,13 +6309,13 @@ Partial Class PV #Region " SERIE ALMACEN " Protected Sub BtnSerie_Click(sender As Object, e As EventArgs) - Dim Row = CType(CType(sender, Button).NamingContainer, GridViewRow) + Dim Row As GridViewRow = CType(CType(sender, Button).NamingContainer, GridViewRow) If Row.FCTextBox("TxtSerie").Text.Trim = "" Then Exit Sub - Dim Index = Row.RowIndex + Dim Index As Integer = Row.RowIndex Dim ObjInventarios As New ClsInventarios - Dim Existencia = ObjInventarios.GetExistenciasPSSerie(Row.FCTextBox("TxtSerie").Text.ToString.Trim, ddlAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) + Dim Existencia As Decimal = ObjInventarios.GetExistenciasPSSerie(Row.FCTextBox("TxtSerie").Text.ToString.Trim, ddlAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) ObjInventarios.Dispose() 'Valida Existencia @@ -6334,9 +6335,9 @@ Partial Class PV End Sub Private Function ValidaSerieINV() As Boolean - Dim Retorno = False - Dim Existencia = 0.0 - Dim ExistenciaActual = 0.0 + Dim Retorno As Boolean = False + Dim Existencia As Decimal = 0 + Dim ExistenciaActual As Decimal = 0 Dim ObjInventarios As New ClsInventarios For Each Gvr As GridViewRow In GvInv.Rows @@ -6351,7 +6352,7 @@ Partial Class PV If Gvr.FCTextBox("TxtSerie").Visible = True And Gvr.FCTextBox("TxtSerie").Text.Trim <> "" Then Existencia = ObjInventarios.GetExistenciasPSSerie(Gvr.FCTextBox("TxtSerie").Text.ToString, ddlAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) - ExistenciaActual = DtInv.SUM("Cantidad", String.Format("Serie = '{0}'", Gvr.FCTextBox("TxtSerie").Text.Trim)) + ExistenciaActual = DtInv.SUMD("Cantidad", String.Format("Serie = '{0}'", Gvr.FCTextBox("TxtSerie").Text.Trim)) 'Valida Existencia If Existencia - ExistenciaActual < 0 Or Existencia = 0 Then @@ -6562,7 +6563,7 @@ Partial Class PV End If Dim EsPersonaMoral As Boolean = (RdTipoPersona.SelectedValue = "1") - Dim DtUsosCFDI = GlobalDTSATUsosCFDI(If(Not EsPersonaMoral, 1, 0), RegimenFiscalReceptor:=RegimenFiscalCliente).FiltraParametros($"CveUsoCFDI = {CveUsoCFDI}") + Dim DtUsosCFDI As DataTable = GlobalDTSATUsosCFDI(If(Not EsPersonaMoral, 1, 0), RegimenFiscalReceptor:=RegimenFiscalCliente).FiltraParametros($"CveUsoCFDI = {CveUsoCFDI}") If DtUsosCFDI.Rows.Count = 0 Then Alert("El Uso CFDI no corresponde con el tipo de persona (fisca, moral) y el régimen fiscal.", TipoMensaje.MsgAdvertencia) @@ -6582,7 +6583,7 @@ Partial Class PV Dim ObjCliente As New ClsClientes Dim TipoPersona As Boolean = If(RdTipoPersona.SelectedValue.ToEntero = 1, True, False) - Dim GeneroCliente = If(DdlGeneroCliente.SelectedValue.ToEntero = 1 Or DdlGeneroCliente.SelectedValue.ToEntero = -1, True, False) + Dim GeneroCliente As Boolean = If(DdlGeneroCliente.SelectedValue.ToEntero = 1 Or DdlGeneroCliente.SelectedValue.ToEntero = -1, True, False) If ObjCliente.AgregarClienteNoFrecuente(TxtNombreCliente.Text.Trim, TxtDireccionCliente.Text.Trim, TxtNumExtCliente.Text.Trim, TxtNumIntCliente.Text.Trim, TxtColoniaCliente.Text.Trim, TxtLocalidadCliente.Text.Trim, TxtCiudadCliente.Text.Trim, DdlEstadoSAT.SelectedValue.ToEntero, @@ -6980,7 +6981,7 @@ Partial Class PV DdlTipoDefecto.DataSource = GlobalDTAcumTiposDefecto(UsuarioActual.CveEmpresa) DdlTipoDefecto.Items.Insert(0, New ListItem("Seleccione", "-1")) - Dim DtTamanios = GlobalDTAcumTamaños(UsuarioActual.CveEmpresa).FiltraParametros($" CvePSCargo > 0") + Dim DtTamanios As DataTable = GlobalDTAcumTamaños(UsuarioActual.CveEmpresa).FiltraParametros($" CvePSCargo > 0") CargaModelos() CargaBCIAjuste() @@ -7018,6 +7019,7 @@ Partial Class PV DtModelosAuto = ObjGral.DtResultados DdlModeloAuto.DataSource = DtModelosAuto End If + ObjGral.Dispose() DdlModeloAuto.DataBind() DdlModeloAuto.Items.Insert(0, New ListItem("-", "-1")) End Sub @@ -7266,7 +7268,7 @@ Partial Class PV If PrecioSugerido = 0 Then Dim ObjInventarios As New ClsInventarios - Dim CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1) + Dim CostoPS As Decimal = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1) 'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal If CostoPS = 0 Then CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1) ObjInventarios.Dispose() @@ -7969,10 +7971,8 @@ Partial Class PV End If Dim ListaPScargo As New List(Of Modelos.MConceptoUsado) - Dim DTTamanios As DataTable = GlobalDTAcumTamaños(UsuarioActual.CveEmpresa) - Dim DTCvePSCostos = DTTamanios.FiltraParametros("", "", {"CvePSCargo"}) - + Dim DTCvePSCostos As DataTable = DTTamanios.FiltraParametros("", "", {"CvePSCargo"}) Dim CveUnidadMedidaPSA As Integer = -1 Dim UnidadMedidaPSA As String = "Unidad" @@ -8060,7 +8060,7 @@ Partial Class PV Next ObjProductosServicios.Dispose() - Dim ModalidadBack = Modalidad + Dim ModalidadBack As String = Modalidad 'CAMBIA LA MODALIDAD PARA AGREGAR LOS PS CARGO If Modalidad = "U" Then Modalidad = "A" From 16757f9c4c4e49e1145d74b9c3a8eeae8a0a2429 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 18 Sep 2023 09:05:36 -0700 Subject: [PATCH 08/35] -option explicit --- Compras/Compras.aspx.vb | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 68635efc3..73c85db4f 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -6590,6 +6590,7 @@ Partial Class Compras_Compras 'Dim CveCon As Integer = ObtConceptoContableProvisionCompra(CveTipoConcepto, DdlTipoComprobante.SelectedValue, DdlMoneda.SelectedValue.ToEntero, False) If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importeMovimiento, importeMovimiento, ConPreP.CveConcepto, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=importeMovimiento, Contabilizable:=SeContabiliza, TipoCambio:=tipoCambioActual) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importeMN - importeMovimiento, importeMN - importeMovimiento, ConPreP.CveConceptoComplementario, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=importeMovimiento, Contabilizable:=SeContabiliza, TipoCambio:=tipoCambioActual) Then ErrorPrepoliza = True Exit Select @@ -10187,7 +10188,7 @@ Partial Class Compras_Compras e.Row.FCButton("BtnSerieLote").CommandArgument = String.Format("{0}°{1}°{2}°{3}°{4}", e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveUM"), e.Row.DBCampo("PU"), e.Row.DBCampo("PS"), e.Row.DBCampo("Cantidad")) e.Row.FCTextBox("TbCantidad").Enabled = False e.Row.FCCheckBox("cbInv").Enabled = False - Dim Contador = DtDatosDetalle.FiltraParametros(String.Format("CvePS = {0}", e.Row.DataKey("CvePS"))).Rows.Count + Dim Contador As Integer = DtDatosDetalle.FiltraParametros(String.Format("CvePS = {0}", e.Row.DataKey("CvePS"))).Rows.Count e.Row.FCTextBox("TbCantidad").Text = Contador.ToString 'e.Row.FCTextBox("TbCantidadF").Text = "0" Else @@ -10340,7 +10341,7 @@ Partial Class Compras_Compras If UsuarioActual.CveEmpresa = 13 Then If GvInv.Rows.Count > 0 AndAlso GvInv.HeaderRow().FCDropDownList("ddlAlmacen").SelectedValue.ToEntero > 0 Then - Dim DrAlmacen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveAlmacen = {0}", GvInv.HeaderRow().FCDropDownList("ddlAlmacen").SelectedValue.ToEntero)) + Dim DrAlmacen As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveAlmacen = {0}", GvInv.HeaderRow().FCDropDownList("ddlAlmacen").SelectedValue.ToEntero)) If DrAlmacen("CveTipoAlmacen").ToString = "7" Then TableAlmacenEvidencia.Visible = True End If @@ -10430,7 +10431,7 @@ Partial Class Compras_Compras Protected Sub DdlProyectoPersonal_SelectedIndexChanged(sender As Object, e As EventArgs) Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, DropDownList)).NamingContainer, GridViewRow) - Dim CveProyecto = If(gvRow.FCDropDownList("DdlProyectoPersonal").SelectedValue.ToEntero > 0, gvRow.FCDropDownList("DdlProyectoPersonal").SelectedValue.ToEntero, -1) + Dim CveProyecto As Integer = If(gvRow.FCDropDownList("DdlProyectoPersonal").SelectedValue.ToEntero > 0, gvRow.FCDropDownList("DdlProyectoPersonal").SelectedValue.ToEntero, -1) gvRow.FCDropDownList("DdlSubProyectoPersonal").Items.Clear() If CveProyecto > 0 Or UsuarioActual.Empresa.Tipo_CentroCosto.Contiene(1, 2) Then gvRow.FCDropDownList("DdlSubProyectoPersonal").DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, CveProyecto, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(CveProyecto, -1, UsuarioActual.CveEmpresa, 1)) @@ -10441,8 +10442,8 @@ Partial Class Compras_Compras Protected Sub DdlSubProyectoPersonal_SelectedIndexChanged(sender As Object, e As EventArgs) Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, DropDownList)).NamingContainer, GridViewRow) - Dim CveProyecto = If(gvRow.FCDropDownList("DdlProyectoPersonal").SelectedValue.ToEntero > 0, gvRow.FCDropDownList("DdlProyectoPersonal").SelectedValue.ToEntero, -1) - Dim CveSubProyecto = If(gvRow.FCDropDownList("DdlSubProyectoPersonal").SelectedValue.ToEntero > 0, gvRow.FCDropDownList("DdlSubProyectoPersonal").SelectedValue.ToEntero, -1) + Dim CveProyecto As Integer = If(gvRow.FCDropDownList("DdlProyectoPersonal").SelectedValue.ToEntero > 0, gvRow.FCDropDownList("DdlProyectoPersonal").SelectedValue.ToEntero, -1) + Dim CveSubProyecto As Integer = If(gvRow.FCDropDownList("DdlSubProyectoPersonal").SelectedValue.ToEntero > 0, gvRow.FCDropDownList("DdlSubProyectoPersonal").SelectedValue.ToEntero, -1) Dim dr1 As DataRow = TmpDT.Rows(gvRow.RowIndex) dr1("CveProyecto") = CveProyecto dr1("CveSubProyecto") = CveSubProyecto @@ -10638,7 +10639,7 @@ Partial Class Compras_Compras End Sub Protected Sub GvAFCompras_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvAFCompras.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - Dim SinValor = True + Dim SinValor As Boolean = True If e.Row.DBCampo("TipoAF").ToEntero = 2 Then If e.Row.DBCampo("CveActivoFijo").ToEntero > 0 Then @@ -10669,7 +10670,7 @@ Partial Class Compras_Compras End Sub Protected Sub GvAFInsumos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvAFInsumos.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - Dim SinValor = True + Dim SinValor As Boolean = True If e.Row.DBCampo("TipoAF").ToEntero = 1 Then If e.Row.DBCampo("CveActivoFijo").ToEntero > 0 Then @@ -10888,10 +10889,10 @@ Partial Class Compras_Compras #Region "TAB ALMACEN - INVENTARIOS ISRAEL PIÑA - 5 FEBRERO 2015" Protected Sub CalculaTotalPorDevengar() - Dim total = TxtTotal.Text.ToDouble + Dim total As Decimal = TxtTotal.Text.ToDecimal For Each Gvr As GridViewRow In GvInv.Rows If Gvr.FCCheckBox("cbInv").Checked = True And Gvr.FCDropDownList("DdlRecibirInv").SelectedValue = "1" Then - total -= Math.Round(Gvr.FCTextBox("TbCantidad").Text.ToDouble * Gvr.DataKey("PU").ToDouble, 4) + total -= Math.Round(Gvr.FCTextBox("TbCantidad").Text.ToDecimal * Gvr.DataKey("PU").ToDecimal, 4) End If Next 'LbTotalPorDevengar.Text = total.ToString.FormatoNumero @@ -11544,7 +11545,7 @@ Partial Class Compras_Compras Private Sub ConservaAC() 'Guarda valores AC en TmpDT - Dim Index = 0 + Dim Index As Integer = 0 For Each gvr As GridViewRow In GvPS.Rows TmpDT.Rows(Index)("CveProgramaOperativo") = gvr.FCDropDownList("DdlAC1").SelectedValue.ToEntero TmpDT.Rows(Index)("CveUnidadAdministrativa") = gvr.FCDropDownList("DdlAC2").SelectedValue.ToEntero @@ -11591,9 +11592,9 @@ Partial Class Compras_Compras Private Sub CalculaSaldoACGeneral() Dim ContPaq As New ClsContPAQi(UsuarioActual.Empresa) - Dim DtPresupuestosTemp = DtPresupuestos.FiltraParametros(String.Format("CveProgramaOperativo = {0} and CveUnidadAdministrativa = {1} and CveFuenteFinanciamiento = {2} and CveTipoGasto= {3} and CveClasificacion = {4}", DdlACGeneral1.SelectedValue.ToString, DdlACGeneral2.SelectedValue.ToString, DdlACGeneral3.SelectedValue.ToString, DdlACGeneral4.SelectedValue.ToString, DdlACGeneral5.SelectedValue.ToString)) + Dim DtPresupuestosTemp As DataTable = DtPresupuestos.FiltraParametros(String.Format("CveProgramaOperativo = {0} and CveUnidadAdministrativa = {1} and CveFuenteFinanciamiento = {2} and CveTipoGasto= {3} and CveClasificacion = {4}", DdlACGeneral1.SelectedValue.ToString, DdlACGeneral2.SelectedValue.ToString, DdlACGeneral3.SelectedValue.ToString, DdlACGeneral4.SelectedValue.ToString, DdlACGeneral5.SelectedValue.ToString)) If DtPresupuestosTemp.Rows.Count > 0 Then - Dim IdCuenta = If(HdnVCveOC.Value <> "-1", DtPresupuestosTemp.Rows(0)("IdCuentaDevengado").ToString.ToEntero, DtPresupuestosTemp.Rows(0)("IdCuentaPorEjercer").ToString.ToEntero) + Dim IdCuenta As Integer = If(HdnVCveOC.Value <> "-1", DtPresupuestosTemp.Rows(0)("IdCuentaDevengado").ToString.ToEntero, DtPresupuestosTemp.Rows(0)("IdCuentaPorEjercer").ToString.ToEntero) LbACGeneralSaldo.Text = ContPaq.GetSaldoCuenta(IdCuenta, 0, TxtFecha.Text.ToDate.Year).ToString.FormatoNumero(2) Else @@ -11627,7 +11628,7 @@ Partial Class Compras_Compras Private Sub CompruebaAgregar() Dim ContPaq As New ClsContPAQi(UsuarioActual.Empresa) Dim disponible As Double - Dim ErrorPresupuesto = False + Dim ErrorPresupuesto As Boolean = False Dim Conceptos As New StringBuilder Dim Ddl1 As DropDownList @@ -11715,7 +11716,7 @@ Partial Class Compras_Compras End Sub Private Sub CambiaEjercicioAC(Optional CargaTodo As Boolean = True) - Dim Ejercicio = If(IsDate(TxtFecha.Text), Year(TxtFecha.Text.ToDate), UsuarioActual.Empresa.EjercicioActual) + Dim Ejercicio As Integer = If(IsDate(TxtFecha.Text), Year(TxtFecha.Text.ToDate), UsuarioActual.Empresa.EjercicioActual) If Ejercicio <> EjercicioAC Then Dim AC As New ClsAC @@ -11857,7 +11858,7 @@ Partial Class Compras_Compras 'Exit Sub Dim ObjConta As New ClsContabilidad - Dim Movimientos = ObjConta.GetMovimientosPoliza(IdPoliza, UsuarioActual.CveEmpresa) + Dim Movimientos As Integer = ObjConta.GetMovimientosPoliza(IdPoliza, UsuarioActual.CveEmpresa) 'Verifica que solo exista 1 compra asociada If Movimientos = 1 Then @@ -11886,7 +11887,7 @@ Partial Class Compras_Compras If IdPoliza > 0 Then ObjContaAC.RemoveAllMovimientos(IdPoliza) Else - Dim TotalPorDevengar = Math.Round(TxtTotal.Text.ToDouble, 2) + Dim TotalPorDevengar As Decimal = Math.Round(TxtTotal.Text.ToDecimal, 2) IdPoliza = ObjContaAC.AddPoliza(3, TxtDescripcion.Text.Trim, TotalPorDevengar, TotalPorDevengar, UsuarioActual.CveUsuario, TxtFecha.Text.ToDate) End If @@ -12460,7 +12461,7 @@ Partial Class Compras_Compras End Sub Protected Sub ddlAlmacenConsignacionGeneral_SelectedIndexChanged(sender As Object, e As EventArgs) - Dim DdlAlmacenConsignacionGeneral = CType(sender, DropDownList) + Dim DdlAlmacenConsignacionGeneral As DropDownList = CType(sender, DropDownList) For Each gvr As GridViewRow In GvInv.Rows gvr.FCDropDownList("ddlAlmacenConsignacion").SelectedValue = DdlAlmacenConsignacionGeneral.SelectedValue @@ -12473,8 +12474,8 @@ Partial Class Compras_Compras UpINV.Update() End Sub Protected Sub ddlAlmacenConsignacion_SelectedIndexChanged(sender As Object, e As EventArgs) - Dim DdlAlmacenConsignacion = CType(sender, DropDownList) - Dim DdlVinculaConsignacion = CType(CType(sender, DropDownList).NamingContainer, GridViewRow).FCDropDownList("DdlVinculaConsignacion") + Dim DdlAlmacenConsignacion As DropDownList = CType(sender, DropDownList) + Dim DdlVinculaConsignacion As DropDownList = CType(CType(sender, DropDownList).NamingContainer, GridViewRow).FCDropDownList("DdlVinculaConsignacion") ''CARGA CONSIGNACIONES DdlVinculaConsignacion.DataSource = DtConsignaciones.FiltraParametros(String.Format("CveAlmacenSalida = {0} OR {0} = '-1'", DdlAlmacenConsignacion.SelectedValue)) From d3062c2f93bfb920eacc2eef02cff4c16b0beef3 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 18 Sep 2023 09:08:24 -0700 Subject: [PATCH 09/35] =?UTF-8?q?--=20option=20explicit=20--=20sino=20est?= =?UTF-8?q?=C3=A1=20surtida=20la=20remisi=C3=B3n,=20no=20se=20puede=20fact?= =?UTF-8?q?urar.=20E119?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/Ventas.aspx | 2 +- Ventas/Ventas.aspx.vb | 748 ++++++++++++++++++++---------------------- 2 files changed, 354 insertions(+), 396 deletions(-) diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 8f0a0df7d..6b88ea977 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -5335,7 +5335,7 @@ - + diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 946d634ed..e3a3ec63e 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -4,16 +4,13 @@ Option Strict On Imports System.Data Imports System.Data.SqlClient Imports System.Diagnostics -Imports System.Globalization Imports System.IO Imports System.Net.Http Imports System.Security.Cryptography.X509Certificates -Imports System.Xml Imports ADSNetLibrary.SIGAPI.Models.CRM.Request Imports ADSNetLibrary.SIGAPI.Services.CRM Imports ADSTimbrado Imports Extensiones -Imports Microsoft.Owin.Security.Provider Imports Microsoft.Reporting.WebForms Imports Newtonsoft.Json.Linq @@ -3252,7 +3249,7 @@ Partial Class Ventas CargaMetodosPSModal() 'CARGA VALORES DE ORDEN DE PRODUCCION - Dim CveOrdenProduccion = IfNull(Request("CveOrdenProduccion"), "-1").ToString().ToEntero() + Dim CveOrdenProduccion As Integer = IfNull(Request("CveOrdenProduccion"), "-1").ToString().ToEntero() If CveOrdenProduccion > 0 And Not CveVenta > 0 Then DdlOrdenProduccion.SelectedValueExist(CveOrdenProduccion) If DdlOrdenProduccion.SelectedValue.ToEntero() > 0 Then @@ -4448,7 +4445,7 @@ Partial Class Ventas End Sub Private Sub CargaEstatusFactura(Optional TipoDocto As String = "Ing") - Dim FiltroCompromiso = If(TipoDocto = "Com", "And CveEstatusFactura In (2, 9)", "And CveEstatusFactura Not In (9)") + Dim FiltroCompromiso As String = If(TipoDocto = "Com", "And CveEstatusFactura In (2, 9)", "And CveEstatusFactura Not In (9)") If TipoDocto.ToUpper.Contiene("EGS", "COM", "ANT") Then TipoDocto = "Ing" @@ -7474,7 +7471,7 @@ Partial Class Ventas If CveClienteSuc > 0 Then If ObjCliente.GetSucursales(CveCliente, CveClienteSuc) Then If ObjCliente.DtResultados.Rows.Count > 0 Then - Dim Correo = ObjCliente.DtResultados.Rows(0)("Correo").ToString() + Dim Correo As String = ObjCliente.DtResultados.Rows(0)("Correo").ToString() If Correo.Trim.Length > 0 Then ViewState("Mail") = Correo End If @@ -7809,7 +7806,7 @@ Partial Class Ventas End Sub Public Sub CargaDdlNCPS() - Dim CveSATNC = "84111506" + Dim CveSATNC As String = "84111506" Dim dtt As New DataTable dtt = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1) ', SATClavePS:=CveSATNC @@ -8063,9 +8060,7 @@ Partial Class Ventas e.Row.FCLinkButton("imgE").Visible = False e.Row.FCLinkButton("imgD").Visible = False End If - End If - End If If UsuarioActual.Empresa.Funcionalidad(360) = "1" AndAlso e.Row.DBCampo("CvePrecioLista").ToEntero() > 0 Then @@ -8282,10 +8277,10 @@ Partial Class Ventas If Not CveContrato > 0 Then 'BANDERAS PARA VALIDACIONES - Dim EsValido = False - Dim EsValidoMayor = False - Dim CostoMenor = 0.0D - Dim CostoMayor = 0.0D + Dim EsValido As Boolean = False + Dim EsValidoMayor As Boolean = False + Dim CostoMenor As Decimal = 0 + Dim CostoMayor As Decimal = 0 'PRECIO MINIMO If UsuarioActual.Empresa.Funcionalidad(129).ToEntero() > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then @@ -8364,7 +8359,7 @@ Partial Class Ventas End If If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso ListaDescuentos IsNot Nothing AndAlso ObjDescuento IsNot Nothing Then - Dim ConsecEliminar = TmpDT.Rows(e.RowIndex)("Consec").ToString().ToEntero() + Dim ConsecEliminar As Integer = TmpDT.Rows(e.RowIndex)("Consec").ToString().ToEntero() If ConsecEliminar > 0 Then Dim descEliminar = ListaDescuentos.FirstOrDefault(Function(x) x.Consec = ConsecEliminar) If descEliminar IsNot Nothing Then @@ -8411,22 +8406,18 @@ Partial Class Ventas Else Dim DrPS As DataRow = Nothing - DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=TmpDT.Rows(e.RowIndex)("CvePS").ToString().ToEntero()).FiltroPrimero("") If Not ClienteDesglosaIEPS Then PU = PU * (1 + DrPS("IEPSPorcentaje").ToString().ToDecimal) - TmpDT.Rows(e.RowIndex)("PorcentajeIEPS") = 0 - End If Dim TotalCalculableImpuestos As Decimal = ((Cantidad * PU) - (ObjDescuento.ImporteDescuento)) Dim TotalCalculableImpuestosIVA As Decimal = 0 TotalCalculableImpuestosIVA = TotalCalculableImpuestos * (1 + TmpDT.Rows(e.RowIndex)("PorcentajeIEPS").ToString().ToDecimal) - Dim ClienteRetIVA = Me.ClienteRetIVA - + Dim ClienteRetIVA As Decimal = Me.ClienteRetIVA If ClienteRetIVA <= 0 Then If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then ClienteRetIVA = 0.106667D @@ -9089,65 +9080,65 @@ Partial Class Ventas 'SI TIENE LINEA ADICIONAL NO VERIFICAR LIMITE DE CREDITO 'SI NO TIENE AUTORIZACION VERIFICAR LIMITE DE CREDITO Y CANDADOS DE VENTA 'No exceder el limite de credito, Si no tiene contrato limita el credito, si tiene no hace nada. Si no tiene remisiones tampoco hace nada. - If DdlLineaAdicional.SelectedValue.ToEntero() <= 0 AndAlso Me.CveAutorizacion <= 0 AndAlso (Not CveContrato > 0 Or CveContratoTipo.Contiene(28)) AndAlso (Not NuevaFactura = 1) AndAlso RBLPago.SelectedValue = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") AndAlso RemisionesLista.Count <= 0 AndAlso TxtTotal.Text.ToDecimal > 0 AndAlso Not CvePedidoA > 0 Then - 'If UsuarioActual.Empresa.Funcionalidad(518) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(185) Then + 'If DdlLineaAdicional.SelectedValue.ToEntero() <= 0 AndAlso Me.CveAutorizacion <= 0 AndAlso (Not CveContrato > 0 Or CveContratoTipo.Contiene(28)) AndAlso (Not NuevaFactura = 1) AndAlso RBLPago.SelectedValue = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") AndAlso RemisionesLista.Count <= 0 AndAlso TxtTotal.Text.ToDecimal > 0 AndAlso Not CvePedidoA > 0 Then + ' 'If UsuarioActual.Empresa.Funcionalidad(518) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(185) Then - If Not UsuarioActual.Empresa.Funcionalidad(702) = "1" Then - Dim ObjVentas As New ClsVentas + ' If Not UsuarioActual.Empresa.Funcionalidad(702) = "1" Then + ' Dim ObjVentas As New ClsVentas - If ObjVentas.ObtenerCreditoRestante(CveCliente, DdlSucursalCliente.SelectedValue.ToEntero()) Then - If ObjVentas.DtResultados.Rows.Count > 0 Then + ' If ObjVentas.ObtenerCreditoRestante(CveCliente, DdlSucursalCliente.SelectedValue.ToEntero()) Then + ' If ObjVentas.DtResultados.Rows.Count > 0 Then - If DdlSucursalCliente.SelectedValue.ToEntero() > 0 Then - If ObjVentas.DtResultados(0)("LimiteRestanteSucursal").ToString().ToDecimal - If(TxtTipoCambio.Visible, TxtTotal.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal, TxtTotal.Text.ToDecimal) < 0 Then - ObjVentas.Dispose() - Alert("Se está excediendo el límite de credito permitido de la Sucursal del Cliente.", TipoMensaje.MsgInformacion) - Exit Sub - End If - Else - If ObjVentas.DtResultados(0)("LimiteRestanteCliente").ToString().ToDecimal - If(TxtTipoCambio.Visible, TxtTotal.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal, TxtTotal.Text.ToDecimal) < 0 Then - ObjVentas.Dispose() - Alert("Se está excediendo el límite de credito permitido del Cliente.", TipoMensaje.MsgInformacion) - Exit Sub - End If - End If + ' If DdlSucursalCliente.SelectedValue.ToEntero() > 0 Then + ' If ObjVentas.DtResultados(0)("LimiteRestanteSucursal").ToString().ToDecimal - If(TxtTipoCambio.Visible, TxtTotal.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal, TxtTotal.Text.ToDecimal) < 0 Then + ' ObjVentas.Dispose() + ' Alert("Se está excediendo el límite de credito permitido de la Sucursal del Cliente.", TipoMensaje.MsgInformacion) + ' Exit Sub + ' End If + ' Else + ' If ObjVentas.DtResultados(0)("LimiteRestanteCliente").ToString().ToDecimal - If(TxtTipoCambio.Visible, TxtTotal.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal, TxtTotal.Text.ToDecimal) < 0 Then + ' ObjVentas.Dispose() + ' Alert("Se está excediendo el límite de credito permitido del Cliente.", TipoMensaje.MsgInformacion) + ' Exit Sub + ' End If + ' End If - Else - ObjVentas.Dispose() - Alert("Ocurrio un error al obtener el limite de credito del cliente", TipoMensaje.MsgError) - Exit Sub - End If - Else - ObjVentas.Dispose() - Alert("Ocurrio un error al obtener el limite de credito del cliente", TipoMensaje.MsgError) - Exit Sub - End If - ObjVentas.Dispose() + ' Else + ' ObjVentas.Dispose() + ' Alert("Ocurrio un error al obtener el limite de credito del cliente", TipoMensaje.MsgError) + ' Exit Sub + ' End If + ' Else + ' ObjVentas.Dispose() + ' Alert("Ocurrio un error al obtener el limite de credito del cliente", TipoMensaje.MsgError) + ' Exit Sub + ' End If + ' ObjVentas.Dispose() - 'VERIFICA SI TIENE BLOQUEO POR DIAS VENCIDOS - If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then - Dim Vta As New ClsVentas - Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa, TipoVerificacion:=2) - Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón:

{0}", Vta.SerieVenta) - Vta.Dispose() + ' 'VERIFICA SI TIENE BLOQUEO POR DIAS VENCIDOS + ' If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + ' Dim Vta As New ClsVentas + ' Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa, TipoVerificacion:=2) + ' Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón:

{0}", Vta.SerieVenta) + ' Vta.Dispose() - If Opcion = 2 Then - Alert(OpcionMsg, TipoMensaje.MsgError) - Exit Sub - End If - End If + ' If Opcion = 2 Then + ' Alert(OpcionMsg, TipoMensaje.MsgError) + ' Exit Sub + ' End If + ' End If - End If + ' End If - 'End If - End If + ' 'End If + 'End If 'VALIDAR LINEAS ADICIONALES If UsuarioActual.Empresa.Funcionalidad(705) = "1" AndAlso DdlLineaAdicional.SelectedValue.ToEntero() > 0 Then 'VERIFICA QUE LA CATEGORIA DE LOS PRODUCTOS DEBE SER LA MISMA DE LA LINEA ADICIONAL If TmpDT IsNot Nothing AndAlso Me.CveCategoriaLineaAdicional > 0 Then For Each Row As DataRow In TmpDT.FiltraParametros("", DistinctColumns:={"CveClasificacion"}).Rows - Dim RowClasificacion = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=Row("CveClasificacion").ToString().ToEntero()).FiltroPrimero("") + Dim RowClasificacion As DataRow = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=Row("CveClasificacion").ToString().ToEntero()).FiltroPrimero("") If RowClasificacion IsNot Nothing Then Dim CveCategoria As Integer = RowClasificacion("CveCategoria").ToString().ToEntero() @@ -9439,6 +9430,23 @@ Partial Class Ventas If ValidaPagosContado(TipoDoctoViejo:=TipoDoctoViejo) Then Exit Sub End If + 'validaciones, si es Anticipo solo permitir "servicios de facturación" y si es ingreso todos menos serv. factu + If UsuarioActual.CveEmpresa = 119 Then + If DdlTipoComprobante.SelectedValue = "Ing" Then + Dim tCont As Integer = TmpDT.FiltraParametros("SATClaveProdServ='84111506'").Rows.Count + If tCont > 0 Then + Alert("Existen productos con código SAT '84111506' no permitido al facturar ingresos.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + End If + If DdlTipoComprobante.SelectedValue = "Ant" Then + Dim tCont As Integer = TmpDT.FiltraParametros("SATClaveProdServ<>'84111506'").Rows.Count + If tCont > 0 Then + Alert("Al facturar 'Anticipos' solo son permitidos código SAT '84111506'.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + End If + End If 'CREA UNA COPIA DE SEGURIDAD PARA LOS DATOS DEL TMPDT If TmpDTError Is Nothing OrElse TmpDTError.Rows.Count = 0 Then @@ -9448,7 +9456,7 @@ Partial Class Ventas If UsuarioActual.CveRol = 1 AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso TbDescuentosAdicionales.Visible Then If LblDescuentoAdicional.Text.ToDecimal() > 0 Then Dim TotalDescuento As Decimal = LblDescuentoAdicional.Text.ToDecimal() / (1D + TmpDT.MAX("PorcentajeIVA").ToString().ToDecimal()) - Dim RowDescuentos = TmpDT.Select("Descuento > 0") + Dim RowDescuentos As DataRow() = TmpDT.Select("Descuento > 0") If RowDescuentos IsNot Nothing Then @@ -9867,12 +9875,12 @@ Partial Class Ventas 'SOLO GENERAR NC POR DESCUENTO PRONTO PAGO SI EL PAGO ES DE CONTADO If ErrorList.Count = 0 AndAlso RBLPago.SelectedValue = "2" AndAlso ObjFactura.DescuentoProntoPago > 0 Then - Dim ImportePagado = DtPagos.SUM("Importe").ToString().ToDecimal + Dim ImportePagado As Decimal = DtPagos.SUMD("Importe") Dim ImporteRNC As Decimal = LblDescuentosRNC.Text.ToDecimal() If (ImportePagado + ImporteRNC + ObjFactura.DescuentoProntoPago) >= ObjFactura.Total Then - Dim RespFacturaProntoPago = GenerarNCProntoPago(ObjVentas.IniciaTransacSQL(), ObjClientes, ObjFactura) + Dim RespFacturaProntoPago As Modelos.MensajeProntoPago = GenerarNCProntoPago(ObjVentas.IniciaTransacSQL(), ObjClientes, ObjFactura) If RespFacturaProntoPago.ObjFacturaProntoPago Is Nothing OrElse RespFacturaProntoPago Is Nothing Then ErrorList.Add("No se pudo generar la nota de crédito de pronto pago") @@ -10111,7 +10119,7 @@ Partial Class Ventas Dim SeTimbro As Boolean = False Dim SeTimbroNC As Boolean = False - Dim EstatusSMS = 0 + Dim EstatusSMS As Integer = 0 Dim MsgCancelacionRefacturacion As Modelos.Factura.MCancelacionVentaMensaje = Nothing @@ -10150,7 +10158,7 @@ Partial Class Ventas End If If ChkEmitirCartaPorte.Checked AndAlso CveTimbreCartaPorte > 0 Then - Dim RespCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorte, UsuarioActual) + Dim RespCartaPorte As Timbres.MMensajeCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorte, UsuarioActual) If Not RespCartaPorte.TieneError Then ObjFactura.Timbre.Complementos.CartaPorte = RespCartaPorte.CartaPorte Else @@ -10167,13 +10175,13 @@ Partial Class Ventas End Try Dim FolioFiscalFactura As String = ObjTimbrado.UUID - Dim MsgErrorTimbrado = ObjTimbrado.MensajeErrorCFDI + Dim MsgErrorTimbrado As String = ObjTimbrado.MensajeErrorCFDI ObjTimbrado = Nothing 'NOTA DE CREDITO - REFACTURADA - CASO ESPECIAL, TIMBRADO E IMPRESION If DebeTimbrar AndAlso SeTimbro AndAlso ListaNotasCreditoGeneradas IsNot Nothing AndAlso ListaNotasCreditoGeneradas.Count > 0 Then Try - For Each NCGenerada In ListaNotasCreditoGeneradas + For Each NCGenerada As Modelos.Factura In ListaNotasCreditoGeneradas If NCGenerada.Timbre IsNot Nothing Then NCGenerada.Timbre.CFDIRelacionados.UUID.Clear() NCGenerada.Timbre.CFDIRelacionados.UUID.Add(FolioFiscalFactura) @@ -10258,15 +10266,15 @@ Partial Class Ventas ' DESCARGA XML - SI SE TIMBRA MANDA CORREO CON FACTURA If SeTimbro Then - Dim ArchivoXML = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio) + Dim ArchivoXML As String = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio) If File.Exists(ArchivoXML) Then MensajeAlert.AppendFormat("", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", ObjFactura.SerieFolio, ObjFactura.TipoDocto))) End If Try 'MANDA CORREO - Dim strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port) - Dim Factura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False, CargaDTDetalle:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False, VerificaAlmacen:=False) + Dim strURLHOST As String = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port) + Dim Factura As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False, CargaDTDetalle:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False, VerificaAlmacen:=False) Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, Factura, UsuarioActual, strURLHOST)) Hilo.Start() Catch ex As Exception @@ -10476,7 +10484,7 @@ Partial Class Ventas Else ObjVentas.RollBack() - For Each ErrorItem In ErrorList + For Each ErrorItem As String In ErrorList Alert(ErrorItem, TipoMensaje.MsgAdvertencia) Next @@ -10501,7 +10509,7 @@ Partial Class Ventas Else ObjVentas.RollBack() - For Each ErrorItem In ErrorList + For Each ErrorItem As String In ErrorList Alert(ErrorItem, TipoMensaje.MsgAdvertencia) Next @@ -10610,28 +10618,19 @@ Partial Class Ventas End If ObjFacturaDevolucion.Fecha = Now - ObjFacturaDevolucion.Version = "4.0" - - If ObjFacturaDevolucion.Cliente Is Nothing Then - ObjFacturaDevolucion.Cliente = New Modelos.ClienteModel - End If - + If ObjFacturaDevolucion.Cliente Is Nothing Then ObjFacturaDevolucion.Cliente = New Modelos.ClienteModel ObjFacturaDevolucion.Cliente.CodigoRegimenFiscal = ClienteCodigoRegimenFiscal ObjFacturaDevolucion.Cliente.RegimenFiscal = ClienteRegimenFiscal - ObjFacturaDevolucion.CveMetodoPago33 = 1 ObjFacturaDevolucion.MetodoPago33 = "Pago en una sola exhibición" ObjFacturaDevolucion.ClaveMetodoPagoSAT = "PUE" - ObjFacturaDevolucion.CveFormaPago33 = 21 ObjFacturaDevolucion.FormaPago33 = "Aplicación de anticipos" ObjFacturaDevolucion.FormaPagoSAT33 = "30" - ObjFacturaDevolucion.CveUsoCFDI = DdlUsoCFDI.SelectedValue.ToEntero() ObjFacturaDevolucion.UsoCFDI = DdlUsoCFDI.SelectedItem.Text ObjFacturaDevolucion.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", $"CveUsoCFDI = {DdlUsoCFDI.SelectedValue}") - ObjFacturaDevolucion.CveTipoRelacion = DdlTipoRelacionAnticipo.SelectedValue.ToEntero() ObjFacturaDevolucion.TipoRelacion = "07" @@ -10764,17 +10763,10 @@ Partial Class Ventas End If 'Totales, Y se llena TmpDTImpuestos - 'ObjFactura.BZDescripcion = TxtBZDescripcion.Text.Trim - 'ObjFactura.BZNombreCorto = TxtBZNombreCorto.Text.Trim - 'ObjFactura.BZTotalLetra = TxtBZTotalLetra.Text.Trim - - - 'otros ObjFacturaDevolucion.Det_FechaOrdenCompra = TxtDet_FechaOrdenCompra.Text.Trim ObjFacturaDevolucion.Det_OrdenCompra = TxtDet_OrdenCompra.Text.Trim - ObjFacturaDevolucion.CveNCaVincular = DdlNCFactura.SelectedValue.ToEntero() If ObjFacturaDevolucion.CveMoneda <> 1 AndAlso ChkConvertirDoctoPesos.Checked Then @@ -10811,8 +10803,6 @@ Partial Class Ventas ObjFacturaDevolucion.ClienteSucursal.TelefonoSucursal = LblTelefono.Text ObjFacturaDevolucion.ClienteSucursal.Sucursal = If(DdlSucursalCliente.SelectedValue.ToEntero() > 0, DdlSucursalCliente.SelectedItem.Text, "") - - ObjFacturaDevolucion.SetSubProyectoMatriz(Me) ObjFacturaDevolucion.SetSubProyecto(Me) @@ -10834,7 +10824,7 @@ Partial Class Ventas 'SI NO ES REFACTURACION If NuevaFactura <> 1 Then If DtVentasNC Is Nothing Then InicializaDTVentasNC() - Dim Drt = DtVentasNC.NewRow + Dim Drt As DataRow = DtVentasNC.NewRow Drt("CveVenta") = ObjFactura.CveVenta Drt("Importe") = 0 Drt("FolioFiscal") = ObjFactura.FolioFiscal @@ -11099,7 +11089,7 @@ Partial Class Ventas 'SI NO ES REFACTURACION If NuevaFactura <> 1 AndAlso Not AplicaDocumentoNuevoNC Then If DtVentasNC Is Nothing Then InicializaDTVentasNC() - Dim Drt = DtVentasNC.NewRow + Dim Drt As DataRow = DtVentasNC.NewRow Drt("CveVenta") = ObjFactura.CveVenta Drt("Importe") = 0 Drt("FolioFiscal") = ObjFactura.FolioFiscal @@ -11485,7 +11475,7 @@ Partial Class Ventas End If If DdlTipoComprobante.SelectedValue = "Dev" AndAlso ListaRemisionesNC IsNot Nothing AndAlso ListaRemisionesNC.Count > 0 Then - Dim ObjRNC = ListaRemisionesNC.FirstOrDefault + Dim ObjRNC As Modelos.Factura = ListaRemisionesNC.FirstOrDefault If ObjRNC IsNot Nothing Then ObjFactura.CveVentaPadre = ObjRNC.CveVentaPadre ObjFactura.SerieFolioPadre = ObjRNC.SerieFolioPadre @@ -11541,13 +11531,13 @@ Partial Class Ventas End If Next - ObjFactura.SubTotal = TmpDT.SUM("Total").ToDecimal - ObjFactura.Descuento = TmpDT.SUM("Descuento").ToDecimal + ObjFactura.SubTotal = TmpDT.SUMD("Total") + ObjFactura.Descuento = TmpDT.SUMD("Descuento") ObjFactura.Amortizacion = Math.Round(LblAmortizacion.Text.Trim.ToDecimal * ObjFactura.TipoCambio, NumeroDecimales) - ObjFactura.IVA = TmpDT.SUM("ImporteIVA").ToDecimal - ObjFactura.RetIVA = TmpDT.SUM("ImporteRetIVA").ToDecimal - ObjFactura.RetISR = TmpDT.SUM("ImporteRetISR").ToDecimal - ObjFactura.IEPS = TmpDT.SUM("ImporteIEPS").ToDecimal + ObjFactura.IVA = TmpDT.SUMD("ImporteIVA") + ObjFactura.RetIVA = TmpDT.SUMD("ImporteRetIVA") + ObjFactura.RetISR = TmpDT.SUMD("ImporteRetISR") + ObjFactura.IEPS = TmpDT.SUMD("ImporteIEPS") ObjFactura.Total = (ObjFactura.SubTotal - ObjFactura.Descuento - ObjFactura.Amortizacion + ObjFactura.IVA + ObjFactura.IEPS - ObjFactura.RetIVA - ObjFactura.RetISR - ImpuestosLocales).ToDecimal TipoCambioRemision = ObjFactura.TipoCambio @@ -11569,22 +11559,22 @@ Partial Class Ventas Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString().ToDouble / ObjFactura.TipoCambioDolares, NumeroDecimales) Next - Dim ImpuestosLocales As Double = 0 + Dim ImpuestosLocales As Decimal = 0 For Each gvr As GridViewRow In GvImpuestosLocales2.Rows If gvr.RowType = DataControlRowType.DataRow Then gvr.FCTextBox("TxtImpuestoLocalPS").Text = (gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble / ObjFactura.TipoCambioDolares).FormatoNumero - ImpuestosLocales += Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble / ObjFactura.TipoCambioDolares, NumeroDecimales) + ImpuestosLocales += Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDecimal / ObjFactura.TipoCambioDolares, NumeroDecimales) End If Next - ObjFactura.SubTotal = TmpDT.SUM("Total").ToDecimal - ObjFactura.Descuento = TmpDT.SUM("Descuento").ToDecimal + ObjFactura.SubTotal = TmpDT.SUMD("Total") + ObjFactura.Descuento = TmpDT.SUMD("Descuento") ObjFactura.Amortizacion = Math.Round(LblAmortizacion.Text.Trim.ToDecimal / ObjFactura.TipoCambioDolares, NumeroDecimales) - ObjFactura.IVA = TmpDT.SUM("ImporteIVA").ToDecimal - ObjFactura.RetIVA = TmpDT.SUM("ImporteRetIVA").ToDecimal - ObjFactura.RetISR = TmpDT.SUM("ImporteRetISR").ToDecimal - ObjFactura.IEPS = TmpDT.SUM("ImporteIEPS").ToDecimal - ObjFactura.Total = (ObjFactura.SubTotal - ObjFactura.Descuento - ObjFactura.Amortizacion + ObjFactura.IVA + ObjFactura.IEPS - ObjFactura.RetIVA - ObjFactura.RetISR - ImpuestosLocales).ToDecimal + ObjFactura.IVA = TmpDT.SUMD("ImporteIVA") + ObjFactura.RetIVA = TmpDT.SUMD("ImporteRetIVA") + ObjFactura.RetISR = TmpDT.SUMD("ImporteRetISR") + ObjFactura.IEPS = TmpDT.SUMD("ImporteIEPS") + ObjFactura.Total = (ObjFactura.SubTotal - ObjFactura.Descuento - ObjFactura.Amortizacion + ObjFactura.IVA + ObjFactura.IEPS - ObjFactura.RetIVA - ObjFactura.RetISR - ImpuestosLocales) TipoCambioRemision = ObjFactura.TipoCambioDolares ObjFactura.TipoCambioDolares = 1 @@ -11789,7 +11779,6 @@ Partial Class Ventas TmpDTImpuestosIVAIEPS.AcceptChanges() End If End If - Next ObjFactura.DtDesgloseImpuestos = TmpDTImpuestosIVAIEPS.FiltraParametros("", Orderby:="Orden ASC") @@ -11798,7 +11787,6 @@ Partial Class Ventas ObjFactura.Det_FechaOrdenCompra = TxtDet_FechaOrdenCompra.Text.Trim ObjFactura.Det_OrdenCompra = TxtDet_OrdenCompra.Text.Trim ObjFactura.Det_ContraRecibo = TxtDet_ContraRecibo.Text.Trim - ObjFactura.CveNCaVincular = DdlNCFactura.SelectedValue.ToEntero() If ObjFactura.CveMoneda <> 1 AndAlso ChkConvertirDoctoPesos.Checked Then @@ -11860,7 +11848,6 @@ Partial Class Ventas ObjFactura.ClienteSucursal.ImprimeNombreSucursal = ImprimeNombreSucursal.ToString() End If - 'ENVIO DIRECCION ObjFactura.EnviarA = New Modelos.EnviarAModel If ChkDireccionEnvio.Checked Then @@ -11938,7 +11925,7 @@ Partial Class Ventas For Each gvr As GridViewRow In GVAnticipos.Rows If gvr.FCCheckBox(String.Format("Chk{0}", gvr.RowIndex)).Checked AndAlso gvr.DataKey("CveConceptoContable") = "12" Then ' solo notas de crédito If DtVentasNC Is Nothing Then InicializaDTVentasNC() - Dim Drt = DtVentasNC.NewRow + Dim Drt As DataRow = DtVentasNC.NewRow Drt("CveVenta") = gvr.DataKey("CveVenta") Drt("Importe") = gvr.FCTextBox(String.Format("TxtAnticipo{0}", gvr.RowIndex)).Text Drt("FolioFiscal") = gvr.DataKey("FolioFiscal") @@ -11947,7 +11934,6 @@ Partial Class Ventas End If Next End If - End If If CveCliente > 0 Then ObjFactura.Timbre = PreParaTimbre(ObjFactura) @@ -11957,7 +11943,7 @@ Partial Class Ventas For Each gvr As GridViewRow In GvImpuestosLocales2.Rows If gvr.RowType = DataControlRowType.DataRow Then - Dim DrsImpuestos = TmpDTImpuestos.Select($"CveImpuestoLocal={gvr.DataKey("CveImpuestoLocal")}") + Dim DrsImpuestos As DataRow() = TmpDTImpuestos.Select($"CveImpuestoLocal={gvr.DataKey("CveImpuestoLocal")}") If DrsImpuestos IsNot Nothing AndAlso DrsImpuestos.Length = 1 Then DrsImpuestos(0)("Importe") = gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble @@ -12096,9 +12082,9 @@ Partial Class Ventas 'VALORES DEFAULT DE NC-DEV - Dim CveUsoCFDIOld = DdlUsoCFDI.SelectedValue - Dim MetodoPago33Old = DdlMetodoPago33.SelectedValue - Dim FormaPago33Old = DdlFormaPago33.SelectedValue + Dim CveUsoCFDIOld As String = DdlUsoCFDI.SelectedValue + Dim MetodoPago33Old As String = DdlMetodoPago33.SelectedValue + Dim FormaPago33Old As String = DdlFormaPago33.SelectedValue DdlUsoCFDI.SelectedValueExist("2") DdlMetodoPago33.SelectedValueExist("1") @@ -12516,7 +12502,7 @@ Partial Class Ventas tPS = tPS.Replace("|", " ") If tPS.Length >= 1000 Then - Dim tPSRecortado = tPS.Remove(999, tPS.Length - 999) + Dim tPSRecortado As String = tPS.Remove(999, tPS.Length - 999) tPS = tPSRecortado End If @@ -13029,10 +13015,6 @@ Partial Class Ventas End Sub #End Region - - - - #Region " GUARDAR - VENTA, PREPOLIZAS, INV, ESTIMACIONES, AC, NOTA DE CRÉDITO " Private Sub GuardarVenta(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjAcum As ClsAcumuladores, ByRef ObjContr As ClsContratos, factura As Modelos.Factura, ByRef TmpDTDetalle As DataTable, CveNCaVincular As Integer, Optional ByRef ObjBancos As ClsBancos = Nothing, Optional ByRef ObjOS As ClsOS = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing, ByRef Optional ObjCGame As ClsCGame = Nothing, @@ -13041,7 +13023,7 @@ Partial Class Ventas Dim Msgok As New StringBuilder Dim CveAlmacenTraspasoOrigen As Integer = -1 Dim CveAlmacenTraspasoDestino As Integer = -1 - Dim EsDevolucionVenta = -1 + Dim EsDevolucionVenta As Integer = -1 Dim EsInterno As Integer = -1 If DdlAlmacenAsignado.Visible Or RequiereAlmacenDestino Then @@ -13091,9 +13073,6 @@ Partial Class Ventas Next End If - - - 'SI LA FACTURA ESTA PAGADA DEBE MARCAR LA DEVOLUCION POR SI SE QUIERE AMORTIZAR If (ObjFacturaNC IsNot Nothing AndAlso ObjFacturaNC.PagadoBancos > 0) AndAlso factura.TipoDocto = "Dev" Then factura.Alfa3 = "DEV" @@ -13196,7 +13175,6 @@ Partial Class Ventas ' ErrorList.Add("Ocurrió un error al relacionar las ventas entre si comuníquese a Soporte Técnico") 'End If End If - End If End If @@ -13389,9 +13367,9 @@ Partial Class Ventas If RowMovto IsNot Nothing Then 'OBTIENE LOS IMPORTES ORIGINALES EN BASE A LO QUE HABIA EN EL MOVIMIENTO - Dim ImporteCargoOriginal = (RowMovto("ImporteCargo").ToString().ToDecimal() / RowMovto("Cantidad").ToString().ToDecimal()).RoundSQL(2) + Dim ImporteCargoOriginal As Decimal = (RowMovto("ImporteCargo").ToString().ToDecimal() / RowMovto("Cantidad").ToString().ToDecimal()).RoundSQL(2) 'Dim ImporteBonificacionOriginal = (RowMovto("ImporteBonificacion").ToString().ToDecimal() / RowMovto("Cantidad").ToString().ToDecimal()).RoundSQL(2) - Dim PuntosOriginales = (RowMovto("Puntos").ToString().ToDecimal() / RowMovto("Cantidad").ToString().ToDecimal()).RoundSQL(2) + Dim PuntosOriginales As Decimal = (RowMovto("Puntos").ToString().ToDecimal() / RowMovto("Cantidad").ToString().ToDecimal()).RoundSQL(2) Dim CveTamanio As Integer = RowMovto("CveTamaño").ToString().ToEntero() Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal() @@ -13412,7 +13390,7 @@ Partial Class Ventas If DrTamanio IsNot Nothing Then 'OBTIENE LOS IMPORTES ORIGINALES EN BASE A LO QUE HABIA EN EL MOVIMIENTO - Dim ImporteBonificacion = Row("Total").ToString().ToDecimal().RoundSQL(2) + Dim ImporteBonificacion As Decimal = Row("Total").ToString().ToDecimal().RoundSQL(2) Dim CveTamanio As Integer = DrTamanio("CveTamaño").ToString().ToEntero() Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal() @@ -14109,10 +14087,10 @@ Partial Class Ventas 'APLICA DEVOLUCION SALDOS DIRECTOS If AplicaDevolucion Then - Dim importeMovimientoDev = TxtTotal.Text.ToDecimal + Dim importeMovimientoDev As Decimal = TxtTotal.Text.ToDecimal importeMovimientoDev = If(SaldoVentaDevolucion < importeMovimientoDev, SaldoVentaDevolucion, importeMovimientoDev) If importeMovimientoDev > 0 Then - Dim importeMXDev = importeMovimientoDev * tipoCambio * Multiplicador + Dim importeMXDev As Decimal = importeMovimientoDev * tipoCambio * Multiplicador If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimientoDev.FormatoNumero(2)}" If UsaComplementariaClientes AndAlso tipoCambio > 1 Then @@ -15161,7 +15139,7 @@ Partial Class Ventas MovDetalle.Columns.Add(New DataColumn("CveVentaDetalle", GetType(Integer))) For Each RowPS As DataRow In DtProductos.Rows - Dim RowInv = MovDetalle.NewRow + Dim RowInv As DataRow = MovDetalle.NewRow RowInv("Cantidad") = RowPS("Cantidad").ToString().ToDecimal() RowInv("CveUM") = RowPS("CveUM").ToString().ToEntero() @@ -15176,7 +15154,7 @@ Partial Class Ventas Next 'Le damos salida de apartado por traspaso - Dim CveMovimientoSalidaPorTraspaso = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenSalida, 8, CveMoneda, CveRemision, AplicaMovimientoDetalleEntrada:=False, ObjConta:=ObjConta, CveAlmacenDestino:=CveAlmacenExA, MovimientoPrePoliza:=False) + Dim CveMovimientoSalidaPorTraspaso As Integer = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenSalida, 8, CveMoneda, CveRemision, AplicaMovimientoDetalleEntrada:=False, ObjConta:=ObjConta, CveAlmacenDestino:=CveAlmacenExA, MovimientoPrePoliza:=False) If Not CveMovimientoSalidaPorTraspaso > 0 Then OcurrioError = True @@ -15277,7 +15255,7 @@ Partial Class Ventas Dim Importe As Decimal Dim Concepto As String Dim tipoCambio As Decimal - Dim CveSubProyectoContabilizar = DdlSubProyectoDatos.SelectedValue.ToEntero() + Dim CveSubProyectoContabilizar As Integer = DdlSubProyectoDatos.SelectedValue.ToEntero() For Each RowIL As DataRow In TmpDTImpuestos.Rows If RowIL("TipoImpuesto").ToString().ToEntero() > 0 Then @@ -15565,8 +15543,8 @@ Partial Class Ventas LocalTipoDocto = Factura.TipoDocto Dim ArchivoAdjunto As String = "" - Dim ArchivoXML = String.Format("{0}XML\{1}\{2}.xml", UsuarioActual.Empresa.Ruta, LocalTipoDocto, LocalSerieFolio) - Dim ArchivoPDF = String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, LocalTipoDocto, LocalSerieFolio) + Dim ArchivoXML As String = String.Format("{0}XML\{1}\{2}.xml", UsuarioActual.Empresa.Ruta, LocalTipoDocto, LocalSerieFolio) + Dim ArchivoPDF As String = String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, LocalTipoDocto, LocalSerieFolio) If Adjunto <> "" Then ArchivoAdjunto = String.Format("{0}Ventas\{1}", UsuarioActual.Empresa.Ruta, Adjunto) End If @@ -15640,8 +15618,8 @@ Partial Class Ventas 'MANDA CORREO If EnviaCorreo Then Dim ArchivoAdjunto As String = "" - Dim ArchivoXML = "" - Dim ArchivoPDF = String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, LocalTipoDocto, LocalSerieFolio) + Dim ArchivoXML As String = "" + Dim ArchivoPDF As String = String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, LocalTipoDocto, LocalSerieFolio) If Adjunto <> "" Then ArchivoAdjunto = String.Format("{0}Ventas\{1}", UsuarioActual.Empresa.Ruta, Adjunto) @@ -15688,8 +15666,8 @@ Partial Class Ventas LocalTipoDocto = ObjFactura.TipoDocto Dim ArchivoAdjunto As String = "" - Dim ArchivoXML = String.Format("{0}XML\{1}\{2}.xml", UsuarioActual.Empresa.Ruta, LocalTipoDocto, LocalSerieFolio) - Dim ArchivoPDF = String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, LocalTipoDocto, LocalSerieFolio) + Dim ArchivoXML As String = String.Format("{0}XML\{1}\{2}.xml", UsuarioActual.Empresa.Ruta, LocalTipoDocto, LocalSerieFolio) + Dim ArchivoPDF As String = String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, LocalTipoDocto, LocalSerieFolio) If Adjunto <> "" Then ArchivoAdjunto = String.Format("{0}Ventas\{1}", UsuarioActual.Empresa.Ruta, Adjunto) End If @@ -15733,7 +15711,7 @@ Partial Class Ventas Dim ObjMovtos As New ClsMovimientos() If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente) Then - Dim DtMovtos = ObjMovtos.DtResultados.FiltraParametros($"Saldo > 0 AND SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo = 'Ant' ", "")} {If(DdlTipoComprobante.SelectedValue = "Ant", "AND Tipo = 'NC'", "")}") + Dim DtMovtos As DataTable = ObjMovtos.DtResultados.FiltraParametros($"Saldo > 0 AND SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo = 'Ant' ", "")} {If(DdlTipoComprobante.SelectedValue = "Ant", "AND Tipo = 'NC'", "")}") If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) Then DtMovtos = DtMovtos.FiltraParametros($"{If(CveVenta < 0, $"Tipo = 'Ant'{If(DdlTipoComprobante.SelectedValue = "Ing", $" AND CveMoneda ={DdlMoneda.SelectedValue.ToEntero()}", "")} ", "")}") End If @@ -15869,9 +15847,6 @@ Partial Class Ventas End If End If - - - e.Row.FCLiteral("MonedaVenta").Text = saldo.FormatoNumero(2) e.Row.FCCheckBox("Chk" & e.Row.RowIndex).Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1},{2});", e.Row.FCTextBox("TxtAnticipo" & e.Row.RowIndex).ClientID, saldo, AmortizacionSujeridaContrato)) e.Row.FCTextBox("TxtAnticipo" & e.Row.RowIndex).Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1});", e.Row.FCCheckBox("Chk" & e.Row.RowIndex).ClientID, saldo)) @@ -15906,10 +15881,6 @@ Partial Class Ventas If e.Row.DBCampo("CveMoneda").ToString().ToEntero() = DdlMoneda.SelectedValue.ToEntero() Then e.Row.FCTextBox("TxtTC" & e.Row.RowIndex).Visible = False End If - - - - End If End Sub Protected Sub BtnAceptarAnticipos_Click(sender As Object, e As System.EventArgs) Handles BtnAceptarAnticipos.Click @@ -15966,7 +15937,7 @@ Partial Class Ventas Dim tipoCambioVentaValuacion As Decimal = 1 Dim PorcentajePago As Decimal = 100 Dim dtConceptos As DataTable = Nothing - Dim CveMonedaVenta = DdlMoneda.SelectedValue.ToEntero() + Dim CveMonedaVenta As Integer = DdlMoneda.SelectedValue.ToEntero() If ObjConta.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then dtConceptos = ObjConta.DtResultados End If @@ -15976,11 +15947,9 @@ Partial Class Ventas For Each gvr As GridViewRow In GVAnticipos.Rows If gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked Then - Dim FechaUltimaFluctuacion As Date = MinFecha Dim TipoCambioFluctuacion As Decimal = 1 Dim tFecha As Date = Now - Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha) @@ -15990,8 +15959,6 @@ Partial Class Ventas TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion End If End If - - If DdlMoneda.SelectedValue.ToEntero() = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 1 Then 'SI LA VENTA VIENE EN PESOS Y SE VA A PAGAR EN PESOS tipoCambioPago = 1 tipoCambioVenta = 1 @@ -16343,7 +16310,7 @@ Partial Class Ventas Dim ImporteMX As Decimal Dim FechaMovimiento As Date = Now Dim Concepto As String = ViewState("VentaFolio").ToString() - Dim PrePolizaCorrecta = True + Dim PrePolizaCorrecta As Boolean = True '13 Iva x Trasladar ImporteMovimiento = Importe13 * PorcentajeAmortizacion ImporteMX = Math.Round(ImporteMovimiento, 2) * TipoCambio @@ -16384,7 +16351,7 @@ Partial Class Ventas Dim ImporteMX As Decimal Dim FechaMovimiento As Date = Now Dim Concepto As String = ViewState("VentaFolio").ToString() - Dim PrePolizaCorrecta = True + Dim PrePolizaCorrecta As Boolean = True Dim PorcentajeImpuesto As Decimal '61 Iva Trasladado @@ -16449,7 +16416,7 @@ Partial Class Ventas PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado) If ChkEmitirCartaPorte.Checked Then - Dim RespCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorteVenta, UsuarioActual) + Dim RespCartaPorte As Timbres.MMensajeCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorteVenta, UsuarioActual) If Not RespCartaPorte.TieneError Then ObjFactura.Timbre.Complementos.CartaPorte = RespCartaPorte.CartaPorte Else @@ -16482,7 +16449,7 @@ Partial Class Ventas MensajeAlert.AppendFormat(String.Format("
La {0}: {1} se generó correctamente.

", ObjFactura.TipoDocumento, ObjFactura.SerieFolio)) 'XML - Dim ArchivoXML = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio) + Dim ArchivoXML As String = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio) If File.Exists(ArchivoXML) Then MensajeAlert.AppendFormat("", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", ObjFactura.SerieFolio, ObjFactura.TipoDocto))) End If @@ -16505,8 +16472,8 @@ Partial Class Ventas 'IMPRESION Try 'MANDA CORREO - Dim strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port) - Dim Factura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False, CargaDTDetalle:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False, VerificaAlmacen:=False) + Dim strURLHOST As String = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port) + Dim Factura As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False, CargaDTDetalle:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False, VerificaAlmacen:=False) Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, Factura, UsuarioActual, strURLHOST)) Hilo.Start() Catch ex As Exception @@ -16675,7 +16642,7 @@ Partial Class Ventas Dim CvePACCancelacion As Integer = GvRow.DataKey("CvePAC").ToEntero() - Dim RespCancelacion = ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, 0, RFCReceptor, RFCEmisor, CvePACCancelacion) + Dim RespCancelacion As RespuestaCancelacionSAT = ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, 0, RFCReceptor, RFCEmisor, CvePACCancelacion) If RespCancelacion.Verificado Then @@ -16980,7 +16947,7 @@ Partial Class Ventas Dim PrecioSugerido As Decimal = 0 Dim tPrecioSugerido As Decimal = 0 tPrecioSugerido = drPS("Precio").ToString().ToDecimal - Dim ObjPrecioSugerido = CalculaPrecioSugerido(CvePSParametro, drPS("CveClasificacion").ToString().ToEntero()) + Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = CalculaPrecioSugerido(CvePSParametro, drPS("CveClasificacion").ToString().ToEntero()) PrecioSugerido = ObjPrecioSugerido.PrecioSugerido @@ -17033,7 +17000,7 @@ Partial Class Ventas If UsuarioActual.CveEmpresa.Contiene(1) Then Dim ObjPS As New ClsProductosServicios If ObjPS.GetPorcentajeProductos(CveCliente) Then - Dim PrecioAplicado = ObjPS.DtResultados.FiltraParametros($"CvePS = {CvePSParametro}").FiltroPrimeroValor("PrecioA").ToDecimal + Dim PrecioAplicado As Decimal = ObjPS.DtResultados.FiltraParametros($"CvePS = {CvePSParametro}").FiltroPrimeroValor("PrecioA").ToDecimal If PrecioAplicado > 0 Then PrecioSugerido = PrecioAplicado End If @@ -17085,7 +17052,7 @@ Partial Class Ventas If PrecioSugerido = 0 Then Dim ObjInventarios As New ClsInventarios - Dim CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1) + Dim CostoPS As Decimal = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1) 'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal If CostoPS = 0 Then CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1) ObjInventarios.Dispose() @@ -17577,7 +17544,7 @@ Partial Class Ventas End Sub Private Sub CargaFormatoSucursal(Optional RecalcularIVA As Boolean = True) - Dim dr = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveSubProyecto = {0}", If(DdlSubProyectoDatos.SelectedValue = "", "-1", DdlSubProyectoDatos.SelectedValue))) + Dim dr As DataRow = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveSubProyecto = {0}", If(DdlSubProyectoDatos.SelectedValue = "", "-1", DdlSubProyectoDatos.SelectedValue))) If dr IsNot Nothing Then ViewState("SucCalle") = dr("Calle") ViewState("SucNoExt") = dr("NoExt") @@ -17857,8 +17824,8 @@ Partial Class Ventas If Not CveContrato > 0 Then 'BANDERAS PARA VALIDACIONES - Dim EsValido = False - Dim EsValidoMayor = False + Dim EsValido As Boolean = False + Dim EsValidoMayor As Boolean = False Dim CostoMenor As Decimal = 0.0D Dim CostoMayor As Decimal = 0.0D @@ -18068,26 +18035,26 @@ Partial Class Ventas If ValidaCondicionesComerciales AndAlso DtPorcentajeMarcas IsNot Nothing AndAlso DtPorcentajeMarcas.Rows.Count > 0 Then 'VERIFICA SI EL PRODUCTO TIENE ESPECIFICADA UNA MARCA If Not String.IsNullOrEmpty(DrPS("CveMarca").ToString()) AndAlso DrPS("CveMarca").ToString().ToEntero() > 0 Then - Dim RowPorcentaje = DtPorcentajeMarcas.FiltroPrimero($"CveMarca={DrPS("CveMarca").ToString()}") + Dim RowPorcentaje As DataRow = DtPorcentajeMarcas.FiltroPrimero($"CveMarca={DrPS("CveMarca").ToString()}") 'REALIZA LOS DESCUENTOS DE ACUERDO AL PORCENTAJE POR MARCA If RowPorcentaje IsNot Nothing Then '(AHORA LOS DESCUENTOS SON ACUMULABLES) 'Descuento = 0 - Dim PorcentajeProducto = RowPorcentaje("PorcentajeProducto").ToString().ToDecimal() / 100D - Dim PorcentajeProducto2 = RowPorcentaje("PorcentajeProducto2").ToString().ToDecimal() / 100D - Dim PorcentajeProducto3 = RowPorcentaje("PorcentajeProducto3").ToString().ToDecimal() / 100D + Dim PorcentajeProducto As Decimal = RowPorcentaje("PorcentajeProducto").ToString().ToDecimal() / 100D + Dim PorcentajeProducto2 As Decimal = RowPorcentaje("PorcentajeProducto2").ToString().ToDecimal() / 100D + Dim PorcentajeProducto3 As Decimal = RowPorcentaje("PorcentajeProducto3").ToString().ToDecimal() / 100D Dim TotalInicial As Decimal = (Cantidad * (PU)) '- Descuento - Dim TotalFinal = TotalInicial + Dim TotalFinal As Decimal = TotalInicial 'SI APLICA EL PRIMER DESCUENTO If PorcentajeProducto > 0 Then Dim Descuento1 As Decimal = (TotalInicial * PorcentajeProducto).RoundSQL(2) - Dim Total2 = (TotalInicial - Descuento1) + Dim Total2 As Decimal = (TotalInicial - Descuento1) 'SI APLICA EL SEGUNDO DESCUENTO If PorcentajeProducto2 > 0 Then Dim Descuento2 As Decimal = (Total2 * PorcentajeProducto2).RoundSQL(2) - Dim Total3 = (Total2 - Descuento2) + Dim Total3 As Decimal = (Total2 - Descuento2) 'SI APLICA EL TERCER DESCUENTO If PorcentajeProducto3 > 0 Then @@ -18112,7 +18079,7 @@ Partial Class Ventas Dim SubTotalProntoPago As Decimal = (Cantidad * (PU)) - Descuento Dim TotalProntoPago As Decimal = SubTotalProntoPago * (1 + PorcentajeIVA) - Dim PorcentajeProntoPago = RowPorcentaje("ProntoPago").ToString().ToDecimal() / 100D + Dim PorcentajeProntoPago As Decimal = RowPorcentaje("ProntoPago").ToString().ToDecimal() / 100D ObjDescuento.ImporteProntoPago = (TotalProntoPago * PorcentajeProntoPago).RoundSQL(2) End If @@ -18160,7 +18127,7 @@ Partial Class Ventas ObjDescuento.NombrePromo = "YOKOHAMA VERANO" 'dr("NombrePromocion").ToString() ObjDescuento.CveMarca = CveMarcaPromocion Dim Rin As String = DtRines.FiltroPrimeroValor("RinTamaño", $"CveRinTamaño = {CveRinTamañoPS}") - Dim PromoDescuento = (Descuento * (1 + If(IncluyeImpuestos, PorcentajeIVA, 0))).RoundSQL(2) + Dim PromoDescuento As Decimal = (Descuento * (1 + If(IncluyeImpuestos, PorcentajeIVA, 0))).RoundSQL(2) ObjDescuento.ObsDescuento = String.Format("RIN {0} BONO ${1:N2}", Rin, PromoDescuento) End If @@ -18176,8 +18143,14 @@ Partial Class Ventas Return ObjDescuento End Function - - + 'Private ReadOnly Property ClasificacionesDescuentos As Dictionary(Of Integer, Decimal) + ' Get + ' Return New Dictionary(Of Integer, Decimal) From { + ' {20516, 0.21D}, 'Descuento para lubricantes LTH + ' {20515, 0.25D} 'Descuento para filtros LTH + ' } + ' End Get + 'End Property Private Sub AgregarPS() 'SELECCIONA EL PS DEPENDIENDO LA MODALIDAD (CODIGO BARRAS - DDL) Try @@ -18552,7 +18525,7 @@ Partial Class Ventas If Clasificacion = "" Then Row("Clasificacion") = DrPS("Clasificacion") - Dim ClienteRetIVA = Me.ClienteRetIVA + Dim ClienteRetIVA As Decimal = Me.ClienteRetIVA If ClienteRetIVA <= 0 AndAlso DrPS("RetIVA").ToString.ToDecimal > 0 Then ClienteRetIVA = DrPS("RetIVA").ToString.ToDecimal DdlTipoRetencion.Enabled = True @@ -18669,7 +18642,7 @@ Partial Class Ventas Dim CvePSAdicional As Integer = Dr("CvePSAdicional").ToString().ToEntero() Dim DrPoliza As DataRow = TmpDT.NewRow() DrPoliza.ItemArray = Row.ItemArray - Dim DrPSAdicional = GlobalDTPS(UsuarioActual.CveEmpresa, CvePSAdicional).Rows(0) + Dim DrPSAdicional As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePSAdicional).Rows(0) If DrPSAdicional IsNot Nothing Then DrPoliza("CvePS") = CvePSAdicional DrPoliza("PS") = DrPSAdicional("PS").ToString() @@ -18705,13 +18678,13 @@ Partial Class Ventas PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDecimal If PrecioSugerido = 0 Then Dim ObjInventarios As New ClsInventarios - Dim CostoPS = ObjInventarios.GetCostoPS(CvePSAdicional, DrPoliza("Cantidad").ToString().ToDecimal, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1) + Dim CostoPS As Decimal = ObjInventarios.GetCostoPS(CvePSAdicional, DrPoliza("Cantidad").ToString().ToDecimal, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1) 'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal If CostoPS = 0 Then CostoPS = ObjInventarios.GetCostoPS(CvePSAdicional, DrPoliza("Cantidad").ToString().ToDecimal, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1) ObjInventarios.Dispose() - Dim PorcentajePrecio = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDecimal + Dim PorcentajePrecio As Decimal = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDecimal If CostoPS > 0 And PorcentajePrecio > 0 Then PrecioSugerido = ((PorcentajePrecio / 100) + 1) * CostoPS End If @@ -20040,13 +20013,9 @@ Partial Class Ventas If OcurrioError Then Exit For End If - End If - End If - End If - If OcurrioError Then Exit For End If @@ -20194,7 +20163,7 @@ Partial Class Ventas Optional ByRef ObjConta As ClsContabilidad = Nothing, Optional CveMovimientoRelacionado As Integer = -1, Optional AplicaMovimientoDetalleEntrada As Boolean = False, Optional CveAlmacenDestino As Integer = -1) As Integer Dim OcurrioError As Boolean = False - Dim ContadorMovtosDetalles = 0 + Dim ContadorMovtosDetalles As Integer = 0 'If Not AplicaMovimientoDetalleEntrada Then ' Dim rowa As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveAlmacen={0}", CveAlmacen)) @@ -20295,7 +20264,7 @@ Partial Class Ventas End If If ObjInventario.GetMovimientosDetalle(CveMovimientoInventario, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then - Dim DtCostos = ObjInventario.DtResultados.Copy + Dim DtCostos As DataTable = ObjInventario.DtResultados.Copy Dim DtCostosDistinct As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"}) Dim ValorInventario As Decimal Dim TotalCostoAcumulado As Decimal = 0D @@ -20476,7 +20445,7 @@ Partial Class Ventas If CveMovimientoVirtual > 0 Then For Each RowUsado As DataRow In DtPSVirtual.Rows - Dim CvePS = RowUsado("CvePS").ToString().ToEntero() + Dim CvePS As Integer = RowUsado("CvePS").ToString().ToEntero() Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble() Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal() Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero() @@ -20501,7 +20470,7 @@ Partial Class Ventas If CveMovimientoVirtual > 0 Then 'OcurrioError = Not GeneraPrePolizaMovimientoAlmacen(ObjInventario, ObjConta, ObjContPaq, ObjFactura, ObjFactura.CvePrePoliza, CveMovimientoInventario, CveAlmacen) If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtual, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then - Dim DtCostos = ObjInventario.DtResultados.Copy + Dim DtCostos As DataTable = ObjInventario.DtResultados.Copy Dim DtCostosDistinct As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"}) Dim ValorInventario As Decimal Dim TotalCostoAcumulado As Decimal = 0D @@ -20596,7 +20565,7 @@ Partial Class Ventas If CveMovimientoVirtual > 0 Then For Each RowUsado As DataRow In DtPSVirtual.Rows - Dim CvePS = RowUsado("CvePS").ToString().ToEntero() + Dim CvePS As Integer = RowUsado("CvePS").ToString().ToEntero() Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble() Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal() Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero() @@ -20810,7 +20779,7 @@ Partial Class Ventas Dim Asunto As String = String.Empty Dim Cuerpo As String = String.Empty - Dim TipoComprobante = "" + Dim TipoComprobante As String = "" If TipoDocto = "Ing" Then TipoComprobante = "Factura" If TipoDocto = "Egs" Then TipoComprobante = "Nota de Crédito" @@ -20877,8 +20846,6 @@ Partial Class Ventas End If End If - - If Not EnviarFactura Then ResultadoMail = 0 End If @@ -20931,7 +20898,7 @@ Partial Class Ventas #Region " ESTIMACIONES " Protected Sub DdlContrato_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlContrato.SelectedIndexChanged - Dim valueselect = DdlContrato.SelectedValue + Dim valueselect As String = DdlContrato.SelectedValue Dim CveContrato As Integer = valueselect.ToEntero() Using ObjContratos As New ClsContratos @@ -21245,7 +21212,7 @@ Partial Class Ventas Dim SWatch As New Stopwatch SWatch.Start() - Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor, TotalT.ToString(), True) + Dim Vigencia As Timbrado.AcuseCancelacionSAT = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor, TotalT.ToString(), True) SWatch.Stop() Dim SegundosRespuesta As Double = SWatch.ElapsedMilliseconds / 1000 @@ -21264,7 +21231,7 @@ Partial Class Ventas BtnMotivoRefacturacion.Visible = False DivMotivoRefacturacionTexto.Visible = False - Dim Relacionados = Timbrado.ConsultarUUIDRelacionados(UsuarioActual.Empresa, FolioFiscal, UsuarioActual.Empresa.FacturaProduccion) + Dim Relacionados As Timbrado.MRespUUIDRelacionados = Timbrado.ConsultarUUIDRelacionados(UsuarioActual.Empresa, FolioFiscal, UsuarioActual.Empresa.FacturaProduccion) If Relacionados IsNot Nothing Then Dim sbExtra As New StringBuilder() If Relacionados.Codigo = 500 Then @@ -21272,8 +21239,8 @@ Partial Class Ventas Else sbExtra.Append(Relacionados.Mensaje) - Dim SbHijos = New StringBuilder() - Dim SbPadres = New StringBuilder() + Dim SbHijos As New StringBuilder() + Dim SbPadres As New StringBuilder() 'If Relacionados.RelacionadosHijo IsNot Nothing Then ' For Each hijo In Relacionados.RelacionadosHijo @@ -21285,7 +21252,7 @@ Partial Class Ventas 'End If If Relacionados.RelacionadosPadre IsNot Nothing Then - For Each padre In Relacionados.RelacionadosPadre + For Each padre As Timbrado.RelacionadosPadre In Relacionados.RelacionadosPadre SbPadres.AppendFormat("{0};", padre.Uuid) Next If SbPadres.Length > 0 Then @@ -21393,7 +21360,7 @@ Partial Class Ventas 'Exit Sub Dim ObjConta As New ClsContabilidad - Dim Movimientos = ObjConta.GetMovimientosPoliza(IdPoliza, UsuarioActual.CveEmpresa) + Dim Movimientos As Integer = ObjConta.GetMovimientosPoliza(IdPoliza, UsuarioActual.CveEmpresa) 'Verifica que solo exista 1 compra asociada If Movimientos = 1 Then @@ -21461,21 +21428,21 @@ Partial Class Ventas ViewState("CveClienteAnterior") = CveCliente - Dim CantidadFacturadaRemision = 0.0 + Dim CantidadFacturadaRemision As Decimal = 0 'EN BDH NO DEBE PERMITIR EDITAR EL PU If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then For Each Gvr As GridViewRow In GvPS.Rows Gvr.FCLinkButton("imgE").Visible = True Gvr.FCLinkButton("imgD").Visible = False - CantidadFacturadaRemision += Gvr.DataKey("CantidadFacturadaRem").ToString().ToDouble + CantidadFacturadaRemision += Gvr.DataKey("CantidadFacturadaRem").ToString().ToDecimal Next Else 'SI EL DETALLE NO TIENE MOVIMIENTOS DE INVENTARIO ES VISIBLE For Each Gvr As GridViewRow In GvPS.Rows Gvr.FCLinkButton("imgE").Visible = Not Gvr.DataKey("CantidadFacturadaRem").ToString().ToDouble > 0 Gvr.FCLinkButton("imgD").Visible = Not Gvr.DataKey("CantidadInventario").ToString().ToDouble > 0 - CantidadFacturadaRemision += Gvr.DataKey("CantidadFacturadaRem").ToString().ToDouble + CantidadFacturadaRemision += Gvr.DataKey("CantidadFacturadaRem").ToString().ToDecimal 'If GvInv.Rows.Count > 0 Then ' Gvr.FCLinkButton("imgE").Enabled = False ' Gvr.FCLinkButton("imgE").ToolTip = "No se puede editar debido a que ya hay un movimiento de almacen." @@ -21719,7 +21686,7 @@ Partial Class Ventas Dim CveEmpresaPDF As Integer = UsuarioActual.CveEmpresa Dim CveUsuarioPDF As Integer = UsuarioActual.CveUsuario - Dim strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port) + Dim strURLHOST As String = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port) RegenerarPDF(CveVenta, CveEmpresaPDF, CveUsuarioPDF, strURLHOST) ' 'Dim Hilo As New System.Threading.Thread(Sub() ) @@ -21740,7 +21707,7 @@ Partial Class Ventas Private Sub BtnActualizarCuentaTerminal_Click(sender As Object, e As EventArgs) Handles BtnActualizarCuentaTerminal.Click Dim ObjVentas As New ClsVentas ObjVentas.IniciaTransacSQL() - Dim TieneError = False + Dim TieneError As Boolean = False If Not ObjVentas.UpdateVentaCuentaTerminal(DdlCuentaTerminalModal.SelectedValue.ToEntero(), CveVenta) Then TieneError = True @@ -22241,8 +22208,8 @@ Partial Class Ventas DtPagos.Rows.RemoveAt(e.RowIndex) 'JJMQ 20160506: Validacion para no pagar de mas a peticion de I.P. - Dim abonado = DtPagos.SUM("Importe") - Dim saldo = TxtTotal.Text.Replace(",", "").ToDouble - abonado + Dim abonado As Decimal = DtPagos.SUMD("Importe") + Dim saldo As Decimal = TxtTotal.Text.Replace(",", "").ToDecimal - abonado 'CVImporteContado.ValueToCompare = (saldo.FormatoNumero(2).ToDouble).ToString() LblDescuentoAdicional.Text = "0.00" @@ -22301,7 +22268,7 @@ Partial Class Ventas 'Pago en Efectivo If TxtImporteEfectivo.Text.ToDecimal > 0 Then If DdlCuentaEfectivo.Items.Count > 0 Then - Dim DrEfectivo = DtPagos.NewRow + Dim DrEfectivo As DataRow = DtPagos.NewRow DrEfectivo("CveTipoMovimiento") = 13 DrEfectivo("TipoMovimiento") = "Pago en Efectivo" DrEfectivo("CveCuenta") = DdlCuentaEfectivo.SelectedValue @@ -22323,7 +22290,7 @@ Partial Class Ventas If TxtImporteCredito.Text.ToDecimal > 0 Then If DdlCuentaTarjetaCredito.Items.Count > 0 Then - Dim DrCredito = DtPagos.NewRow + Dim DrCredito As DataRow = DtPagos.NewRow DrCredito("CveTipoMovimiento") = 12 DrCredito("TipoMovimiento") = "Tarjeta de Crédito" DrCredito("CveCuenta") = DdlCuentaTarjetaCredito.SelectedValue @@ -22373,7 +22340,7 @@ Partial Class Ventas 'Pago Tarjeta Debito If TxtImporteCheque.Text.ToDecimal > 0 Then If DdlCuentaCheque.Items.Count > 0 Then - Dim DrCheque = DtPagos.NewRow + Dim DrCheque As DataRow = DtPagos.NewRow DrCheque("CveTipoMovimiento") = 3 DrCheque("TipoMovimiento") = "Cheque" DrCheque("CveCuenta") = DdlCuentaCheque.SelectedValue @@ -22394,7 +22361,7 @@ Partial Class Ventas 'Pago Transferencia If TxtImporteTransferencia.Text.ToDecimal > 0 Then If DdlCuentaTransferencia.Items.Count > 0 Then - Dim DrCheque = DtPagos.NewRow + Dim DrCheque As DataRow = DtPagos.NewRow DrCheque("CveTipoMovimiento") = 8 DrCheque("TipoMovimiento") = "Transferencia" DrCheque("CveCuenta") = DdlCuentaTransferencia.SelectedValue @@ -22420,7 +22387,7 @@ Partial Class Ventas Case 1 If TxtImporteOtrosContado.Text.ToDecimal > 0 Then If DdlCuentaOtrosContado.Items.Count > 0 Then - Dim DrCredito = DtPagos.NewRow + Dim DrCredito As DataRow = DtPagos.NewRow DrCredito("CveTipoMovimiento") = 12 DrCredito("TipoMovimiento") = "Tarjeta de Crédito" DrCredito("CveCuenta") = DdlCuentaOtrosContado.SelectedValue @@ -22447,7 +22414,7 @@ Partial Class Ventas Case 2 If TxtImporteOtrosContado.Text.ToDecimal > 0 Then If DdlCuentaOtrosContado.Items.Count > 0 Then - Dim DrDebito = DtPagos.NewRow + Dim DrDebito As DataRow = DtPagos.NewRow DrDebito("CveTipoMovimiento") = 11 DrDebito("TipoMovimiento") = "Tarjeta de Debito" DrDebito("CveCuenta") = DdlCuentaOtrosContado.SelectedValue @@ -22468,7 +22435,7 @@ Partial Class Ventas Case 3 If TxtImporteOtrosContado.Text.ToDecimal > 0 Then If DdlCuentaOtrosContado.Items.Count > 0 Then - Dim DrCheque = DtPagos.NewRow + Dim DrCheque As DataRow = DtPagos.NewRow DrCheque("CveTipoMovimiento") = 3 DrCheque("TipoMovimiento") = "Cheque" DrCheque("CveCuenta") = DdlCuentaOtrosContado.SelectedValue @@ -22515,7 +22482,7 @@ Partial Class Ventas If UsuarioActual.CveRol = 1 AndAlso DdlTipoComprobante.SelectedValue = "Ing" AndAlso (Not VieneDeCotizacion) AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso DtPagos IsNot Nothing AndAlso TbDescuentosAdicionales.Visible Then If TmpDT.SUMD("Descuento") > 0 AndAlso DtPagos.SUMD("Importe", "MesesSinIntereses <=0") = TxtTotal.Text.ToDecimal() Then Dim TotalDescuento As Decimal = TmpDT.SUMD("Total", "Descuento > 0") * 0.05D - Dim RowDescuentos = TmpDT.Select("Descuento > 0") + Dim RowDescuentos As DataRow() = TmpDT.Select("Descuento > 0") If RowDescuentos IsNot Nothing Then LblDescuentoAdicional.Text = TotalDescuento.FormatoNumero(2) @@ -22530,7 +22497,7 @@ Partial Class Ventas CalculaTotalesVenta() - Dim RowPago = DtPagos.Rows(0) + Dim RowPago As DataRow = DtPagos.Rows(0) RowPago("Importe") = LblTotalAPagarAdicional.Text.ToDecimal() @@ -22549,7 +22516,7 @@ Partial Class Ventas LimpiaEscondeContado() End Sub Private Function ValidaPagosContado(Optional MostrarAlertas As Boolean = True, Optional TipoDoctoViejo As String = "") As Boolean - Dim Retorno = False + Dim Retorno As Boolean = False Dim AmortizacionNC As Decimal = 0 @@ -22611,7 +22578,7 @@ Partial Class Ventas Dim TotalRNC As Decimal = If((ListaNCDesc IsNot Nothing AndAlso ListaNCDesc.Count > 0) OrElse (ListaNCBonificacion IsNot Nothing AndAlso ListaNCBonificacion.Count > 0), LblDescuentosRNC.Text.Trim().ToDecimal(), 0) Dim ImporteTotal As Decimal = (TxtTotal.Text.ToDecimal).RoundSQL(2) - Dim TotalPagado = (TotalPagoContado + TotalRNC + TotalProntoPago).RoundSQL(2) + Dim TotalPagado As Decimal = (TotalPagoContado + TotalRNC + TotalProntoPago).RoundSQL(2) If TotalPagado <> ImporteTotal Then If MostrarAlertas Then @@ -22623,7 +22590,7 @@ Partial Class Ventas End If Else - Dim TotalPagado = (TotalPagoContado + TotalProntoPago).RoundSQL(2) + Dim TotalPagado As Decimal = (TotalPagoContado + TotalProntoPago).RoundSQL(2) If TotalPagado <> TxtTotal.Text.ToDecimal.RoundSQL(2) Then If MostrarAlertas Then Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia) @@ -22703,14 +22670,14 @@ Partial Class Ventas #Region " SERIE ALMACEN " Protected Sub BtnSerie_Click(sender As Object, e As EventArgs) - Dim Row = CType(CType(sender, Button).NamingContainer, GridViewRow) + Dim Row As GridViewRow = CType(CType(sender, Button).NamingContainer, GridViewRow) If Row.FCTextBox("TxtSerie").Text.Trim = "" Then Exit Sub - Dim Index = Row.RowIndex + Dim Index As Integer = Row.RowIndex Dim ObjInventarios As New ClsInventarios - Dim Existencia = ObjInventarios.GetExistenciasPSSerie(Row.FCTextBox("TxtSerie").Text.ToString(), ddlAlmacen.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa) - Dim ExistenciaActual = DtInv.SUM("Cantidad", String.Format("Serie = '{0}'", Row.FCTextBox("TxtSerie").Text.ToString())) + Dim Existencia As Decimal = ObjInventarios.GetExistenciasPSSerie(Row.FCTextBox("TxtSerie").Text.ToString(), ddlAlmacen.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa) + Dim ExistenciaActual As Decimal = DtInv.SUMD("Cantidad", String.Format("Serie = '{0}'", Row.FCTextBox("TxtSerie").Text.ToString())) 'Valida Existencia If Existencia - ExistenciaActual <= 0 Then @@ -22730,9 +22697,9 @@ Partial Class Ventas UpINV.Update() End Sub Private Function ValidaSerieINV() As Boolean - Dim Retorno = False - Dim Existencia = 0.0 - Dim ExistenciaActual = 0.0 + Dim Retorno As Boolean = False + Dim Existencia As Decimal = 0 + Dim ExistenciaActual As Decimal = 0 Dim ObjInventarios As New ClsInventarios For Each Gvr As GridViewRow In GvInv.Rows @@ -22747,7 +22714,7 @@ Partial Class Ventas If Gvr.FCTextBox("TxtSerie").Visible = True And Gvr.FCTextBox("TxtSerie").Text.Trim <> "" Then Existencia = ObjInventarios.GetExistenciasPS(-1, -1, UsuarioActual.CveEmpresa, ddlAlmacen.SelectedValue.ToEntero(), Serie:=Gvr.FCTextBox("TxtSerie").Text.ToString(), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1) - ExistenciaActual = DtInv.SUM("Cantidad", String.Format("Serie = '{0}'", Gvr.FCTextBox("TxtSerie").Text.Trim)) + ExistenciaActual = DtInv.SUMD("Cantidad", String.Format("Serie = '{0}'", Gvr.FCTextBox("TxtSerie").Text.Trim)) 'Valida Existencia If Existencia - ExistenciaActual < 0 Then @@ -22946,7 +22913,7 @@ Partial Class Ventas End If Dim EsPersonaMoral As Boolean = (RdTipoPersona.SelectedValue = "1") - Dim DtUsosCFDI = GlobalDTSATUsosCFDI(If(Not EsPersonaMoral, 1, 0), RegimenFiscalReceptor:=RegimenFiscalCliente).FiltraParametros($"CveUsoCFDI = {CveUsoCFDI}") + Dim DtUsosCFDI As DataTable = GlobalDTSATUsosCFDI(If(Not EsPersonaMoral, 1, 0), RegimenFiscalReceptor:=RegimenFiscalCliente).FiltraParametros($"CveUsoCFDI = {CveUsoCFDI}") If DtUsosCFDI.Rows.Count = 0 Then Alert("El Uso CFDI no corresponde con el tipo de persona (fisca, moral) y el régimen fiscal.", TipoMensaje.MsgAdvertencia) @@ -23203,7 +23170,7 @@ Partial Class Ventas Exit Sub End If - Dim EstatusDevolucion = If(Me.DevolucionAlmacen = 0, 1, 0) + Dim EstatusDevolucion As Integer = If(Me.DevolucionAlmacen = 0, 1, 0) Dim ObjV As New ClsVentas If ObjV.UpdateVentasDevolucionAlmacen(EstatusDevolucion, CveVenta) Then @@ -23223,7 +23190,7 @@ Partial Class Ventas #Region "D I R E C C I O N E N V I O" Private Sub CargaDireccionesEnvio() Dim ObjClientes As New ClsClientes - Dim TieneError = False + Dim TieneError As Boolean = False DdlDireccionEnvio.Items.Clear() If ObjClientes.DireccionEnvioGet(-1, CveCliente, CveClienteSucursal) Then @@ -23254,7 +23221,7 @@ Partial Class Ventas End Sub Private Sub BtnAgregarDireccion_Click(sender As Object, e As EventArgs) Handles BtnAgregarDireccion.Click Dim ObjClientes As New ClsClientes - Dim TieneError = False + Dim TieneError As Boolean = False Dim CveDireccionEnvio As Integer CveDireccionEnvio = ObjClientes.DireccionEnvioAdd(CveCliente, TxtEnvioDireccion.Text.Trim, TxtEnvioNoExt.Text.Trim, TxtEnvioNoInt.Text.Trim, DdlDirClienteColonia.SelectedItem.Text.Trim, DdlDirClienteMunicipio.SelectedItem.Text.Trim, DdlDirClienteEstado.SelectedItem.Text.Trim, TxtEnvioCP.Text.Trim(), TxtEnvioContacto.Text.Trim, UsuarioActual.CveUsuario, 1, CveClienteSucursal:=CveClienteSucursal, EnvioTel:=TxtEnvioTel.Text.Trim.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", "").Replace("_", ""), @@ -23680,7 +23647,7 @@ Partial Class Ventas Dim ObjetoPDF As Byte() = DescargarPDF(Encripta(String.Format("OP=CAN&CVEVTA={0}", CveVenta))) If ObjetoPDF IsNot Nothing Then - Dim RFC = UsuarioActual.Empresa.RFC + Dim RFC As String = UsuarioActual.Empresa.RFC Dim ObjMail As New ClsSisMail Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail) Dim Asunto As String = String.Empty @@ -23852,7 +23819,7 @@ Partial Class Ventas Dim SWatch As New Stopwatch SWatch.Start() - Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor, TotalT.ToString(), True) + Dim Vigencia As timbrado.AcuseCancelacionSAT = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor, TotalT.ToString(), True) SWatch.Stop() @@ -23873,15 +23840,14 @@ Partial Class Ventas DivCanRem.Visible = False DivDevAlm.Visible = False - Dim Relacionados = Timbrado.ConsultarUUIDRelacionados(UsuarioActual.Empresa, FolioFiscal, UsuarioActual.Empresa.FacturaProduccion) + Dim Relacionados As Timbrado.MRespUUIDRelacionados = Timbrado.ConsultarUUIDRelacionados(UsuarioActual.Empresa, FolioFiscal, UsuarioActual.Empresa.FacturaProduccion) If Relacionados IsNot Nothing Then If Relacionados.Codigo = 500 Then sbExtra.Append("El servicio de verificación de documentos relacionados no esta disponible.") Else sbExtra.Append(Relacionados.Mensaje) - - Dim SbHijos = New StringBuilder() - Dim SbPadres = New StringBuilder() + Dim SbHijos As New StringBuilder() + Dim SbPadres As New StringBuilder() 'If Relacionados.RelacionadosHijo IsNot Nothing Then ' For Each hijo In Relacionados.RelacionadosHijo @@ -23893,7 +23859,7 @@ Partial Class Ventas 'End If If Relacionados.RelacionadosPadre IsNot Nothing Then - For Each padre In Relacionados.RelacionadosPadre + For Each padre As Timbrado.RelacionadosPadre In Relacionados.RelacionadosPadre SbPadres.AppendFormat("{0};", padre.Uuid) Next If SbPadres.Length > 0 Then @@ -23902,13 +23868,11 @@ Partial Class Ventas End If Using ObjVentas As New ClsVentas - 'If SbHijos.Length > 0 Then ' If ObjVentas.GetFacturasRelacionadasPorFolioFiscal(SbHijos.ToString(), UsuarioActual.CveEmpresa) Then ' GvFacturasHijosCancelar.DataSource = ObjVentas.DtResultados.Copy() ' End If 'End If - If SbPadres.Length > 0 Then If ObjVentas.GetFacturasRelacionadasPorFolioFiscal(SbPadres.ToString(), UsuarioActual.CveEmpresa) Then GvFacturasPadreCancelar.DataSource = ObjVentas.DtResultados.FiltraParametros($"CveVenta <> {CveVenta}") @@ -23916,7 +23880,6 @@ Partial Class Ventas End If End Using - 'GvFacturasHijosCancelar.DataBind() GvFacturasPadreCancelar.DataBind() End If @@ -24216,8 +24179,8 @@ Partial Class Ventas For Each RowBon As DataRow In DtBonificaciones.Rows Try 'VERIFICA SI TIENE RNC DE BONIFICACION - Dim Bon = New Modelos.Factura(UsuarioActual, RowBon("CveVentaBonificacion").ToString().ToEntero(), UsuarioActual.CveEmpresa, VerificaAlmacen:=False) - Dim respBon = Bon.CancelarFactura(False, ListaRemisionesCancelar, CveMotivoCancelacion:=DdlMotivoCancelacion.SelectedValue.ToEntero(), Motivo:=TxtMotivoCancelacion.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion) + Dim Bon As New Modelos.Factura(UsuarioActual, RowBon("CveVentaBonificacion").ToString().ToEntero(), UsuarioActual.CveEmpresa, VerificaAlmacen:=False) + Dim respBon As Modelos.Factura.MCancelacionVentaMensaje = Bon.CancelarFactura(False, ListaRemisionesCancelar, CveMotivoCancelacion:=DdlMotivoCancelacion.SelectedValue.ToEntero(), Motivo:=TxtMotivoCancelacion.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion) If respBon.HuboError Then strMensaje.AppendFormat("
Ocurrió un error al cancelar la remisión de NC de bonificación {0} .", Bon.SerieFolio) Else @@ -24290,7 +24253,7 @@ Partial Class Ventas #Region "CiclosComerciales" Private Sub CargaCicloComercialURL() Dim ObjContratos As New ClsContratos - Dim huboerror = False + Dim huboerror As Boolean = False Dim SubProyecto As String = "" Dim CveSubProyecto As Integer = -1 Dim Proyecto As String = "" @@ -24309,7 +24272,7 @@ Partial Class Ventas Dim tPSDescripcion As String = "-" Dim PSS As String = "" Dim Obs As String = "" - Dim SubTotalTemp = 0.0D + Dim SubTotalTemp As Decimal = 0 'Cargamos los datos del Cliente DtContratos = ObjContratos.DtResultados @@ -24379,7 +24342,7 @@ Partial Class Ventas If Plantilla.Contains("{MES}") Then Dim fecha As DateTime = DateTime.Now Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat - Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper() + Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper() Plantilla = Plantilla.ToString().Replace("{MES}", nombreMes) End If @@ -24395,7 +24358,7 @@ Partial Class Ventas If Plantilla.Contains("{MESANTERIOR}") Then Dim fecha As DateTime = DateTime.Now.AddMonths(-1) Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat - Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper() + Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper() Plantilla = Plantilla.ToString().Replace("{MESANTERIOR}", nombreMes) End If @@ -24403,7 +24366,7 @@ Partial Class Ventas If Plantilla.Contains("{INICIOMESANTERIOR}") Then Dim fecha As DateTime = DateTime.Now.AddMonths(-1) Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat - Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper() + Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper() Dim mesAnterior As String = String.Format("01 {0} {1}", nombreMes, fecha.Year) @@ -24413,9 +24376,9 @@ Partial Class Ventas If Plantilla.Contains("{FINMESANTERIOR}") Then Dim fecha As DateTime = DateTime.Now.AddMonths(-1) Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat - Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper() + Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper() - Dim LastDayOfMonth = DateTime.DaysInMonth(fecha.Year, fecha.Month) + Dim LastDayOfMonth As Integer = DateTime.DaysInMonth(fecha.Year, fecha.Month) Dim mesAnterior As String = String.Format("{0} {1} {2}", LastDayOfMonth, nombreMes, fecha.Year) @@ -24448,7 +24411,7 @@ Partial Class Ventas End Sub Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String, FileUrl As String) Dim dt As New DataTable - Dim ErrorArchivo = False + Dim ErrorArchivo As Boolean = False Dim n As Integer = 0 dt = ReadExcelFile(FileUrl, True) If Not ErrorArchivo Then @@ -24585,7 +24548,7 @@ Partial Class Ventas If CvePS > 0 Then If PrecioUnitario <= 0 Then - Dim ObjPrecioSugerido = CalculaPrecioSugerido(CvePS, CveClasificacion) + Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = CalculaPrecioSugerido(CvePS, CveClasificacion) PrecioUnitario = ObjPrecioSugerido.PrecioSugerido End If @@ -24853,7 +24816,7 @@ Partial Class Ventas Dim Cons As Integer = 1 TmpDT.Clear() - Dim Cantidad = 0.0D, PU = 0.0D, Descuento = 0.0D + Dim Cantidad As Decimal = 0, PU As Decimal = 0, Descuento As Decimal = 0 Dim Filtro As String = "" If ViewState("CveMovimientoDetalle").ToString().ToEntero() > 0 Then Filtro = $"AND CveMovimientoDetalle = {ViewState("CveMovimientoDetalle").ToString().ToEntero()}" @@ -24970,8 +24933,6 @@ Partial Class Ventas DdlClasificacionPS.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=1).FiltraParametros("", Orderby:="Clasificacion") 'DdlTipo.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=1).FiltraParametros("", Orderby:="Clasificacion") End If - - 'BLOQUEA DDL CLASIFICACION If UsuarioActual.Empresa.Funcionalidad(121) = "1" Then If Not UsuarioActual.TienePermisoProceso(147) Then @@ -25151,9 +25112,9 @@ Partial Class Ventas Return True End If - Dim CveMovimientoSalidaConsignacion = -1 - Dim CveMovimientoEntradaGeneral = -1 - Dim CveMovimientoSalidaGeneral = -1 + Dim CveMovimientoSalidaConsignacion As Integer = -1 + Dim CveMovimientoEntradaGeneral As Integer = -1 + Dim CveMovimientoSalidaGeneral As Integer = -1 'MOVIMIENTO DE SALIDA POR TRASPASO DEL ALMACEN DE CONSIGNACION @@ -25267,7 +25228,7 @@ Partial Class Ventas 'FolioVirtualSalida = ObjInventario.Folio For Each RowVirtual As DataRow In dtvirtual.Rows - Dim CvePS = RowVirtual("CvePS").ToString().ToEntero() + Dim CvePS As Integer = RowVirtual("CvePS").ToString().ToEntero() Dim CantidadUsado As Double = RowVirtual("Cantidad").ToString().ToDouble() Dim PU As Decimal = RowVirtual("PU").ToString().ToDecimal() Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero() @@ -25314,7 +25275,7 @@ Partial Class Ventas End If End Sub Protected Sub BtnSerieConsignacion_Click(sender As Object, e As EventArgs) - Dim Argumentos = CType(sender, Button).CommandArgument.Split("°"c) + Dim Argumentos As String() = CType(sender, Button).CommandArgument.Split("°"c) CveConsecSerie = Argumentos(0).ToEntero() CvePSSerie = Argumentos(1).ToEntero() @@ -25357,8 +25318,7 @@ Partial Class Ventas Alert("El campo Serie es obligatorio. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) Exit Sub End If - - Dim SeriesArreglo = Serie.Trim.Split(";"c) + Dim SeriesArreglo As String() = Serie.Trim.Split(";"c) 'VALIDACION DE SERIES DUPLICADAS Dim MensajeAlert As New StringBuilder @@ -25370,7 +25330,7 @@ Partial Class Ventas ' Dim dr As DataRow = GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CvePS = {0}", CvePSSerie), "PS") Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePSSerie).FiltroPrimero("", "PS") - For Each SerieRow In SeriesArreglo + For Each SerieRow As String In SeriesArreglo SerieRow = SerieRow.ToUpper DtDuplicado = DtContratosSerieDetalle.FiltraParametros($"ConsecId = {CveConsecSerie} AND Serie = '{SerieRow}'") @@ -25391,7 +25351,7 @@ Partial Class Ventas Continue For End If - Dim Row = DtSeriesNuevas.NewRow + Dim Row As DataRow = DtSeriesNuevas.NewRow Row("Serie") = SerieRow DtSeriesNuevas.Rows.Add(Row) Next @@ -25405,10 +25365,10 @@ Partial Class Ventas Dim MensajeSinExistencias As New StringBuilder Dim ObjInventarios As New ClsInventarios - Dim Index = 0 + Dim Index As Integer = 0 - For Each SerieRow In SeriesArreglo - Dim Row = DtContratosSerieDetalle.NewRow + For Each SerieRow As String In SeriesArreglo + Dim Row As DataRow = DtContratosSerieDetalle.NewRow Index = Index + 1 If Index > LbCantidad.Text.ToEntero() And LimitaCantidadSerie = 1 Then @@ -25417,7 +25377,7 @@ Partial Class Ventas End If 'VERIFICA EXISTENCIAS - Dim Existencia = ObjInventarios.GetExistenciasPS(CvePSSerie, CveUMSerie, UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=SerieRow) + Dim Existencia As Decimal = ObjInventarios.GetExistenciasPS(CvePSSerie, CveUMSerie, UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=SerieRow) If Existencia < 1 Then MensajeSinExistencias.Append($"Serie: {SerieRow}.
") Continue For @@ -25468,7 +25428,7 @@ Partial Class Ventas 'MODIFICA CANTIDAD DEL GV CONTRATOS For Each Gvr As GridViewRow In GvContratoDetalles.Rows If Gvr.DataKey("CvePS").ToEntero() = CvePSSerie Then - Dim Contador = DtContratosSerieDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr.DataKey("CveContratoDetalle"))).Rows.Count + Dim Contador As Integer = DtContratosSerieDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr.DataKey("CveContratoDetalle"))).Rows.Count Gvr.FCTextBox("TxtCant").Text = Contador.ToString() UPEstimaciones.Update() Exit For @@ -25488,7 +25448,7 @@ Partial Class Ventas '2 = ERROR '3 = SIN CELULAR - PROBLEMA CON EL CELULAR Try - Dim Mensaje = UsuarioActual.Empresa.Funcionalidad(152) + Dim Mensaje As String = UsuarioActual.Empresa.Funcionalidad(152) If Mensaje = "" Then Return 0 Dim Celular As String = "" @@ -25765,7 +25725,7 @@ Partial Class Ventas Dim tempArray() As String tempArray = fileItem.filename.ToString().Split("-".ToCharArray()) If RequiereOC And Not BtnModalClienteDocumentoCancelar.Visible Then - Dim Count = 0 + Dim Count As Integer = 0 For Each GvRow As GridViewRow In GvDocumentosCliente.Rows If GvRow.DataKey("Orden").ToEntero() = 1 Then IndexDocumentoCliente = Count @@ -25933,7 +25893,7 @@ Partial Class Ventas Protected Sub CargarArchivosOC(sender As Object, e As EventArgs) Dim Documentacion As String = "" RegistraScript("$('#DivDocsCliente').modal({ backdrop: 'static', keyboard: false });", "ModalArchivos") - Dim Count = 0 + Dim Count As Integer = 0 For Each GvRow As GridViewRow In GvDocumentosCliente.Rows If GvRow.DataKey("Orden").ToEntero() = 1 Then IndexDocumentoCliente = Count @@ -26340,7 +26300,7 @@ Partial Class Ventas End If Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png") - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + Dim logouri As String = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("EmpresaDireccion", UsuarioActual.Empresa.Direccion)) @@ -26664,9 +26624,9 @@ Partial Class Ventas TxtNCPorcentaje.Attributes.Add("onkeyup", "CalculaImporteNC();") TxtNCImporte.Attributes.Add("onkeyup", "CalculaPorcentajeNC();") - Dim PorcentajeMaximo = 0.0 + Dim PorcentajeMaximo As Decimal = 0 If TxtTotal.Text.ToDouble > 0 Then - PorcentajeMaximo = HplSaldoAuxiliar.Text.ToDouble * 100 / TxtTotal.Text.ToDouble + PorcentajeMaximo = HplSaldoAuxiliar.Text.ToDecimal * 100 / TxtTotal.Text.ToDecimal Else RVNCPorcentaje.MinimumValue = "0" RVTxtNCImporte.MinimumValue = "0" @@ -27030,7 +26990,7 @@ Partial Class Ventas SaldoMaximoUsadosFactura = SaldoMaximoCliente End If - Dim SaldoMaximoUtilizable = If(SaldoMaximoUsadosFactura < SaldoEntregado, SaldoMaximoUsadosFactura, SaldoEntregado) + Dim SaldoMaximoUtilizable As Decimal = If(SaldoMaximoUsadosFactura < SaldoEntregado, SaldoMaximoUsadosFactura, SaldoEntregado) If SaldoMaximoUtilizable > 0 Then HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString() @@ -27195,7 +27155,7 @@ Partial Class Ventas SaldoMaximoUsadosFactura = SaldoMaximoCliente End If - Dim SaldoMaximoUtilizable = If(SaldoMaximoUsadosFactura < SaldoEntregado, SaldoMaximoUsadosFactura, SaldoEntregado) + Dim SaldoMaximoUtilizable As Decimal = If(SaldoMaximoUsadosFactura < SaldoEntregado, SaldoMaximoUsadosFactura, SaldoEntregado) If SaldoMaximoUtilizable > 0 Then HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString() @@ -27350,7 +27310,7 @@ Partial Class Ventas End If If ListaBon.Count > 0 Then - Dim Bonificaciones = Me.TmpDTRNCBonificacionesCliente.Select(SbFiltro.ToString()) + Dim Bonificaciones As DataRow() = Me.TmpDTRNCBonificacionesCliente.Select(SbFiltro.ToString()) For Each RowBonificacion As DataRow In Bonificaciones Dim RNCBonificacion = ListaBon.Where(Function(x) x.CveVentaBonificacion = RowBonificacion("CveVenta").ToString().ToEntero()) @@ -27495,7 +27455,7 @@ Partial Class Ventas Using ObjAcum As New ClsAcumuladores For Each CveVentaRNC As String In ListaVentasRNCCargos If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=CveVentaRNC.ToEntero()) Then - Dim DtDist = ObjAcum.DtResultados.Copy() + Dim DtDist As DataTable = ObjAcum.DtResultados.Copy() If DtBon Is Nothing Then DtBon = DtDist.Clone() @@ -27527,7 +27487,7 @@ Partial Class Ventas End If If ListaBon.Count > 0 Then - Dim Bonificaciones = Me.TmpDTRNCBonificacionesCliente.Select(SbFiltro.ToString()) + Dim Bonificaciones As DataRow() = Me.TmpDTRNCBonificacionesCliente.Select(SbFiltro.ToString()) For Each RowBonificacion As DataRow In Bonificaciones Dim RNCBonificacion = ListaBon.Where(Function(x) x.CveVentaBonificacion = RowBonificacion("CveVenta").ToString().ToEntero()) @@ -27964,7 +27924,7 @@ Partial Class Ventas PorcentajeIEPS = PorcentajeIEPS - Dim DrSubProyecto = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, -1).FiltroPrimero("") + Dim DrSubProyecto As DataRow = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, -1).FiltroPrimero("") If DrSubProyecto Is Nothing Then Alert("Ocurrió un error al cargar la información de centro de costos. Por favor comuniquese con asistencia SIG", TipoMensaje.MsgError) @@ -28000,10 +27960,10 @@ Partial Class Ventas LimpiaDocumentoNC() End If - Dim CveSubProyecto = DrSubProyecto("CveSubProyecto").ToString().ToEntero() - Dim SubProyecto = DrSubProyecto("SubProyecto").ToString() - Dim CveProyecto = DrSubProyecto("CveProyecto").ToString().ToEntero() - Dim Proyecto = DrSubProyecto("Proyecto").ToString() + Dim CveSubProyecto As Integer = DrSubProyecto("CveSubProyecto").ToString().ToEntero() + Dim SubProyecto As String = DrSubProyecto("SubProyecto").ToString() + Dim CveProyecto As Integer = DrSubProyecto("CveProyecto").ToString().ToEntero() + Dim Proyecto As String = DrSubProyecto("Proyecto").ToString() AplicaNC = True @@ -28029,7 +27989,7 @@ Partial Class Ventas Dim DrBonRef As DataRow = Nothing 'EN LA NC DE BONIFICACION EL CONCEPTO DEBE SER SIEMPRE 'BONIFICACION POR USADO' - Dim DrPSBonificacion = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=NCBonificacion).FiltroPrimero("") + Dim DrPSBonificacion As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=NCBonificacion).FiltroPrimero("") If DrPSBonificacion IsNot Nothing Then DrBonRef = DrPSBonificacion Else @@ -28094,7 +28054,7 @@ Partial Class Ventas NCBonificacion = ArrayNC(4).ToEntero() End If - Dim DrPSBonificacion = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=NCBonificacion).FiltroPrimero("") + Dim DrPSBonificacion As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=NCBonificacion).FiltroPrimero("") If DrPSBonificacion IsNot Nothing Then CrearDTNCBonificacion(ListaRemisionesNC, DtImpuestosBonificacion, TmpDT, DrPSBonificacion, CveProyecto, Proyecto, CveSubProyecto, SubProyecto) Else @@ -28176,7 +28136,7 @@ Partial Class Ventas End Sub Private Sub CrearDTNCCargo(ListaNC As List(Of Modelos.Factura), ByRef TmpDTCargo As DataTable, DrPS As DataRow, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String) - For Each RNC In ListaNC + For Each RNC As Modelos.Factura In ListaNC Dim UltimoRenglonRNC As Integer = 1 Dim TotalAcumuladoRNC As Decimal = 0 Dim Terminar As Boolean = False @@ -28186,7 +28146,7 @@ Partial Class Ventas Dim Cantidad As Decimal = RowUsado("Cantidad").ToString().ToDecimal() Dim CvePSCargo As Integer = RowUsado("CvePS").ToString().ToEntero() - Dim Obs = "" + Dim Obs As String = "" 'SI ES ACUMULADOR LAS OBSERVACIOENS DEBEN SER EL NOMBRE DEL ACUMULADOR If ClsPaginas.GlobalDTAcumTamaños(UsuarioActual.CveEmpresa).FiltroPrimero($"CvePSCargo = {CvePSCargo}") IsNot Nothing Then Obs = RowUsado("CodigoPS").ToString() @@ -28198,15 +28158,15 @@ Partial Class Ventas Obs = String.Format("{0} - {1}", Obs, TxtNCObservaciones.Text.Trim()) End If - Dim ImportePU = RowUsado("PU").ToString().ToDecimal + Dim ImportePU As Decimal = RowUsado("PU").ToString().ToDecimal Dim TotalCalculableImpuestos As Decimal = (Cantidad * ImportePU) - Dim ImporteIVA = (TotalCalculableImpuestos * RowUsado("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2) - Dim ImporteIEPS = (TotalCalculableImpuestos * RowUsado("PorcentajeIEPS").ToString().ToDecimal).RoundSQL(2) - Dim ImporteRetIVA = (TotalCalculableImpuestos * RowUsado("PorcentajeRetIVA").ToString().ToDecimal).RoundSQL(2) - Dim ImporteRetISR = (TotalCalculableImpuestos * RowUsado("PorcentajeRetISR").ToString().ToDecimal).RoundSQL(2) - Dim ImporteTotal = TotalCalculableImpuestos + Dim ImporteIVA As Decimal = (TotalCalculableImpuestos * RowUsado("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2) + Dim ImporteIEPS As Decimal = (TotalCalculableImpuestos * RowUsado("PorcentajeIEPS").ToString().ToDecimal).RoundSQL(2) + Dim ImporteRetIVA As Decimal = (TotalCalculableImpuestos * RowUsado("PorcentajeRetIVA").ToString().ToDecimal).RoundSQL(2) + Dim ImporteRetISR As Decimal = (TotalCalculableImpuestos * RowUsado("PorcentajeRetISR").ToString().ToDecimal).RoundSQL(2) + Dim ImporteTotal As Decimal = TotalCalculableImpuestos TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR) @@ -28264,7 +28224,7 @@ Partial Class Ventas Next End Sub Private Sub CrearDTNCCargoDetalle(ListaNC As List(Of Modelos.Factura), ByRef TmpDTCargo As DataTable, DrPS As DataRow, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String) - For Each RNC In ListaNC + For Each RNC As Modelos.Factura In ListaNC Dim UltimoRenglonRNC As Integer = 1 Dim TotalAcumuladoRNC As Decimal = 0 Dim Terminar As Boolean = False @@ -28274,7 +28234,7 @@ Partial Class Ventas Dim Cantidad As Decimal = RowUsado("Cantidad").ToString().ToDecimal() Dim CvePSCargo As Integer = RowUsado("CvePS").ToString().ToEntero() - Dim Obs = "" + Dim Obs As String = "" 'SI ES ACUMULADOR LAS OBSERVACIOENS DEBEN SER EL NOMBRE DEL ACUMULADOR If ClsPaginas.GlobalDTAcumTamaños(UsuarioActual.CveEmpresa).FiltroPrimero($"CvePSCargo = {CvePSCargo}") IsNot Nothing Then Obs = RowUsado("CodigoPS").ToString() @@ -28292,15 +28252,15 @@ Partial Class Ventas Obs = String.Format("{0} - {1}", Obs, TxtNCObservaciones.Text.Trim()) End If - Dim ImportePU = RowUsado("PU").ToString().ToDecimal + Dim ImportePU As Decimal = RowUsado("PU").ToString().ToDecimal Dim TotalCalculableImpuestos As Decimal = (Cantidad * ImportePU) - Dim ImporteIVA = (TotalCalculableImpuestos * RowUsado("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2) - Dim ImporteIEPS = 0 '(TotalCalculableImpuestos * RowUsado("PorcentajeIEPS").ToString().ToDecimal).RoundSQL(2) - Dim ImporteRetIVA = 0 ' (TotalCalculableImpuestos * RowUsado("PorcentajeRetIVA").ToString().ToDecimal).RoundSQL(2) - Dim ImporteRetISR = 0 ' (TotalCalculableImpuestos * RowUsado("PorcentajeRetISR").ToString().ToDecimal).RoundSQL(2) - Dim ImporteTotal = TotalCalculableImpuestos + Dim ImporteIVA As Decimal = (TotalCalculableImpuestos * RowUsado("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2) + Dim ImporteIEPS As Decimal = 0 '(TotalCalculableImpuestos * RowUsado("PorcentajeIEPS").ToString().ToDecimal).RoundSQL(2) + Dim ImporteRetIVA As Decimal = 0 ' (TotalCalculableImpuestos * RowUsado("PorcentajeRetIVA").ToString().ToDecimal).RoundSQL(2) + Dim ImporteRetISR As Decimal = 0 ' (TotalCalculableImpuestos * RowUsado("PorcentajeRetISR").ToString().ToDecimal).RoundSQL(2) + Dim ImporteTotal As Decimal = TotalCalculableImpuestos TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA) @@ -28364,7 +28324,7 @@ Partial Class Ventas TmpDTDescNCBonificacion = TmpDTNC.Clone() TmpDTDescNCBonificacion.Clear() - For Each RNCBonificacion In ListaNCBonificacion + For Each RNCBonificacion As Modelos.Factura In ListaNCBonificacion Dim UltimoRenglonRNC As Integer = 1 Dim TotalAcumuladoRNC As Decimal = 0 Dim Terminar As Boolean = False @@ -28373,25 +28333,25 @@ Partial Class Ventas For Each RowCargo As DataRow In RNCCargo.DtDetalle.FiltraParametros("", Orderby:="PU").Rows - Dim PorcentajeAplicado = (RNCBonificacion.TotalRemNCAplicado / RNCBonificacion.Total) + Dim PorcentajeAplicado As Decimal = (RNCBonificacion.TotalRemNCAplicado / RNCBonificacion.Total) Dim Cantidad As Decimal = RowCargo("Cantidad").ToString().ToDecimal() '* PorcentajeAplicado - Dim Obs = RowCargo("CodigoPS").ToString() + Dim Obs As String = RowCargo("CodigoPS").ToString() If Not String.IsNullOrEmpty(TxtNCObservaciones.Text.Trim()) Then Obs = String.Format("{0} - {1}", Obs, TxtNCObservaciones.Text.Trim()) End If - Dim ImportePU = RowCargo("PUBonificacion").ToString().ToDecimal + Dim ImportePU As Decimal = RowCargo("PUBonificacion").ToString().ToDecimal Dim TotalCalculableImpuestos As Decimal = (Cantidad * ImportePU) - Dim ImporteIVA = (TotalCalculableImpuestos * RowCargo("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2) - Dim ImporteIEPS = (TotalCalculableImpuestos * RowCargo("PorcentajeIEPS").ToString().ToDecimal).RoundSQL(2) - Dim ImporteRetIVA = (TotalCalculableImpuestos * RowCargo("PorcentajeRetIVA").ToString().ToDecimal).RoundSQL(2) - Dim ImporteRetISR = (TotalCalculableImpuestos * RowCargo("PorcentajeRetISR").ToString().ToDecimal).RoundSQL(2) - Dim ImporteTotal = TotalCalculableImpuestos + Dim ImporteIVA As Decimal = (TotalCalculableImpuestos * RowCargo("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2) + Dim ImporteIEPS As Decimal = (TotalCalculableImpuestos * RowCargo("PorcentajeIEPS").ToString().ToDecimal).RoundSQL(2) + Dim ImporteRetIVA As Decimal = (TotalCalculableImpuestos * RowCargo("PorcentajeRetIVA").ToString().ToDecimal).RoundSQL(2) + Dim ImporteRetISR As Decimal = (TotalCalculableImpuestos * RowCargo("PorcentajeRetISR").ToString().ToDecimal).RoundSQL(2) + Dim ImporteTotal As Decimal = TotalCalculableImpuestos TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR) @@ -28452,7 +28412,7 @@ Partial Class Ventas TmpDTDescNCBonificacion = TmpDTNC.Clone() TmpDTDescNCBonificacion.Clear() - For Each RNCBonificacion In ListaNCBonificacion + For Each RNCBonificacion As Modelos.Factura In ListaNCBonificacion Dim UltimoRenglonRNC As Integer = 1 Dim TotalAcumuladoRNC As Decimal = 0 Dim Terminar As Boolean = False @@ -28460,16 +28420,16 @@ Partial Class Ventas 'Dim RNCCargo = ListaNC.Where(Function(f) f.CveVenta = RNCBonificacion.CveVentaRNCCargo).FirstOrDefault() For Each RowCargo As DataRow In TmpDT.FiltraParametros("EsCargo = True", Orderby:="PU").Rows - Dim CantidadCargo = RowCargo("Cantidad").ToString().ToDecimal() + Dim CantidadCargo As Decimal = RowCargo("Cantidad").ToString().ToDecimal() Dim ImportePU As Decimal = ClsPaginas.GlobalDTAcumTamaños(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Bonificacion", $"CvePSCargo={RowCargo("CvePS")}").ToDecimal() Dim TotalCalculableImpuestosCargo As Decimal = (CantidadCargo * ImportePU) Dim TotalCargo As Decimal = TotalCalculableImpuestosCargo + (TotalCalculableImpuestosCargo * RowCargo("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2) - Dim PorcentajeAplicado = (RNCBonificacion.TotalRemNCAplicado / TotalCargo) + Dim PorcentajeAplicado As Decimal = (RNCBonificacion.TotalRemNCAplicado / TotalCargo) Dim Cantidad As Decimal = RowCargo("Cantidad").ToString().ToDecimal() * PorcentajeAplicado - Dim Obs = RowCargo("CodigoPS").ToString() + Dim Obs As String = RowCargo("CodigoPS").ToString() If Not String.IsNullOrEmpty(TxtNCObservaciones.Text.Trim()) Then Obs = String.Format("{0} - {1}", Obs, TxtNCObservaciones.Text.Trim()) @@ -28481,11 +28441,11 @@ Partial Class Ventas Dim TotalCalculableImpuestos As Decimal = (Cantidad * ImportePU) - Dim ImporteIVA = (TotalCalculableImpuestos * RowCargo("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2) - Dim ImporteIEPS = (TotalCalculableImpuestos * RowCargo("PorcentajeIEPS").ToString().ToDecimal).RoundSQL(2) - Dim ImporteRetIVA = (TotalCalculableImpuestos * RowCargo("PorcentajeRetIVA").ToString().ToDecimal).RoundSQL(2) - Dim ImporteRetISR = (TotalCalculableImpuestos * RowCargo("PorcentajeRetISR").ToString().ToDecimal).RoundSQL(2) - Dim ImporteTotal = TotalCalculableImpuestos + Dim ImporteIVA As Decimal = (TotalCalculableImpuestos * RowCargo("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2) + Dim ImporteIEPS As Decimal = (TotalCalculableImpuestos * RowCargo("PorcentajeIEPS").ToString().ToDecimal).RoundSQL(2) + Dim ImporteRetIVA As Decimal = (TotalCalculableImpuestos * RowCargo("PorcentajeRetIVA").ToString().ToDecimal).RoundSQL(2) + Dim ImporteRetISR As Decimal = (TotalCalculableImpuestos * RowCargo("PorcentajeRetISR").ToString().ToDecimal).RoundSQL(2) + Dim ImporteTotal As Decimal = TotalCalculableImpuestos TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR) @@ -28546,7 +28506,7 @@ Partial Class Ventas TmpDTDescNCBonificacion = TmpDTCargo.Clone() TmpDTDescNCBonificacion.Clear() - For Each RNC In ListaNC + For Each RNC As Modelos.Factura In ListaNC Dim UltimoRenglonRNC As Integer = 1 Dim TotalAcumuladoRNC As Decimal = 0 Dim Terminar As Boolean = False @@ -28556,7 +28516,7 @@ Partial Class Ventas Dim Cantidad As Decimal = RowUsado("Cantidad").ToString().ToDecimal() Dim CvePSCargo As Integer = RowUsado("CvePS").ToString().ToEntero() - Dim Obs = "" + Dim Obs As String = "" 'SI ES ACUMULADOR LAS OBSERVACIOENS DEBEN SER EL NOMBRE DEL ACUMULADOR If ClsPaginas.GlobalDTAcumTamaños(UsuarioActual.CveEmpresa).FiltroPrimero($"CvePSCargo = {CvePSCargo}") IsNot Nothing Then Obs = RowUsado("CodigoPS").ToString() @@ -28568,15 +28528,15 @@ Partial Class Ventas Obs = String.Format("{0} - {1}", Obs, TxtNCObservaciones.Text.Trim()) End If - Dim ImportePU = RowUsado("PU").ToString().ToDecimal + Dim ImportePU As Decimal = RowUsado("PU").ToString().ToDecimal Dim TotalCalculableImpuestos As Decimal = (Cantidad * ImportePU) - Dim ImporteIVA = (TotalCalculableImpuestos * RowUsado("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2) - Dim ImporteIEPS = 0 '(TotalCalculableImpuestos * RowUsado("PorcentajeIEPS").ToString().ToDecimal).RoundSQL(2) - Dim ImporteRetIVA = 0 ' (TotalCalculableImpuestos * RowUsado("PorcentajeRetIVA").ToString().ToDecimal).RoundSQL(2) - Dim ImporteRetISR = 0 ' (TotalCalculableImpuestos * RowUsado("PorcentajeRetISR").ToString().ToDecimal).RoundSQL(2) - Dim ImporteTotal = TotalCalculableImpuestos + Dim ImporteIVA As Decimal = (TotalCalculableImpuestos * RowUsado("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2) + Dim ImporteIEPS As Decimal = 0 '(TotalCalculableImpuestos * RowUsado("PorcentajeIEPS").ToString().ToDecimal).RoundSQL(2) + Dim ImporteRetIVA As Decimal = 0 ' (TotalCalculableImpuestos * RowUsado("PorcentajeRetIVA").ToString().ToDecimal).RoundSQL(2) + Dim ImporteRetISR As Decimal = 0 ' (TotalCalculableImpuestos * RowUsado("PorcentajeRetISR").ToString().ToDecimal).RoundSQL(2) + Dim ImporteTotal As Decimal = TotalCalculableImpuestos TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA) @@ -28634,30 +28594,30 @@ Partial Class Ventas End Sub Private Sub CrearDTNCDevolucion(ListaNC As List(Of Modelos.Factura), ByRef TmpDTCargo As DataTable, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String) - For Each RNC In ListaNC + For Each RNC As Modelos.Factura In ListaNC Dim UltimoRenglonRNC As Integer = 1 Dim TotalAcumuladoRNC As Decimal = 0 Dim Terminar As Boolean = False For Each RowRNC As DataRow In RNC.DtDetalle.FiltraParametros("", Orderby:="PU").Rows - Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=RowRNC("CvePS").ToString().ToEntero()).FiltroPrimero("") + Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=RowRNC("CvePS").ToString().ToEntero()).FiltroPrimero("") Dim Cantidad As Decimal = RowRNC("Cantidad").ToString().ToDecimal() Dim CvePSCargo As Integer = RowRNC("CvePS").ToString().ToEntero() - Dim ImportePU = RowRNC("PU").ToString().ToDecimal + Dim ImportePU As Decimal = RowRNC("PU").ToString().ToDecimal Dim Obs As String = "" Dim TotalCalculableImpuestos As Decimal = (Cantidad * ImportePU) - Dim ImporteIVA = (TotalCalculableImpuestos * RowRNC("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2) - Dim ImporteIEPS = (TotalCalculableImpuestos * RowRNC("PorcentajeIEPS").ToString().ToDecimal).RoundSQL(2) - Dim ImporteRetIVA = (TotalCalculableImpuestos * RowRNC("PorcentajeRetIVA").ToString().ToDecimal).RoundSQL(2) - Dim ImporteRetISR = (TotalCalculableImpuestos * RowRNC("PorcentajeRetISR").ToString().ToDecimal).RoundSQL(2) - Dim ImporteTotal = TotalCalculableImpuestos + Dim ImporteIVA As Decimal = (TotalCalculableImpuestos * RowRNC("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2) + Dim ImporteIEPS As Decimal = (TotalCalculableImpuestos * RowRNC("PorcentajeIEPS").ToString().ToDecimal).RoundSQL(2) + Dim ImporteRetIVA As Decimal = (TotalCalculableImpuestos * RowRNC("PorcentajeRetIVA").ToString().ToDecimal).RoundSQL(2) + Dim ImporteRetISR As Decimal = (TotalCalculableImpuestos * RowRNC("PorcentajeRetISR").ToString().ToDecimal).RoundSQL(2) + Dim ImporteTotal As Decimal = TotalCalculableImpuestos TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR).RoundSQL @@ -28760,8 +28720,7 @@ Partial Class Ventas End If ObjVentas.Dispose() - - Dim DtImpuestosLocal = TmpDT.FiltraParametros("", "", {"PorcentajeIVA", "PorcentajeRetIVA", "PorcentajeRetISR", "PorcentajeIEPS", "CveSubProyecto"}).Copy() + Dim DtImpuestosLocal As DataTable = TmpDT.FiltraParametros("", "", {"PorcentajeIVA", "PorcentajeRetIVA", "PorcentajeRetISR", "PorcentajeIEPS", "CveSubProyecto"}).Copy() DtImpuestosLocal.Columns.Add("ImportePU", GetType(Decimal)) DtImpuestosLocal.Columns.Add("ImporteTotal", GetType(Decimal)) DtImpuestosLocal.Columns.Add("ImporteIVA", GetType(Decimal)) @@ -28843,7 +28802,7 @@ Partial Class Ventas Next - Dim importeNC = (DtImpuestosLocal.SUMD("ImporteTotal") + DtImpuestosLocal.SUMD("ImporteIVA") + DtImpuestosLocal.SUMD("ImporteIEPS") - DtImpuestosLocal.SUMD("ImporteRetIVA") - DtImpuestosLocal.SUMD("ImporteRetISR")) + Dim importeNC As Decimal = (DtImpuestosLocal.SUMD("ImporteTotal") + DtImpuestosLocal.SUMD("ImporteIVA") + DtImpuestosLocal.SUMD("ImporteIEPS") - DtImpuestosLocal.SUMD("ImporteRetIVA") - DtImpuestosLocal.SUMD("ImporteRetISR")) If AplicaDescuentos Then importeNC -= DtImpuestosLocal.SUMD("Descuento") @@ -29091,7 +29050,7 @@ Partial Class Ventas End If - Dim Dr = DtVentasNC.NewRow + Dim Dr As DataRow = DtVentasNC.NewRow Dr("CveVenta") = pCveVenta Dr("Importe") = Importe @@ -30016,8 +29975,8 @@ Partial Class Ventas Dim ObjVentas As New ClsVentas Dim ObjCGame As New ClsCGame(ObjVentas.IniciaTransacSQL()) Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL()) - Dim OcurrioError = False - Dim MensajeError = "" + Dim OcurrioError As Boolean = False + Dim MensajeError As String = "" Try 'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS @@ -30166,7 +30125,7 @@ Partial Class Ventas ObjVentas.Commit() 'ELIMINA PDF VIEJO - Dim ArchivoPDF = New System.IO.FileInfo(String.Format("{0}PDF\{1}\{2}-{3}.pdf", UsuarioActual.Empresa.Ruta, DdlTipoComprobante.SelectedValue, Serie, Folio)) + Dim ArchivoPDF As New System.IO.FileInfo(String.Format("{0}PDF\{1}\{2}-{3}.pdf", UsuarioActual.Empresa.Ruta, DdlTipoComprobante.SelectedValue, Serie, Folio)) If ArchivoPDF.Exists Then ArchivoPDF.Delete() End If @@ -31410,7 +31369,7 @@ Partial Class Ventas Exit Sub End If - Dim CveTipoDocto = DdlTipoComprobante.SelectedValue + Dim CveTipoDocto As String = DdlTipoComprobante.SelectedValue DdlTipoComprobante.Items.Clear() DdlTipoComprobante.Items.Insert(0, New ListItem("Ingresos", "Ing")) DdlTipoComprobante.Items.Insert(1, New ListItem("Anticipos", "Ant")) @@ -32340,7 +32299,7 @@ Partial Class Ventas PorcentajeIVA = Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2).ToDecimal For Each Row As DataRow In TmpDT.Rows If PorcentajeIVA > 0 Then - Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=Row("CvePS").ToString().ToEntero()).FiltroPrimero("") + Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=Row("CvePS").ToString().ToEntero()).FiltroPrimero("") If DrPS IsNot Nothing Then If DrPS("IVA").ToString().Contiene("-1", "") Then Row("PorcentajeIVA") = PorcentajeIVA @@ -32348,7 +32307,7 @@ Partial Class Ventas Row("PorcentajeIVA") = DrPS("IVA") End If - Dim PU = Row("PU").ToString().ToDecimal().RoundSQL(6) ' el precio unitario puede llevar hasta 6 decimales permitidos + Dim PU As Decimal = Row("PU").ToString().ToDecimal().RoundSQL(6) ' el precio unitario puede llevar hasta 6 decimales permitidos Dim TotalCalculableImpuestos As Decimal = (Row("Cantidad").ToString().ToDecimal * PU) - Row("Descuento").ToString().ToDecimal Dim TotalCalculableImpuestosIVA As Decimal = TotalCalculableImpuestos * (1 + Row("PorcentajeIEPS").ToString().ToDecimal) @@ -32406,8 +32365,8 @@ Partial Class Ventas For Each GvRow As GridViewRow In GvRemisionesNCDetalle.Rows If GvRow.RowType = DataControlRowType.DataRow Then If GvRow.FCCheckBox("ChkAplicar").Checked Then - Dim Rows = TmpDTRNCDetalle.Select($"CveVentaDetalleRNC = {GvRow.DataKey("CveVentaDetalleRNC").ToEntero()}") - For Each row In Rows + Dim Rows As DataRow() = TmpDTRNCDetalle.Select($"CveVentaDetalleRNC = {GvRow.DataKey("CveVentaDetalleRNC").ToEntero()}") + For Each row As DataRow In Rows row("Cantidad") = GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal() TmpDTRNCDetalleSelecciondas.Rows.Add(row.ItemArray) Next @@ -32526,8 +32485,8 @@ Partial Class Ventas For Each GvRow As GridViewRow In GvRemisionesNCBonDetalle.Rows If GvRow.RowType = DataControlRowType.DataRow Then If GvRow.FCCheckBox("ChkAplicar").Checked Then - Dim Rows = TmpDTRNCDetalle.Select($"CveVentaDetalleRNC = {GvRow.DataKey("CveVentaDetalleRNC").ToEntero()}") - For Each row In Rows + Dim Rows As DataRow() = TmpDTRNCDetalle.Select($"CveVentaDetalleRNC = {GvRow.DataKey("CveVentaDetalleRNC").ToEntero()}") + For Each row As DataRow In Rows row("Cantidad") = GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal() TmpDTRNCDetalleSelecciondas.Rows.Add(row.ItemArray) Next @@ -32546,7 +32505,7 @@ Partial Class Ventas If GvRow.FCCheckBox("ChkAplicar").Checked AndAlso GvRow.DataKey("CveVenta").ToEntero() = Dr("CveVenta").ToString().ToEntero() Then Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal() - Dim PU = GvRow.DataKey("PU").ToDecimal() + Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal() Dim PorcentajeIVA As Decimal = GvRow.DataKey("PorcentajeIVA").ToDecimal() Dim TotalCalculableImpuestos As Decimal = (Cantidad * PU) @@ -32652,7 +32611,7 @@ Partial Class Ventas Dim CvePSNC As Integer = ArrayNC(3).ToEntero() DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSNC, AplicaParaVenta:=1).FiltroPrimero("") Else - Dim CveSATNC = "84111506" + Dim CveSATNC As String = "84111506" DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1).Rows(0) End If @@ -32688,8 +32647,8 @@ Partial Class Ventas For Each GvRow As GridViewRow In GvDescNCCargosDetalle.Rows If GvRow.RowType = DataControlRowType.DataRow Then If GvRow.FCCheckBox("ChkAplicar").Checked Then - Dim Rows = TmpDTRNCDetalle.Select($"CveVentaDetalleRNC = {GvRow.DataKey("CveVentaDetalleRNC").ToEntero()}") - For Each row In Rows + Dim Rows As DataRow() = TmpDTRNCDetalle.Select($"CveVentaDetalleRNC = {GvRow.DataKey("CveVentaDetalleRNC").ToEntero()}") + For Each row As DataRow In Rows If GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal() > 0 Then row("Cantidad") = GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal() @@ -32707,7 +32666,6 @@ Partial Class Ventas End If Next - If TmpDTRNCDetalleSelecciondas.SUMD("Total") > LblSaldoMaximoUsados.Text.ToDecimal() Then Alert($"El importe no debe exceder el saldo maximo utilizable. Importe:{TmpDTRNCDetalleSelecciondas.SUMD("Total"):N2}", TipoMensaje.MsgAdvertencia) TmpDTRNCDetalleSelecciondas.Clear() @@ -32728,7 +32686,7 @@ Partial Class Ventas Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal() If Cantidad > 0 Then - Dim PU = GvRow.DataKey("PU").ToDecimal() + Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal() Dim PorcentajeIVA As Decimal = GvRow.DataKey("PorcentajeIVA").ToDecimal() Dim TotalCalculableImpuestos As Decimal = (Cantidad * PU) @@ -32808,7 +32766,7 @@ Partial Class Ventas 'SI TIENE ALGUN AJUSTE O GARANTIA If ListaNCDesc.Any(Function(RNC) RNC.Num2 = 1) Then - For Each RNC In ListaNCDesc.Where(Function(x) x.Num2 = 1) + For Each RNC As Modelos.Factura In ListaNCDesc.Where(Function(x) x.Num2 = 1) Dim Salir As Boolean = False Dim NCAjuste As Integer = -1 @@ -32852,8 +32810,8 @@ Partial Class Ventas For Each GvRow As GridViewRow In GvDescNCBonDetalle.Rows If GvRow.RowType = DataControlRowType.DataRow Then If GvRow.FCCheckBox("ChkAplicar").Checked Then - Dim Rows = TmpDTRNCBonificacionDetalle.Select($"CveVentaDetalleRNC = {GvRow.DataKey("CveVentaDetalleRNC").ToEntero()}") - For Each row In Rows + Dim Rows As DataRow() = TmpDTRNCBonificacionDetalle.Select($"CveVentaDetalleRNC = {GvRow.DataKey("CveVentaDetalleRNC").ToEntero()}") + For Each row As DataRow In Rows If GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal() > 0 Then row("Cantidad") = GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal() @@ -32883,7 +32841,7 @@ Partial Class Ventas Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal() If Cantidad > 0 Then - Dim PU = GvRow.DataKey("PU").ToDecimal() + Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal() Dim PorcentajeIVA As Decimal = GvRow.DataKey("PorcentajeIVA").ToDecimal() Dim TotalCalculableImpuestos As Decimal = (Cantidad * PU) @@ -33003,7 +32961,7 @@ Partial Class Ventas LblDescuentosRNC.Text = TotalRemNCAplicado.FormatoNumero LblTotalAPagar.Text = (TxtTotal.Text.ToDecimal() - TotalRemNCAplicado - TotalProntoPago).FormatoNumero - Dim CvePS = DrPS("CvePS").ToString().ToEntero() + Dim CvePS As Integer = DrPS("CvePS").ToString().ToEntero() AplicarNC(CvePS, NCDescuento:=True) Catch ex As Exception @@ -33176,9 +33134,9 @@ Partial Class Ventas Try Using wc As New HttpClient() - Dim Url = New Uri("http://polizavirtual.com.mx/webservice/api/Venta") + Dim Url As New Uri("http://polizavirtual.com.mx/webservice/api/Venta") - Dim Parametros = New List(Of KeyValuePair(Of String, String)) + Dim Parametros As New List(Of KeyValuePair(Of String, String)) Parametros.Add(New KeyValuePair(Of String, String)("User", User)) Parametros.Add(New KeyValuePair(Of String, String)("password", Password)) @@ -33215,7 +33173,7 @@ Partial Class Ventas Respuesta = response.Content.ReadAsStringAsync().Result - Dim resp = JArray.Parse(Respuesta) + Dim resp As JArray = JArray.Parse(Respuesta) If resp.Count > 0 Then Dim Msg As New StringBuilder() @@ -33264,7 +33222,7 @@ Partial Class Ventas If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 Then For Each RowServicio As DataRow In TmpDT.Rows - Dim tClienteRetIVA = ClienteRetIVA + Dim tClienteRetIVA As Decimal = ClienteRetIVA If tClienteRetIVA <= 0 Then If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then tClienteRetIVA = 0.106667D @@ -33282,7 +33240,7 @@ Partial Class Ventas Next TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").ToDecimal().FormatoNumero(2) - Dim PorcentajeRetIVA = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100) + Dim PorcentajeRetIVA As Decimal = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100) LblRetIVA.Text = PorcentajeRetIVA.FormatoNumero(2) If PorcentajeRetIVA > 0 Then TrRetIVA.Style.Add("display", "") @@ -33375,12 +33333,12 @@ Partial Class Ventas strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port) End If - Dim Url = New Uri(String.Format("{0}/Compras/PopUpVerFactura.aspx?P={1}", strURLHOST, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1®ENERAR={1}", CveVenta, If(Regenerar, "1", "0"))))) + Dim Url As New Uri(String.Format("{0}/Compras/PopUpVerFactura.aspx?P={1}", strURLHOST, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1®ENERAR={1}", CveVenta, If(Regenerar, "1", "0"))))) Dim File As Byte() = Nothing Try - Using httpClient = New HttpClient() + Using httpClient As New HttpClient() httpClient.Timeout = New TimeSpan(0, 2, 0) - Using request = New HttpRequestMessage(HttpMethod.Get, Url) + Using request As New HttpRequestMessage(HttpMethod.Get, Url) request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CveUsuario={2}", CveEmpresa, DateTime.UtcNow.Ticks, CveUsuarioCreo))) Dim response = httpClient.SendAsync(request).Result If GetBytes AndAlso response.StatusCode = Net.HttpStatusCode.OK Then @@ -33529,7 +33487,7 @@ Partial Class Ventas ObjVentas.Commit() BtnEditar.Text = "Editar" - Dim Liga = $"document.location.href=""/Ventas/Ventas.aspx?CveVenta={Me.CveVenta}"";" + Dim Liga As String = $"document.location.href=""/Ventas/Ventas.aspx?CveVenta={Me.CveVenta}"";" Alert("La venta se actualizó correctamente", TipoMensaje.MsgInformacion, Liga, TextoConfirmacion:="Aceptar", TextoSegundoBoton:=Nothing, JSBtn2:=Nothing, ShowCloseButton:=False) UpParametros.Update() @@ -33848,7 +33806,7 @@ Partial Class Ventas ObjFacturaProntoPago.Entrega = "" ObjFacturaProntoPago.CveAlmacen = -1 - Dim DtVentasNC = InicializaDTVentasNCProntoPago() + Dim DtVentasNC As DataTable = InicializaDTVentasNCProntoPago() Dim TotalImporte As Decimal = ObjFacturaProntoPago.DtDetalle.SUMD("TotalImporte") Dim ImporteIVA As Decimal = ObjFacturaProntoPago.DtDetalle.SUMD("ImporteIVA") @@ -33871,7 +33829,7 @@ Partial Class Ventas ObjFacturaProntoPago.Total = Total ObjFacturaProntoPago.TotalOtrosConceptos = 0 - Dim Drt = DtVentasNC.NewRow + Dim Drt As DataRow = DtVentasNC.NewRow Drt("CveVenta") = ObjFactura.CveVenta Drt("Importe") = ObjFactura.DescuentoProntoPago Drt("FolioFiscal") = ObjFactura.FolioFiscal @@ -33994,9 +33952,9 @@ Partial Class Ventas Dim Cantidad As Decimal = 1 Dim CveProyecto As Integer = DrSubProyecto("CveProyecto").ToString().ToEntero() - Dim CveSubProyecto = DrSubProyecto("CveSubProyecto").ToString.ToEntero - Dim SubProyecto = DrSubProyecto("SubProyecto").ToString - Dim Proyecto = DrSubProyecto("Proyecto").ToString + Dim CveSubProyecto As Integer = DrSubProyecto("CveSubProyecto").ToString.ToEntero + Dim SubProyecto As String = DrSubProyecto("SubProyecto").ToString + Dim Proyecto As String = DrSubProyecto("Proyecto").ToString Dim CveSATNC As Integer Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray()) @@ -34004,7 +33962,7 @@ Partial Class Ventas If ArrayNC.Length > 6 Then 'CONCEPTO DE PRONTO PAGO CveSATNC = ArrayNC(6).ToEntero() End If - Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CveSATNC, AplicaParaVenta:=1).FiltroPrimero("") + Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CveSATNC, AplicaParaVenta:=1).FiltroPrimero("") For Each Dr As DataRow In DtImpuestos.Rows AgregaTempDTNCProntoPago(ObjFacturaDevolucion.DtDetalle, DrPS("CvePS").ToString.ToEntero, DrPS("PS").ToString, DrPS("Codigo").ToString, DrPS("PSCodigo").ToString, DrPS("CveTipoPS").ToString.ToEntero, DrPS("Inv_CveMetodoInventario").ToString.ToEntero, @@ -34038,7 +33996,7 @@ Partial Class Ventas End If ObjVentas.Dispose() - Dim DtImpuestosLocal = TmpDT.FiltraParametros("", "", {"PorcentajeIVA", "PorcentajeRetIVA", "PorcentajeRetISR", "PorcentajeIEPS", "CveSubProyecto"}).Copy + Dim DtImpuestosLocal As DataTable = TmpDT.FiltraParametros("", "", {"PorcentajeIVA", "PorcentajeRetIVA", "PorcentajeRetISR", "PorcentajeIEPS", "CveSubProyecto"}).Copy DtImpuestosLocal.Columns.Add("ImportePU", GetType(Decimal)) DtImpuestosLocal.Columns.Add("ImporteTotal", GetType(Decimal)) DtImpuestosLocal.Columns.Add("ImporteIVA", GetType(Decimal)) @@ -34104,7 +34062,7 @@ Partial Class Ventas End Function Protected Function CreaDTDetalleNCProntoPago() As DataTable - Dim TmpDT = New DataTable + Dim TmpDT As New DataTable TmpDT.Columns.Add("CveVenta", GetType(Integer)) TmpDT.Columns.Add("Consec", GetType(Integer)) TmpDT.Columns.Add("Cantidad", GetType(Decimal)) @@ -34196,7 +34154,7 @@ Partial Class Ventas Return TmpDT End Function Private Function InicializaDTVentasNCProntoPago() As DataTable - Dim DtVentasNC = New DataTable + Dim DtVentasNC As New DataTable DtVentasNC.Columns.Add("CveVenta", GetType(Integer)) DtVentasNC.Columns.Add("Importe", GetType(Decimal)) DtVentasNC.Columns.Add("FolioFiscal", GetType(String)) @@ -35246,7 +35204,7 @@ Partial Class Ventas If UsuarioActual.CveEmpresa.Contiene(1) Then Dim ObjPS As New ClsProductosServicios If ObjPS.GetPorcentajeProductos(CveCliente) Then - Dim PrecioAplicado = ObjPS.DtResultados.FiltraParametros($"CvePS = {CvePSParametro}").FiltroPrimeroValor("PrecioA").ToDecimal + Dim PrecioAplicado As Decimal = ObjPS.DtResultados.FiltraParametros($"CvePS = {CvePSParametro}").FiltroPrimeroValor("PrecioA").ToDecimal If PrecioAplicado > 0 Then PrecioSugerido = PrecioAplicado End If @@ -35292,7 +35250,7 @@ Partial Class Ventas If PrecioSugerido = 0 Then Dim ObjInventarios As New ClsInventarios - Dim CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidadMercancia.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1) + Dim CostoPS As Decimal = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidadMercancia.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1) 'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal If CostoPS = 0 Then CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidadMercancia.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1) ObjInventarios.Dispose() @@ -35325,12 +35283,12 @@ Partial Class Ventas Protected Sub LnkUUIDRelacionados_Click(sender As Object, e As EventArgs) - Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, LblRFC.Text, TxtTotal.Text, True) + Dim Vigencia As Timbrado.AcuseCancelacionSAT = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, LblRFC.Text, TxtTotal.Text, True) Dim sb As New StringBuilder sb.AppendFormat("{0}
", Vigencia.EsCancelable) - Dim Relacionados = Timbrado.ConsultarUUIDRelacionados(UsuarioActual.Empresa, FolioFiscal, UsuarioActual.Empresa.FacturaProduccion) + Dim Relacionados As Timbrado.MRespUUIDRelacionados = Timbrado.ConsultarUUIDRelacionados(UsuarioActual.Empresa, FolioFiscal, UsuarioActual.Empresa.FacturaProduccion) If Relacionados IsNot Nothing Then Dim sbExtra As New StringBuilder() If Relacionados.Codigo = 500 Then @@ -35338,11 +35296,11 @@ Partial Class Ventas Else sbExtra.Append(Relacionados.Mensaje) - Dim SbHijos = New StringBuilder() - Dim SbPadres = New StringBuilder() + Dim SbHijos As New StringBuilder() + Dim SbPadres As New StringBuilder() If Relacionados.RelacionadosPadre IsNot Nothing Then - For Each padre In Relacionados.RelacionadosPadre + For Each padre As Timbrado.RelacionadosPadre In Relacionados.RelacionadosPadre SbPadres.AppendFormat("{0};", padre.Uuid) Next If SbPadres.Length > 0 Then @@ -35512,7 +35470,7 @@ Partial Class Ventas 'VERIFICA QUE LA CATEGORIA DE LOS PRODUCTOS DEBE SER LA MISMA DE LA LINEA ADICIONAL If TmpDT IsNot Nothing AndAlso Me.CveCategoriaLineaAdicional > 0 Then For Each Row As DataRow In TmpDT.FiltraParametros("", DistinctColumns:={"CveClasificacion"}).Rows - Dim RowClasificacion = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=Row("CveClasificacion").ToString().ToEntero()).FiltroPrimero("") + Dim RowClasificacion As DataRow = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=Row("CveClasificacion").ToString().ToEntero()).FiltroPrimero("") If RowClasificacion IsNot Nothing Then Dim CveCategoria As Integer = RowClasificacion("CveCategoria").ToString().ToEntero() @@ -35647,7 +35605,7 @@ Partial Class Ventas If DivPrecioLista.Visible AndAlso DdlPrecioLista.SelectedValue.ToEntero() > 0 Then Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero()).FiltroPrimero("") - Dim ObjPrecioSugerido = CalculaPrecioSugerido(drPS("CvePS").ToString().ToEntero(), drPS("CveClasificacion").ToString().ToEntero(), CvePrecioListaSugerido:=DdlPrecioLista.SelectedValue.ToEntero()) + Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = CalculaPrecioSugerido(drPS("CvePS").ToString().ToEntero(), drPS("CveClasificacion").ToString().ToEntero(), CvePrecioListaSugerido:=DdlPrecioLista.SelectedValue.ToEntero()) If ObjPrecioSugerido.PrecioSugerido > 0 Then TxtPrecio.Text = ObjPrecioSugerido.PrecioSugerido.ToString("#,###.####") From 06999ef50a3c54a348114549a4037a85f4a3dbb5 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 18 Sep 2023 09:29:09 -0700 Subject: [PATCH 10/35] -- option explicit --- OC/OC.aspx.vb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index e2f73fcd2..1611935e6 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -3591,11 +3591,11 @@ Partial Class OC_OC If CveEstatusFinalError > 0 Then Dim objOrdenCompra As New ClsOC objOrdenCompra.IniciaTransacSQL() - Dim TieneError = False + Dim TieneError As Boolean = False 'AC Dim ObjAC As ClsContPAQi = Nothing - Dim PolizaCancelacion = -1 + Dim PolizaCancelacion As Integer = -1 If UsuarioActual.Empresa.UsaAC Then ObjAC = New ClsContPAQi(UsuarioActual.Empresa) ObjAC.IniciaTransacSQL() @@ -3655,8 +3655,8 @@ Partial Class OC_OC ' > 0: GENERO POLIZA DE CANCELACION ' < 0: ERROR - Dim ErrorCancelar = False - Dim IdPolizaNueva = 0 + Dim ErrorCancelar As Boolean = False + Dim IdPolizaNueva As Integer = 0 If IDPolizaPresupuestal > 0 Then Dim dt As DataTable From 5d79623df80ff3b0336541521c51630d6d84ab2c Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 18 Sep 2023 10:48:07 -0700 Subject: [PATCH 11/35] -- mejora visual al editar --- Inventarios/EntradasSalidas.aspx | 25 +++------ Inventarios/EntradasSalidas.aspx.vb | 87 ++++++++++------------------- 2 files changed, 37 insertions(+), 75 deletions(-) diff --git a/Inventarios/EntradasSalidas.aspx b/Inventarios/EntradasSalidas.aspx index 98cca3b3c..d1cb6cc32 100644 --- a/Inventarios/EntradasSalidas.aspx +++ b/Inventarios/EntradasSalidas.aspx @@ -821,20 +821,14 @@
- - - - + - - - - + @@ -847,12 +841,7 @@ - - - - - - + @@ -1748,9 +1737,9 @@
- --%> <%--
--%> @@ -1768,13 +1757,13 @@
- +
- +
diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 6319cb177..97e5cf659 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -539,10 +539,6 @@ Partial Class Inventarios_EntradasSalidas End If End Sub - Private Function isWhitFamily() As Boolean - Return (UsuarioActual.CveEmpresa = 66) - End Function - #Region " VALORES INICIALES " Protected Sub CreaDT() Dim dt As New DataTable @@ -603,16 +599,16 @@ Partial Class Inventarios_EntradasSalidas End Sub Private Sub CargaCombos() 'Llenar el dropdownlist de Secciones - If UsuarioActual.CveEmpresa = 66 Then - DdlClasificacion.DataSource = GlobalDTSubFamilias(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion") - Else - Dim ObjClasificaciones As New ClsClasificaciones - If ObjClasificaciones.GetClasificacionesExistencias(UsuarioActual.CveEmpresa) Then - DdlClasificacion.DataSource = ObjClasificaciones.DtResultados - End If - ObjClasificaciones.Dispose() - End If - DdlClasificacion.DataBind() + 'If UsuarioActual.CveEmpresa = 66 Then + ' DdlClasificacion.DataSource = GlobalDTSubFamilias(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion") + 'Else + ' Dim ObjClasificaciones As New ClsClasificaciones + ' If ObjClasificaciones.GetClasificacionesExistencias(UsuarioActual.CveEmpresa) Then + ' DdlClasificacion.DataSource = ObjClasificaciones.DtResultados + ' End If + ' ObjClasificaciones.Dispose() + 'End If + 'DdlClasificacion.DataBind() 'DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1) 'DdlSeccionAlmacen.DataBind() @@ -1293,7 +1289,7 @@ Partial Class Inventarios_EntradasSalidas End Sub Private Sub LimpiarAgregar() - DdlClasificacion.SelectedValue = "-1" + 'DdlClasificacion.SelectedValue = "-1" txtCantidad.Text = "" TxtnLote.Text = "" TxtObservacionesdetalle.Text = "" @@ -1459,7 +1455,6 @@ Partial Class Inventarios_EntradasSalidas TxtnLote.Text = "" LblCodigo.Text = "" TxtnSerie.Text = "" - TxtnLote.Text = "" TxtnFechaCaducidad.Text = "" HdnCodigoAF.Value = "-1" HdnCveActivoFijo.Value = "-1" @@ -2540,30 +2535,22 @@ Partial Class Inventarios_EntradasSalidas TxtFolio.Text = Folio.ToString FolioAsignado = Folio End Sub - Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacion.SelectedIndexChanged - ChangeDdlProducto() - End Sub + 'Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacion.SelectedIndexChanged + ' ChangeDdlProducto() + 'End Sub Private Sub ChangeDdlProducto() If UsuarioActual.Empresa.Funcionalidad(105) = "" Then Dim filtro As String = "" - If Not (DdlClasificacion.SelectedValue = "-1") Then - - If isWhitFamily() Then - filtro = String.Format("CveSubFamilia={0}", DdlClasificacion.SelectedValue) - Else - filtro = String.Format("CveClasificacion={0}", DdlClasificacion.SelectedValue) - End If - End If + 'If Not (DdlClasificacion.SelectedValue = "-1") Then + ' filtro = String.Format("CveClasificacion={0}", DdlClasificacion.SelectedValue) + 'End If DdlProducto2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltraParametros($"{filtro} AND CveTipoPS = 2", "PSCodigo") DdlProducto2.DataBind() DdlProducto2.ddl.Items.Insert(0, New ListItem("Seleccione", "-1")) Else - If isWhitFamily() Then - DdlProducto2.ddlWS.Attributes.Add("data-idSubFamilia", DdlClasificacion.SelectedValue) - Else - DdlProducto2.ddlWS.Attributes.Add("data-idClasificacion", DdlClasificacion.SelectedValue) - End If + 'DdlProducto2.ddlWS.Attributes.Add("data-idClasificacion", DdlClasificacion.SelectedValue) + End If End Sub @@ -2571,27 +2558,20 @@ Partial Class Inventarios_EntradasSalidas ElProductoChange() End Sub Private Sub ElProductoChange() - TxtnSerie.Visible = False - divSerie.Visible = False - TxtnLote.Visible = False + divSerie.Visible = False divLote.Visible = False EscondeColumnasGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' ")) If DdlProducto2.SelectedValue.ToEntero > 0 Then - Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, DdlProducto2.SelectedValue.ToEntero).FiltroPrimero("") + Dim dr As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=DdlProducto2.SelectedValue.ToEntero).FiltroPrimero("") If dr IsNot Nothing Then If CBool(dr("AplicaSerie")) Then - - TxtnSerie.Visible = True divSerie.Visible = True - End If If CBool(dr("AplicaLote")) Then - TxtnLote.Visible = True divLote.Visible = True - End If If CBool(dr("AplicaSeccion")) Then divSeccionAlmacen.Visible = True @@ -2604,7 +2584,6 @@ Partial Class Inventarios_EntradasSalidas End If If CBool(dr("AplicaCaducidad")) Then divCaducidad.Visible = True - End If End If @@ -2628,7 +2607,7 @@ Partial Class Inventarios_EntradasSalidas End Sub Private Sub EscondeColumnasGVM(DtTemp As DataTable) 'LblSerie.Visible = False - TxtnSerie.Visible = False + divSerie.Visible = False 'TrSerieLote.Visible = False 'TrSerieLote2.Visible = False @@ -2641,16 +2620,11 @@ Partial Class Inventarios_EntradasSalidas TxtnSerie.Visible = True End If - TxtnLote.Visible = False + 'divLote.Visible = False 'TrLote.Visible = False 'TrLote2.Visible = False GvM.Columns(10).Visible = False - 'TxtnBatch.Visible = False - 'TrBatch.Visible = False - 'TrBatch2.Visible = False - 'GvM.Columns(11).Visible = False - Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201) tdPUExtranjero.Visible = False tdPUExtranjero2.Visible = False @@ -2724,12 +2698,11 @@ Partial Class Inventarios_EntradasSalidas If (CveMovimiento > 0) Or (TieneRelacionado > 0 Or CveMovimientoRelacionado > 0) Then 'CveMovimiento > 0 And e.Row.DBCampo("TienePrePoliza").ToEntero > 0 e.Row.FCTextBox("txtPrecio").Enabled = False e.Row.FCTextBox("LblEditCodigo").Enabled = False - e.Row.FCTextBox("TxtSerie").Enabled = False - e.Row.FCTextBox("TxtLote").Enabled = False - e.Row.FCDropDownList("DdlSeccionAlmacen").Enabled = False - e.Row.FCTextBox("txtPrecio").Enabled = False + 'e.Row.FCTextBox("TxtSerie").Enabled = False + 'e.Row.FCTextBox("TxtLote").Enabled = False + 'e.Row.FCDropDownList("DdlSeccionAlmacen").Enabled = False' End If - e.Row.FCTextBox("TxtSerie").Enabled = True + 'e.Row.FCTextBox("TxtSerie").Enabled = True End If If EsNuevoMov Then @@ -2795,7 +2768,7 @@ Partial Class Inventarios_EntradasSalidas If CveMovimiento > 0 Then CveMovimientoDetalleEdit = GvRow.DataKey("CveMovimientoDetalle").ToEntero txtCantidad.Enabled = False - DdlClasificacion.Enabled = False + 'DdlClasificacion.Enabled = False DdlProducto2.Enabled = False DdlUnidad.Enabled = False @@ -2808,7 +2781,7 @@ Partial Class Inventarios_EntradasSalidas ElProductoChange() DdlUnidad.SelectedValue = GvRow.DataKey("CveUM") CveAFEdit = GvRow.DataKey("CveAF").ToEntero - txtPrecio.Text = GvRow.DataKey("PU").ToDouble.FormatoNumero + txtPrecio.Text = GvRow.DataKey("PU").ToDouble.ToString("0.00########") TxtnSerie.Text = GvRow.DataKey("Serie") TxtnLote.Text = GvRow.DataKey("Lote") TxtnFechaCaducidad.Text = GvRow.DataKey("FechaCaducidad").ToDate.ToShortDateString @@ -5313,7 +5286,7 @@ Partial Class Inventarios_EntradasSalidas Private Sub limpiarModalDetalle() txtCantidad.Enabled = True - DdlClasificacion.Enabled = True + 'DdlClasificacion.Enabled = True DdlProducto2.Enabled = True DdlUnidad.Enabled = True divCantidad.Visible = True From d6aa9a236cb6717d1083e340bb21fe8981f5595c Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 18 Sep 2023 12:12:38 -0700 Subject: [PATCH 12/35] --Conta formato Cuenta --- App_Code/ClsSisEmpresas.vb | 1 + App_Code/Empresa.vb | 1 + Contabilidad2/CatCuentas.aspx | 4 +--- Contabilidad2/CatCuentas.aspx.vb | 14 ++++++-------- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/App_Code/ClsSisEmpresas.vb b/App_Code/ClsSisEmpresas.vb index 6cce01769..9e12c8c4c 100644 --- a/App_Code/ClsSisEmpresas.vb +++ b/App_Code/ClsSisEmpresas.vb @@ -423,6 +423,7 @@ Public Class ClsSisEmpresas _Empresa.DiasPermitidos = Data.Rows(0)("DiasPermitidos").ToString.ToEntero _Empresa.TipoContabilizacion = Data.Rows(0)("Conta_TipoContabilizacion").ToString.ToEntero _Empresa.TipoContabilidad = Data.Rows(0)("Conta_TipoContabilidad").ToString.ToEntero '0 - Sin Conta, 1- Contabilidad SIG, 2- Contabilidad Contpaq + _Empresa.ContaFormatoCuenta = Data.Rows(0)("Conta_FormatoCuenta").ToString _Empresa.DefaultAsistencias = If(Data.Rows(0)("RH_DefaultAsistencias").ToString = "", False, CBool(Data.Rows(0)("RH_DefaultAsistencias").ToString)) _Empresa.CIEC = Data.Rows(0)("CIEC").ToString _Empresa.Localidad = Data.Rows(0)("Localidad").ToString diff --git a/App_Code/Empresa.vb b/App_Code/Empresa.vb index c0c231714..f1fa5817d 100644 --- a/App_Code/Empresa.vb +++ b/App_Code/Empresa.vb @@ -97,6 +97,7 @@ Public Class Empresa Public Property Soporte_Tipo As String Public Property Timbres As Integer Public Property _RutaArchivos As String + Public Property ContaFormatoCuenta As String Public ReadOnly Property Ruta As String Get diff --git a/Contabilidad2/CatCuentas.aspx b/Contabilidad2/CatCuentas.aspx index 9810d4268..6e61f6432 100644 --- a/Contabilidad2/CatCuentas.aspx +++ b/Contabilidad2/CatCuentas.aspx @@ -99,9 +99,7 @@
Cuenta
- - - +
diff --git a/Contabilidad2/CatCuentas.aspx.vb b/Contabilidad2/CatCuentas.aspx.vb index fc3ff2418..ce3ff3bfb 100644 --- a/Contabilidad2/CatCuentas.aspx.vb +++ b/Contabilidad2/CatCuentas.aspx.vb @@ -149,20 +149,18 @@ Partial Class Contabilidad2_CatCuentas Private Sub CargaDatos() 'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) Dim ObjConta As New ClsContabilidad - - If ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then DtDatos = ObjConta.DtResultados End If ObjConta.Dispose() 'para obtener la mascara, tomo el primer dato y reemplazo los numeros por cero - Dim Mascara As String = "####-####-###" - If DtDatos IsNot Nothing AndAlso DtDatos.Rows.Count > 0 Then - Mascara = DtDatos.Rows(0)("Codigo").ToString.Replace("1", "0").Replace("2", "0").Replace("3", "0").Replace("4", "0").Replace("5", "0").Replace("6", "0").Replace("7", "0").Replace("8", "0").Replace("9", "0") - End If + Dim Mascara As String = UsuarioActual.Empresa.ContaFormatoCuenta.Replace("X", "9") '"###-##-####" + 'If DtDatos IsNot Nothing AndAlso DtDatos.Rows.Count > 0 Then + ' Mascara = DtDatos.Rows(0)("Codigo").ToString.Replace("1", "0").Replace("2", "0").Replace("3", "0").Replace("4", "0").Replace("5", "0").Replace("6", "0").Replace("7", "0").Replace("8", "0").Replace("9", "0") + 'End If - MEECuenta.Mask = Mascara.Replace("0", "9") + MEECuenta.Mask = Mascara '.Replace("0", "9") MEECuenta.AutoComplete = True MEECuenta.AutoCompleteValue = Mascara @@ -432,7 +430,7 @@ Partial Class Contabilidad2_CatCuentas Dim ObjConta As New ClsContabilidad Dim CuentaEfectivo As Integer = 0 'Dim Afectable As Integer = 1 'If(DcuentaMayor.SelectedValue <> 2, 0, 1) ' cuando sea tipo 2, va a ser afectable - Tcuenta.Text.Replace("-", "") + TxtCuenta.Text.Replace("-", "") Dim idnew As Integer = 0 Dim CveConceptoContable As Integer = DdlConcepto.SelectedValue.ToEntero() From 456c6fb4f9cf16f28f4889e3f590e2779ea67d14 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 18 Sep 2023 17:28:12 -0700 Subject: [PATCH 13/35] Endpoint de clasificaciones para E119 --- App_Code/ClsInventarios.vb | 3 ++- Ashx/E119.ashx | 53 +++++++++++++++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 502282246..d9bc6774f 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -5985,12 +5985,13 @@ Public Class ClsInventarios End Function - Public Function GetJAM_APIs(Optional Opcion As Integer = 1) As Boolean + Public Function GetJAM_APIs(Optional Opcion As Integer = 1, Optional CveClasificacion As Integer = -1) As Boolean Dim Retorno As Boolean = False Dataset = New DataSet() DataAdapter("PA_JAM_APIs") With SqlAdapter.SelectCommand.Parameters .Add("@Opcion", SqlDbType.Int).Value = Opcion + .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion End With Try diff --git a/Ashx/E119.ashx b/Ashx/E119.ashx index 07a7adc94..1928e7701 100644 --- a/Ashx/E119.ashx +++ b/Ashx/E119.ashx @@ -114,6 +114,18 @@ Public Class E119 : Implements IHttpHandler End If End If + If Metodo = "ConsultarClasificaciones" Then + context.Response.ContentType = "application/json" + Dim Auth = ValidarSolicitud(context) + + If Auth.IsSucces Then + retorno = ConsultaClasificaciones(context) + Else + context.Response.StatusCode = Auth.StatusCode + retorno = JsonConvert.SerializeObject(Auth.ErrorMessage) + End If + End If + context.Response.Write(retorno) Catch ex As Exception @@ -226,10 +238,16 @@ Public Class E119 : Implements IHttpHandler Dim RespuestaError As New ResponseMsgError Dim TieneError As Boolean = False + Dim CveClasificacion = If(context.Request("CveClasificacion") = Nothing, "", context.Request("CveClasificacion").ToString()) + + If String.IsNullOrEmpty(CveClasificacion) Then + CveClasificacion = "-1" + End If + Dim Productos As JArray = Nothing Using ObjInventario As New ClsInventarios - If ObjInventario.GetJAM_APIs(1) AndAlso ObjInventario.DtResultados IsNot Nothing Then + If ObjInventario.GetJAM_APIs(1, CveClasificacion:=CveClasificacion.ToEntero()) AndAlso ObjInventario.DtResultados IsNot Nothing Then Productos = JArray.Parse(ObjInventario.DtResultados.DataTableToJSONIPP()) Else RespuestaError.message = "no se pudo obtener los datos" @@ -256,6 +274,39 @@ Public Class E119 : Implements IHttpHandler End If End Function + Private Function ConsultaClasificaciones(ByVal context As HttpContext) As String + Dim Respuesta As New ResponseMsg + Dim RespuestaError As New ResponseMsgError + Dim TieneError As Boolean = False + + Dim Clasificaciones As JArray = Nothing + + Try + Clasificaciones = JArray.Parse(ClsPaginas.GlobalDTClasificaciones(CveEmpresa).FiltraParametros("", DistinctColumns:={"CveClasificacion", "Clasificacion"}).DataTableToJSONIPP()) + Catch ex As Exception + RespuestaError.message = "no se pudo obtener los datos" + TieneError = True + End Try + + Dim Msg As String = "Información día " & Now.ToShortDateString & If(RespuestaError.message <> "", " Error: " & RespuestaError.message, "") + Msg.GuardaLogAD("LogE119") + + If TieneError Then + context.Response.StatusCode = 200 + Return JsonConvert.SerializeObject(RespuestaError) + Else + context.Response.StatusCode = 200 + Try + Respuesta.data = New JObject(New JProperty("Clasificaciones", Clasificaciones)) + Respuesta.message = "Los datos se obtuvieron correctamente" + Return JsonConvert.SerializeObject(Respuesta) + Catch ex As Exception + RespuestaError.message = "Ocurrió un error al generar la petición" + Return JsonConvert.SerializeObject(RespuestaError) + End Try + End If + End Function + Private Class ResponseMsg Sub New() status = "success" From ff3c1a139dd8644b127473ac91abafd6c655fb69 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 19 Sep 2023 22:06:31 -0700 Subject: [PATCH 14/35] - metodo pedimento en ventas --- App_Code/ClsInventarios.vb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index c31d7663f..862c9858e 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -6063,6 +6063,25 @@ Public Class ClsInventarios Return Retorno End Function + Public Function GetVentasPedimento(CveVenta As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_VentasPedimentosGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al consultar los productos por serie.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + #Region " IDisposable Support " ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) From dd4cbc02b4a71179699b640d09f3696136ef097b Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 20 Sep 2023 12:08:01 -0700 Subject: [PATCH 15/35] -- formato pedimento --- Compras/Compras.aspx | 81 +- Compras/Compras.aspx.vb | 2382 +++++++++++++++++++-------------------- 2 files changed, 1194 insertions(+), 1269 deletions(-) diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 98d818134..9104bd152 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -4,9 +4,9 @@ -
  • + <%--
  • -
  • + --%>
    @@ -62,9 +62,9 @@ -
  • + <%--
  • Contabilizar -
  • + --%>
  • Pagar
  • @@ -502,7 +502,7 @@ - <%----%> + <%----%>
    @@ -2516,13 +2516,13 @@
    - +
    +
    Observaciones Generales: 
    -
    @@ -3433,57 +3433,7 @@
    - - - +