From 4e3b3ea27816b43b85dab0f417477cf990e92c57 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 12 Sep 2024 13:23:42 -0700 Subject: [PATCH 1/6] -- filtro por CP, en localidad --- App_Code/ClsGenerales.vb | 5 +++-- App_Code/ClsPaginas.vb | 19 +++++++------------ Inventarios/CartaPorteManual.aspx.vb | 10 ++++------ Planeacion/CatSubProyectos.aspx.vb | 4 ++-- 4 files changed, 16 insertions(+), 22 deletions(-) diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 6d292dd55..b36cf01da 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -3059,12 +3059,13 @@ Public Class ClsGenerales End Function - Public Function GetSATLocalidad(Optional CveEstado As Integer = -1, Optional CveMunicipio As Integer = -1) As Boolean + Public Function GetSATLocalidad(Optional CveEstado As Integer = -1, Optional CveMunicipio As Integer = -1, Optional CodigoPostal As String = "-1") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Gral_SAT_LocalidadGet") With SqlAdapter.SelectCommand.Parameters .Add("@CveEstado", SqlDbType.VarChar).Value = CveEstado - .Add("@CveMunicipio", SqlDbType.VarChar).Value = CveMunicipio + .Add("@CveMunicipio", SqlDbType.VarChar).Value = CveMunicipio + .Add("@CodigoPostal", SqlDbType.VarChar).Value = CodigoPostal End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 6cf4c4ce7..a1016870a 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -589,25 +589,20 @@ Public Class ClsPaginas End Set End Property - Property GlobalDTLocalidad(Optional CveEstado As Integer = -1, Optional CveMunicipio As Integer = -1) As DataTable + Property GlobalDTLocalidad(Optional CveEstado As Integer = -1, Optional CveMunicipio As Integer = -1, Optional CodigoPostal As String = "-1") As DataTable Get If Application("GlobalDTLocalidad") Is Nothing Then Dim ObjGrales As New ClsGenerales If ObjGrales.GetSATLocalidad(-1, -1) Then Application("GlobalDTLocalidad") = ObjGrales.DtResultados ObjGrales.Dispose() End If - Dim StrFiltro As String = "" - If CveEstado > 0 And CveMunicipio > 0 Then - StrFiltro = $" CveEstado = '{CveEstado}' AND CveMunicipio = '{CveMunicipio}'" - ElseIf CveEstado > 0 Then - StrFiltro = $" CveEstado = '{CveEstado}'" - ElseIf CveMunicipio > 0 Then - StrFiltro = $" CveMunicipio = '{CveMunicipio}'" - Else - StrFiltro = "" - End If + Dim filtros As New List(Of String) + If CveEstado > 0 And CveMunicipio > 0 Then filtros.Add($" CveEstado = '{CveEstado}' AND CveMunicipio = '{CveMunicipio}'") + If CveEstado > 0 Then filtros.Add($" CveEstado = '{CveEstado}'") + If CveMunicipio > 0 Then filtros.Add($" CveMunicipio = '{CveMunicipio}'") + If CodigoPostal <> "-1" Then filtros.Add($" CP = '{CodigoPostal}'") - Dim Dv As New DataView(DirectCast(Application("GlobalDTLocalidad"), DataTable), StrFiltro, "", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(Application("GlobalDTLocalidad"), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) GlobalDTLocalidad = Dv.ToTable Dv.Dispose() diff --git a/Inventarios/CartaPorteManual.aspx.vb b/Inventarios/CartaPorteManual.aspx.vb index 71f333a2a..0619d16a4 100644 --- a/Inventarios/CartaPorteManual.aspx.vb +++ b/Inventarios/CartaPorteManual.aspx.vb @@ -548,11 +548,11 @@ Partial Class Inventarios_CartaPorteManual If Tipo = 1 Then CveDireccionOrigen = ObjClientes.DireccionEnvioAdd(-1, EnvioDireccion, EnvioNoExt, EnvioNoInt, "", "", "", EnvioCP, "", UsuarioActual.CveUsuario, 1, -1, "", - CvePais:=CvePais, CveEstado:=CveEstado, CveMunicipio:=CveMunicipio, CveLocalidad:=CveLocalidad, CveColonia:=CveColonia) + CvePais:=CvePais, CveEstado:=CveEstado, CveMunicipio:=CveMunicipio, CveLocalidad:=CveLocalidad, CveColonia:=CveColonia, CveEmpresa:=UsuarioActual.CveEmpresa) Else CveDireccionDestino = ObjClientes.DireccionEnvioAdd(-1, EnvioDireccion, EnvioNoExt, EnvioNoInt, "", "", "", EnvioCP, "", UsuarioActual.CveUsuario, 1, -1, "", - CvePais:=CvePais, CveEstado:=CveEstado, CveMunicipio:=CveMunicipio, CveLocalidad:=CveLocalidad, CveColonia:=CveColonia) + CvePais:=CvePais, CveEstado:=CveEstado, CveMunicipio:=CveMunicipio, CveLocalidad:=CveLocalidad, CveColonia:=CveColonia, CveEmpresa:=UsuarioActual.CveEmpresa) End If Next @@ -1081,12 +1081,10 @@ Partial Class Inventarios_CartaPorteManual DdlDirClienteLocalidad.Items.Clear() If DdlDirClienteEstado.SelectedValue.ToEntero > 0 Then - DdlDirClienteLocalidad.DataSource = GlobalDTLocalidad(DdlDirClienteEstado.SelectedValue.ToEntero, DdlDirClienteMunicipio.SelectedValue.ToEntero) + DdlDirClienteLocalidad.DataSource = GlobalDTLocalidad(DdlDirClienteEstado.SelectedValue.ToEntero, DdlDirClienteMunicipio.SelectedValue.ToEntero, CodigoPostal:=TxtEnvioCP.Text.Trim) DdlDirClienteLocalidad.DataBind() End If - - DdlDirClienteLocalidad.Items.Insert(0, New ListItem("Seleccione una", "-1")) - + DdlDirClienteLocalidad.Items.Insert(0, New ListItem("-", "-1")) End Sub diff --git a/Planeacion/CatSubProyectos.aspx.vb b/Planeacion/CatSubProyectos.aspx.vb index f6d48d7ac..c180762b0 100644 --- a/Planeacion/CatSubProyectos.aspx.vb +++ b/Planeacion/CatSubProyectos.aspx.vb @@ -872,11 +872,11 @@ Partial Class CatSubProyectos DdlLocalidad.Items.Clear() If DdlEstado.SelectedValue.ToEntero > 0 Then - DdlLocalidad.DataSource = GlobalDTLocalidad(DdlEstado.SelectedValue.ToEntero, DdlMunicipio.SelectedValue.ToEntero) + DdlLocalidad.DataSource = GlobalDTLocalidad(DdlEstado.SelectedValue.ToEntero, DdlMunicipio.SelectedValue.ToEntero, CodigoPostal:=TxtCP.Text.Trim) DdlLocalidad.DataBind() End If - DdlLocalidad.Items.Insert(0, New ListItem("Seleccione una", "-1")) + DdlLocalidad.Items.Insert(0, New ListItem("-", "-1")) End Sub From 51fde94b78aed61ae140854b8ddaf259b1ff9504 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 12 Sep 2024 13:24:05 -0700 Subject: [PATCH 2/6] =?UTF-8?q?--=20paramtro=20de=20mensajed=20e=20salida?= =?UTF-8?q?=20en=20compras=20refacturaci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsCompras.vb | 1 + 1 file changed, 1 insertion(+) diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index 1f5640f5e..e70d402ef 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -2094,6 +2094,7 @@ Public Class ClsCompras .Add("@CveCompraActual", SqlDbType.Int).Value = CveCompraActual .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@Tipo", SqlDbType.Int).Value = Tipo + .Add("@MsgSalida", SqlDbType.VarChar, 500).Direction = ParameterDirection.Output End With Try From 6049b0f6f1c98a54c0b0df2ece9f6523bbdfd639 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 12 Sep 2024 14:48:34 -0700 Subject: [PATCH 3/6] =?UTF-8?q?--=20mejora=20el=20mensaje=20para=20notas?= =?UTF-8?q?=20de=20cr=C3=A9dito,=20en=20descuentos=20financieros?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Compras/Compras.aspx.vb | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index ef22b8974..4c790a109 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1955,11 +1955,8 @@ Partial Class Compras_Compras If UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso Not UsuarioActual.CveUsuario.Contiene(1719, 1721) Then BtnGuardar.Enabled = False '' solo se activa para el usuario Sara.JAM BtnGuardar.ToolTip = "No se permite registrar facturas con conceptos con código '01010101'. Solicite al proveedor un nuevo comprobante." End If - End If - - Dim SbValRet As New StringBuilder For Each concepto As XmlNode In nodeconceptos ' Obtener la descripción del concepto @@ -1992,6 +1989,34 @@ Partial Class Compras_Compras SbValRet.Append($"Producto: {descripcion} La base e importe del impuesto {impuesto} no coincide Base: {baseValue.ToString()}, Importe Producto: {importeValue.ToString()}
") End If Next + + If UsuarioActual.CveEmpresa = 119 Then + Dim BaseIEPS As Decimal = 0 + Dim BaseIVA As Decimal = 0 + Dim TasaIEPS As String = "" + Dim traslados As XmlNodeList = impuestosNode.SelectNodes("cfdi:Traslados/cfdi:Traslado", namespaces) + For Each traslado As XmlNode In traslados + ' Obtener los valores de los atributos Base e Importe + Dim baseValue As Decimal = Decimal.Parse(ValorXML(traslado, "Base")).RoundSQL(2) + Dim impuesto As String = ValorXML(traslado, "Impuesto") + + If impuesto = "001" Then + impuesto = "ISR" + ElseIf impuesto = "002" Then + impuesto = "IVA" + BaseIVA += baseValue + ElseIf impuesto = "003" Then + impuesto = "IEPS" + TasaIEPS = ValorXML(traslado, "TasaOCuota") + BaseIEPS += baseValue + End If + Next + ' Validar si Base coincide con Importe + If BaseIVA <> BaseIEPS AndAlso BaseIEPS > 0 Then + 'SbValRet.Append($"La base e importe de la retención del impuesto {impuesto} no coinciden para {descripcion}. Base: {baseValue.ToString()}, Importe: {importeValue.ToString()}
") + SbValRet.Append($"Producto: {descripcion} La base del IEPS es no coincide con el subtotal, favor de desglosarlo en una base : {BaseIEPS.ToString()}, Tasa: {TasaIEPS}
") + End If + End If End If Next From 032b7914e4bdbb5cdda6ce05980b5b203c6a1deb Mon Sep 17 00:00:00 2001 From: rakcsle Date: Thu, 12 Sep 2024 15:47:16 -0700 Subject: [PATCH 4/6] Reportes Ventas --- Transportes/RepContratoDetalle.aspx | 2 +- Ventas/RepProductosServiciosPeriodo.aspx.cs | 10 ++++++--- Ventas/RepVentas.aspx | 25 ++++++++++++++++----- Ventas/RepVentas.aspx.vb | 11 +++++++++ Ventas/RepVentasPeriodo.aspx.vb | 10 ++++++--- Ventas/RepVentasUtilidadPadre.aspx | 19 +++++++++++++--- Ventas/RepVentasUtilidadPadre.aspx.vb | 12 ++++++---- 7 files changed, 70 insertions(+), 19 deletions(-) diff --git a/Transportes/RepContratoDetalle.aspx b/Transportes/RepContratoDetalle.aspx index 192e6d424..41ed03331 100644 --- a/Transportes/RepContratoDetalle.aspx +++ b/Transportes/RepContratoDetalle.aspx @@ -248,7 +248,7 @@
- 0) + { + Info = Info.Remove(Info.Length - 1, 1); + SBJSScript.AppendFormat("graficahighcharts('{0}','{1}','{2}','{3}',[{4}],1,'{5}');", divcontainer.ClientID, Titulo, SubTitulo, YReferencia, Info, XReferencia); + } + } else { diff --git a/Ventas/RepVentas.aspx b/Ventas/RepVentas.aspx index bffd19571..a53fa9176 100644 --- a/Ventas/RepVentas.aspx +++ b/Ventas/RepVentas.aspx @@ -98,11 +98,9 @@
  • Ver Grafica
  • -
  • Descarga Carta Porte
  • - @@ -365,7 +363,7 @@ - + <%--0--%> @@ -413,8 +411,25 @@ <%--18--%> - - + + + <%-- + --%> + + <%--19--%> + + + + + + + <%--20--%> + + + + + + diff --git a/Ventas/RepVentas.aspx.vb b/Ventas/RepVentas.aspx.vb index 4d62c3e71..e4e9cfe1f 100644 --- a/Ventas/RepVentas.aspx.vb +++ b/Ventas/RepVentas.aspx.vb @@ -513,7 +513,18 @@ Partial Class Ventas_RepVentas End If End If End If + + + If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + e.Row.FCLabel("LblCreditoPorcentaje").Visible = True + e.Row.FCLabel("LblContadoPorcentaje").Visible = True + End If + + + + End If + End Sub #End Region diff --git a/Ventas/RepVentasPeriodo.aspx.vb b/Ventas/RepVentasPeriodo.aspx.vb index b85cdc859..9006ed481 100644 --- a/Ventas/RepVentasPeriodo.aspx.vb +++ b/Ventas/RepVentasPeriodo.aspx.vb @@ -396,14 +396,18 @@ Partial Class RepVentasPeriodo Dim moneda As String = DbRow("Moneda").ToString Dim total As String = DbRow("GPO").ToString If total <> "Total Peso Mexicano" Then - If moneda = "Peso Mexicano" Then + If moneda.ToUpper.Contains("PESO") Then Info = String.Format("{2}['{1}',{0}],", DbRow(ColValue), DbRow(ColTitle), Info) End If End If Next - Info = Info.Remove(Info.Length - 1, 1) - SBJSScript.AppendFormat("graficahighcharts('{0}','{1}','{2}','{3}',[{4}],1,'{5}');", divcontainer.ClientID, Titulo, SubTitulo, YReferencia, Info, XReferencia) + If Info.Length > 0 Then + Info = Info.Remove(Info.Length - 1, 1) + SBJSScript.AppendFormat("graficahighcharts('{0}','{1}','{2}','{3}',[{4}],1,'{5}');", divcontainer.ClientID, Titulo, SubTitulo, YReferencia, Info, XReferencia) + End If + + Else SBJSScript.AppendFormat("graficahighcharts('{0}','{1}','{2}','{3}',[{4}],1,'{5}');", divcontainer.ClientID, Titulo, SubTitulo, YReferencia, " ", XReferencia) End If diff --git a/Ventas/RepVentasUtilidadPadre.aspx b/Ventas/RepVentasUtilidadPadre.aspx index cad6b2f04..e6bb4b11e 100644 --- a/Ventas/RepVentasUtilidadPadre.aspx +++ b/Ventas/RepVentasUtilidadPadre.aspx @@ -238,14 +238,27 @@ + CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None" Width="100%" OnRowDataBound="GvDatos_RowDataBound"> - + <%-- - + --%> + + + + + + + + + + + + + diff --git a/Ventas/RepVentasUtilidadPadre.aspx.vb b/Ventas/RepVentasUtilidadPadre.aspx.vb index eff0b437d..81df03936 100644 --- a/Ventas/RepVentasUtilidadPadre.aspx.vb +++ b/Ventas/RepVentasUtilidadPadre.aspx.vb @@ -32,10 +32,10 @@ Partial Class Ventas_RepVentasUtilidadPadre Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then - If UsuarioActual.Empresa.Funcionalidad(382) <> "1" Then - GvDatos.Columns(3).Visible = False - GvDatos.Columns(5).Visible = False - End If + 'If UsuarioActual.Empresa.Funcionalidad(382) <> "1" Then + ' GvDatos.Columns(3).Visible = False + ' GvDatos.Columns(5).Visible = False + 'End If CargaCombos() End If @@ -264,6 +264,10 @@ Partial Class Ventas_RepVentasUtilidadPadre End If + If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + e.Row.FCLabel("LblPorcentajeCredito").Visible = True + e.Row.FCLabel("LblPorcentajeContado").Visible = True + End If End If End Sub From eefae0699b0db6eaa9ea14bb103ccf22f9b38987 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Thu, 12 Sep 2024 16:01:09 -0700 Subject: [PATCH 5/6] Correcion nombre de PA GetReportePadreVentasUtilidad en funcion --- App_Code/ClsVentas.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 3af79410f..eeaf57f4e 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -3385,7 +3385,7 @@ Public Class ClsVentas Public Function GetReportePadreVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Gpo As Integer, CvePS As Integer, CveCategoria As Integer, CveClasificacion As Integer, CveMarca As Integer, EsGarantia As Integer, EsFilial As Integer) As Boolean Dim Retorno As Boolean = False - DataAdapter("PA_Vta_RepVentasUtilidadGetOIC") + DataAdapter("PA_Vta_RepVentasUtilidadGet") With SqlAdapter.SelectCommand.Parameters .Add("@FechaI", SqlDbType.Date).Value = FechaInicio From 71b0363d1a61e3982d5a310a24571428ac275582 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 12 Sep 2024 18:10:49 -0700 Subject: [PATCH 6/6] -- filtro de localidad de CP --- Inventarios/RepEntregaAlmacenRuta.aspx.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Inventarios/RepEntregaAlmacenRuta.aspx.cs b/Inventarios/RepEntregaAlmacenRuta.aspx.cs index db09fbb0c..c2154ee19 100644 --- a/Inventarios/RepEntregaAlmacenRuta.aspx.cs +++ b/Inventarios/RepEntregaAlmacenRuta.aspx.cs @@ -984,7 +984,7 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas DdlDirClienteLocalidad.Items.Clear(); if (DdlDirClienteEstado.SelectedValue.ToEntero() > 0) { - DdlDirClienteLocalidad.DataSource = get_GlobalDTLocalidad(DdlDirClienteEstado.SelectedValue.ToEntero(), DdlDirClienteMunicipio.SelectedValue.ToEntero()); + DdlDirClienteLocalidad.DataSource = get_GlobalDTLocalidad(DdlDirClienteEstado.SelectedValue.ToEntero(), DdlDirClienteMunicipio.SelectedValue.ToEntero(), CodigoPostal:TxtEnvioCP.Text.Trim()); DdlDirClienteLocalidad.DataBind(); }