From 843e4cb5438dc61a2479c6008d6581b836b3106a Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 16 Apr 2024 19:28:57 -0700 Subject: [PATCH] --Rep Ventas en menu --Personalizar columnas para descarga de pdf y xml --- App_Code/ClsPaginas.vb | 1 + Ventas/RepVentaDetalle.aspx | 181 +++++++++++++++++++++------------ Ventas/RepVentaDetalle.aspx.vb | 75 ++++++++++++-- 3 files changed, 183 insertions(+), 74 deletions(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index f6868d9ec..5dbbcc341 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -10729,6 +10729,7 @@ Public Class ClsPaginas PaginaDict.Add("/Ventas/RepCotizacionesDetalle.aspx".ToUpper(), 430) PaginaDict.Add("/Ventas/RepVentasPV.aspx".ToUpper(), 9) PaginaDict.Add("/Ventas/RepVentaDetalle.aspx".ToUpper(), 9) + PaginaDict.Add("/Ventas/RepVentaDetalle.aspx?Menu=1".ToUpper(), 785) PaginaDict.Add("/Ventas/CatClasificaciones.aspx".ToUpper(), 12) PaginaDict.Add("/Ventas/CatClasificaciones2.aspx".ToUpper(), 396) PaginaDict.Add("/Ventas/CatClasificacionesDetalle.aspx".ToUpper(), 12) diff --git a/Ventas/RepVentaDetalle.aspx b/Ventas/RepVentaDetalle.aspx index cb6dece06..0dcc648ac 100644 --- a/Ventas/RepVentaDetalle.aspx +++ b/Ventas/RepVentaDetalle.aspx @@ -331,7 +331,7 @@ - + <%-- 0--%> @@ -390,7 +390,7 @@ <%-- 9--%> - + @@ -585,13 +585,24 @@ - <%-- 41--%> + <%-- 41--%> - - + + <%-- 42--%> + + + + + + <%-- 43--%> + + + + + @@ -664,101 +675,145 @@ - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - + + + - - - - + + + + - - - - - - - - - - + + + + - - - + + + + + + + + + + + + + + - - - - - - + - + -
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + + +
+
- + + diff --git a/Ventas/RepVentaDetalle.aspx.vb b/Ventas/RepVentaDetalle.aspx.vb index 302599684..2fbaa3077 100644 --- a/Ventas/RepVentaDetalle.aspx.vb +++ b/Ventas/RepVentaDetalle.aspx.vb @@ -109,10 +109,19 @@ Partial Class RepVentaDetalle Set(value As Boolean) ViewState("Primeracontsulta") = value End Set - End Property - + End Property + Private Property ConsultaAlCargar As Boolean + Get + Return CBool((IfNull(ViewState("ConsultaAlCargar"), False, ViewState("ConsultaAlCargar")))) + End Get + Set(value As Boolean) + ViewState("ConsultaAlCargar") = value + End Set + End Property + + #End Region - 'pRivate ReadOnly Property ColumnasVisibles As + 'pRivate ReadOnly Property ColumnasVisibles As Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario.Contiene(77, 21) Then Response.Redirect("/Inicio.aspx") @@ -120,14 +129,16 @@ Partial Class RepVentaDetalle CargaCombos() InicializaValores() ConfiguraEmpresa() - CargaDatos() + If ConsultaAlCargar Then + CargaDatos() + End If + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then - LblServicioDomicilioFiltro.Visible = True DVServicioDomicilio.Visible = True - End If + PrePersonalizacion() CargaPersonalizacion() End If @@ -135,6 +146,8 @@ Partial Class RepVentaDetalle Private Sub InicializaValores() + ConsultaAlCargar = True + Dim Grupo, CveCliente, CveSucursal, CveSubProyectoEjecucion, CveVendedor, CveUsuario, CveEstatusFactura, CveCorte, IVA, TipoDocto, CveClienteClasificacion, CveCondicionesPago, CveTipoRelacion As String Dim Anio, Mes, AnioMes, Fecha, FechaI, FechaF As String Dim AnioEjec, MesEjec, AnioMesEjec, FechaEjec, FechaIEjec, FechaFEjec As String @@ -275,8 +288,12 @@ Partial Class RepVentaDetalle DdlVendedor.Enabled = False End If - End Sub + If Request("Menu") IsNot Nothing AndAlso Request("Menu").ToString() = "1" Then + ConsultaAlCargar = False + End If + End Sub + #Region "CARGA COMBOS" Private Sub CargaGrupo() DdlGrupo.Items.Insert(0, New ListItem("Año", "1")) @@ -536,7 +553,29 @@ Partial Class RepVentaDetalle If e.Row.DBCampo("RetISR").ToDouble < 0 Then e.Row.Cells(10).ForeColor = Drawing.Color.Red If e.Row.DBCampo("Total").ToDouble < 0 Then e.Row.Cells(11).ForeColor = Drawing.Color.Red If e.Row.DBCampo("Total").ToDouble < 0 Then e.Row.Cells(12).ForeColor = Drawing.Color.Red - If e.Row.DBCampo("Total").ToDouble < 0 Then e.Row.Cells(13).ForeColor = Drawing.Color.Red + If e.Row.DBCampo("Total").ToDouble < 0 Then e.Row.Cells(13).ForeColor = Drawing.Color.Red + + Dim Ruta As String = UsuarioActual.Empresa.Ruta + + If IO.File.Exists($"{Ruta}XML\{e.Row.DBCampo("TipoDocto")}\{e.Row.DBCampo("SerieFolio")}.xml") Then + e.Row.FCLiteral("LtlXML").Text = String.Format("", e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("SerieFolio")) + Else + e.Row.FCLiteral("LtlXML").Text = "
" + End If + + If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then + If e.Row.DBCampo("TipoDocto") <> "Cot" AndAlso IO.File.Exists($"{Ruta}PDF\{e.Row.DBCampo("TipoDocto")}\{e.Row.DBCampo("SerieFolio")}.pdf") Then + e.Row.FCLiteral("LtlPDF").Text = String.Format("", e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("SerieFolio")) + Else + e.Row.FCLiteral("LtlPDF").Text = "
" + End If + Else + If IO.File.Exists($"{Ruta}PDF\{e.Row.DBCampo("TipoDocto")}\{e.Row.DBCampo("SerieFolio")}.pdf") Then + e.Row.FCLiteral("LtlPDF").Text = String.Format("", e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("SerieFolio")) + Else + e.Row.FCLiteral("LtlPDF").Text = "
" + End If + End If 'If e.Row.DBCampo("MAX_SubTotal").ToDouble = 0 Then e.Row.FCLiteral("LtlMaxSubTotal").Text = "" @@ -705,7 +744,11 @@ Partial Class RepVentaDetalle If ChkTC.Checked Then ListPersonalizada.Add("TC") - If ChkDescripcionVenta.Checked Then ListPersonalizada.Add("DescripcionVenta") + If ChkDescripcionVenta.Checked Then ListPersonalizada.Add("DescripcionVenta") + + If ChkDescargarPDF.Checked Then ListPersonalizada.Add("PDF") + + If ChkDescargarXML.Checked Then ListPersonalizada.Add("XML") If objUsuario.AddUsuariosPersonalizaciones(UsuarioActual, "RepVentaDetalles.aspx", String.Join("|", ListPersonalizada)) Then 'Alert("Personalizacion guardada") @@ -764,6 +807,9 @@ Partial Class RepVentaDetalle ChkFormaPago.Checked = False ChkUsoCFDI.Checked = False + ChkDescargarPDF.Checked = False + ChkDescargarXML.Checked = False + Dim Personalizaciones As String() = strBasePersonalizacion.Split("|"c) For Each personalizacion As String In Personalizaciones @@ -893,6 +939,12 @@ Partial Class RepVentaDetalle Exit Select Case "DescripcionVenta" ChkDescripcionVenta.Checked = True + Exit Select + Case "XML" + ChkDescargarXML.Checked = True + Exit Select + Case "PDF" + ChkDescargarPDF.Checked = True Exit Select Case Else Exit Select @@ -952,8 +1004,9 @@ Partial Class RepVentaDetalle GvDatos.Columns(38).Visible = ChkUsoCFDI.Checked GvDatos.Columns(39).Visible = ChkKilometraje.Checked GvDatos.Columns(40).Visible = ChkTC.Checked - GvDatos.Columns(41).Visible = ChkDescripcionVenta.Checked - + GvDatos.Columns(41).Visible = ChkDescripcionVenta.Checked + GvDatos.Columns(42).Visible = ChkDescargarXML.Checked + GvDatos.Columns(43).Visible = ChkDescargarPDF.Checked Personalizo = 1 If Personalizo = 1 Then