--Rep Ventas en menu

--Personalizar columnas para descarga de pdf y xml
This commit is contained in:
2024-04-16 19:28:57 -07:00
parent 87ce2500a5
commit 843e4cb543
3 changed files with 183 additions and 74 deletions

View File

@@ -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)

View File

@@ -390,7 +390,7 @@
</ItemTemplate>
</asp:TemplateField>
<%-- 9--%>
<asp:TemplateField HeaderText="IEPS" Visible="false" ItemStyle-HorizontalAlign="Right" >
<asp:TemplateField HeaderText="IEPS" Visible="false" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="LtlIEPS" runat="server" Text='<%# Eval("IEPS", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
@@ -591,7 +591,18 @@
<asp:Literal ID="LtlDescripcionVenta" runat="server" Text='<%# Eval("DescripcionVenta") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 42--%>
<asp:TemplateField HeaderText="Descargar XML" Visible="false">
<ItemTemplate>
<asp:Literal ID="LtlXML" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 43--%>
<asp:TemplateField HeaderText="Descargar PDF" Visible="false">
<ItemTemplate>
<asp:Literal ID="LtlPDF" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
@@ -664,84 +675,128 @@
<table class="table table-striped nobordertop table-advance table-hover">
<tbody>
<tr>
<td style="text-align: left;"><asp:CheckBox ID="ChkTipoDocto" runat="server" Text="&nbsp;*Tipo Documento" Checked="true" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkSucursal" runat="server" Text="&nbsp;*Sucursal" Checked="true" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkSucursalCobranza" runat="server" Text="&nbsp;Sucursal Cobranza" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkTipoDocto" runat="server" Text="&nbsp;*Tipo Documento" Checked="true" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkSucursal" runat="server" Text="&nbsp;*Sucursal" Checked="true" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkSucursalCobranza" runat="server" Text="&nbsp;Sucursal Cobranza" /></td>
</tr>
<tr>
<td style="text-align: left;"><asp:CheckBox ID="ChkFolio" runat="server" Text="&nbsp;*Folio" Checked="true" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkEstatusFactura" runat="server" Text="&nbsp;*Estatus de Factura" Checked="true" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkSucursalEjecucion" runat="server" Text="&nbsp;Sucursal Ejecución" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkFolio" runat="server" Text="&nbsp;*Folio" Checked="true" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkEstatusFactura" runat="server" Text="&nbsp;*Estatus de Factura" Checked="true" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkSucursalEjecucion" runat="server" Text="&nbsp;Sucursal Ejecución" /></td>
</tr>
<tr>
<td style="text-align: left;"><asp:CheckBox ID="ChkFecha" runat="server" Text="&nbsp;*Fecha" Checked="true" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkVendedor" runat="server" Text="&nbsp;Vendedor" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkMotivoCancelacion" runat="server" Text="&nbsp;Motivo Cancelacion" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkFecha" runat="server" Text="&nbsp;*Fecha" Checked="true" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkVendedor" runat="server" Text="&nbsp;Vendedor" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkMotivoCancelacion" runat="server" Text="&nbsp;Motivo Cancelacion" /></td>
</tr>
<tr>
<td style="text-align: left;"><asp:CheckBox ID="ChkSubTotal" runat="server" Text="&nbsp;*SubTotal" Checked="true" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkCodigo" runat="server" Text="&nbsp;Código Cliente" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkUsuario" runat="server" Text="&nbsp;Usuario" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkSubTotal" runat="server" Text="&nbsp;*SubTotal" Checked="true" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkCodigo" runat="server" Text="&nbsp;Código Cliente" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkUsuario" runat="server" Text="&nbsp;Usuario" /></td>
</tr>
<tr>
<td style="text-align: left;"><asp:CheckBox ID="ChkDescuento" runat="server" Text="&nbsp;*Descuento" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkCliente" runat="server" Text="&nbsp;*Cliente" Checked="true" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkEstatusFacturacion" runat="server" Text="&nbsp;Estatus Facturación" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkDescuento" runat="server" Text="&nbsp;*Descuento" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkCliente" runat="server" Text="&nbsp;*Cliente" Checked="true" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkEstatusFacturacion" runat="server" Text="&nbsp;Estatus Facturación" /></td>
</tr>
<tr>
<td style="text-align: left;"><asp:CheckBox ID="ChkIVA" runat="server" Text="&nbsp;*IVA" Checked="true" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkMailCliente" runat="server" Text="&nbsp;Mail Cliente" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkFolioFacturacion" runat="server" Text="&nbsp;Factura Cotización" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkIVA" runat="server" Text="&nbsp;*IVA" Checked="true" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkMailCliente" runat="server" Text="&nbsp;Mail Cliente" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkFolioFacturacion" runat="server" Text="&nbsp;Factura Cotización" /></td>
</tr>
<tr>
<td style="text-align: left;"><asp:CheckBox ID="ChkRetIVA" runat="server" Text="&nbsp;Ret. IVA" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkCuentaContable" runat="server" Text="&nbsp;Cuenta Contable" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkObservaciones" runat="server" Text="&nbsp;Observaciones" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkRetIVA" runat="server" Text="&nbsp;Ret. IVA" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkCuentaContable" runat="server" Text="&nbsp;Cuenta Contable" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkObservaciones" runat="server" Text="&nbsp;Observaciones" /></td>
</tr>
<tr>
<td style="text-align: left;"><asp:CheckBox ID="ChkRetISR" runat="server" Text="&nbsp;Ret. ISR" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkSucursalCliente" runat="server" Text="&nbsp;Sucursal Cliente" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkOrdenCompra" runat="server" Text="&nbsp;OrdenCompra" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkRetISR" runat="server" Text="&nbsp;Ret. ISR" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkSucursalCliente" runat="server" Text="&nbsp;Sucursal Cliente" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkOrdenCompra" runat="server" Text="&nbsp;OrdenCompra" /></td>
</tr>
<tr>
<td style="text-align: left;"><asp:CheckBox ID="ChkTotalImpuestos" runat="server" Text="&nbsp;Impuestos Locales" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkSaldo" runat="server" Text="&nbsp;Saldo" Checked="false" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkPedidoContrato" runat="server" Text="&nbsp;Pedido Contrato" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkTotalImpuestos" runat="server" Text="&nbsp;Impuestos Locales" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkSaldo" runat="server" Text="&nbsp;Saldo" Checked="false" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkPedidoContrato" runat="server" Text="&nbsp;Pedido Contrato" /></td>
</tr>
<tr>
<td style="text-align: left;"><asp:CheckBox ID="ChkTotal" runat="server" Text="&nbsp;*Total" Checked="true" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkFolioFiscal" runat="server" Text="&nbsp;Folio Fiscal (UUID)" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChlMotivoDescuento" runat="server" Text="&nbsp;Motivo Descuento" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkTotal" runat="server" Text="&nbsp;*Total" Checked="true" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkFolioFiscal" runat="server" Text="&nbsp;Folio Fiscal (UUID)" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChlMotivoDescuento" runat="server" Text="&nbsp;Motivo Descuento" /></td>
</tr>
<tr>
<td style="text-align: left;"><asp:CheckBox ID="ChkMoneda" runat="server" Text="&nbsp;*Moneda" Checked="true" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkMetodoPago" runat="server" Text="&nbsp;Método de Pago" Checked="false" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkAmortizacion" runat="server" Text="&nbsp;Amortización" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkMoneda" runat="server" Text="&nbsp;*Moneda" Checked="true" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkMetodoPago" runat="server" Text="&nbsp;Método de Pago" Checked="false" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkAmortizacion" runat="server" Text="&nbsp;Amortización" /></td>
</tr>
<tr>
<td style="text-align: left;"><asp:CheckBox ID="ChkIEPS" runat="server" Text="&nbsp;*IEPS" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkFormaPago" runat="server" Text="&nbsp;Forma de Pago" Checked="false" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkSeTimbro" runat="server" Text="&nbsp;Se Timbró" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkIEPS" runat="server" Text="&nbsp;*IEPS" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkFormaPago" runat="server" Text="&nbsp;Forma de Pago" Checked="false" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkSeTimbro" runat="server" Text="&nbsp;Se Timbró" /></td>
</tr>
<tr>
<td style="text-align: left;"><asp:CheckBox ID="ChkTC" runat="server" Text="&nbsp;TC" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkUsoCFDI" runat="server" Text="&nbsp;Uso CFDI" Checked="false" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkSeEnvioMail" runat="server" Text="&nbsp; Se envió Mail" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkTC" runat="server" Text="&nbsp;TC" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkUsoCFDI" runat="server" Text="&nbsp;Uso CFDI" Checked="false" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkSeEnvioMail" runat="server" Text="&nbsp; Se envió Mail" /></td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkDescargarPDF" runat="server" Text="&nbsp;Descargar PDF" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkDescargarXML" runat="server" Text="&nbsp;Descargar XML" />
</td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkKilometraje" runat="server" Visible="False" Text="&nbsp; Kilometraje" /></td>
</tr>
<tr>
<td style="text-align: left;"></td>
<td style="text-align: left;"> </td>
<td style="text-align: left;"><asp:CheckBox ID="ChkKilometraje" runat="server" Visible="False" Text="&nbsp; Kilometraje" /></td>
</tr>
<tr>
<td style="text-align: left;"></td>
<td style="text-align: left;"> </td>
<td style="text-align: left;"><asp:CheckBox ID="ChkDescripcionVenta" runat="server" Visible="true" Text="&nbsp; Descripción Venta" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkDescripcionVenta" runat="server" Visible="true" Text="&nbsp; Descripción Venta" /></td>
</tr>
</tbody>
@@ -751,7 +806,7 @@
</div>
<div class="modal-footer">
<div class="row">
<div class="col-md-6" style="text-align:left">
<div class="col-md-6" style="text-align: left">
<asp:CheckBox ID="ChkGuardarPersonalizacion" runat="server" Text=" Guarda Personalización" TextAlign="Right" />
</div>
<div class="col-md-6">

View File

@@ -110,6 +110,15 @@ Partial Class RepVentaDetalle
ViewState("Primeracontsulta") = value
End Set
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
@@ -120,14 +129,16 @@ Partial Class RepVentaDetalle
CargaCombos()
InicializaValores()
ConfiguraEmpresa()
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,6 +288,10 @@ Partial Class RepVentaDetalle
DdlVendedor.Enabled = False
End If
If Request("Menu") IsNot Nothing AndAlso Request("Menu").ToString() = "1" Then
ConsultaAlCargar = False
End If
End Sub
#Region "CARGA COMBOS"
@@ -538,6 +555,28 @@ Partial Class RepVentaDetalle
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
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("<div class='truncate' style='width:23px;'><a class=""Texto"" target=""_blank"" href=""/Compras/PopUpVerFactura.aspx?TipoDocto={0}&File={1}.xml&TipoArchivo=XML"">XML</a></div>", e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("SerieFolio"))
Else
e.Row.FCLiteral("LtlXML").Text = "<div class='truncate' style='width:23px;'></div>"
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("<div class='truncate' style='width:23px;'><a class=""Texto"" target=""_blank"" href=""/Compras/PopUpVerFactura.aspx?TipoDocto={0}&File={1}.pdf&TipoArchivo=PDF"">PDF</a></div>", e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("SerieFolio"))
Else
e.Row.FCLiteral("LtlPDF").Text = "<div class='truncate' style='width:23px;'></div>"
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("<div class='truncate' style='width:23px;'><a class=""Texto"" target=""_blank"" href=""/Compras/PopUpVerFactura.aspx?TipoDocto={0}&File={1}.pdf&TipoArchivo=PDF"">PDF</a></div>", e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("SerieFolio"))
Else
e.Row.FCLiteral("LtlPDF").Text = "<div class='truncate' style='width:23px;'></div>"
End If
End If
'If e.Row.DBCampo("MAX_SubTotal").ToDouble = 0 Then e.Row.FCLiteral("LtlMaxSubTotal").Text = ""
'If e.Row.DBCampo("AVG_SubTotal").ToDouble = 0 Then e.Row.FCLiteral("LtlAVGSubTotal").Text = ""
@@ -707,6 +746,10 @@ Partial Class RepVentaDetalle
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")
End If
@@ -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
@@ -894,6 +940,12 @@ Partial Class RepVentaDetalle
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
End Select
@@ -953,7 +1005,8 @@ Partial Class RepVentaDetalle
GvDatos.Columns(39).Visible = ChkKilometraje.Checked
GvDatos.Columns(40).Visible = ChkTC.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