Descarga Extenciones FireFox, Rep Cartra Prote Traslados

This commit is contained in:
rakcsle
2022-02-28 18:53:27 -07:00
parent 150ee16aab
commit d00b6d93b3
5 changed files with 299 additions and 8 deletions

View File

@@ -118,7 +118,7 @@ Partial Class PopUpVerFactura
If Archivo.Exists Then
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.ClearContent()
HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = "xml", "application/xml", "application/pdf")
HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = ".xml", "application/xml", "application/pdf")
HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name))
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
HttpContext.Current.Response.TransmitFile(Path)
@@ -134,7 +134,7 @@ Partial Class PopUpVerFactura
If Archivo.Exists Then
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.ClearContent()
HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = "xml", "application/xml", "application/pdf")
HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = ".xml", "application/xml", "application/pdf")
HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name))
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
HttpContext.Current.Response.TransmitFile(Path)
@@ -174,7 +174,7 @@ Partial Class PopUpVerFactura
If Archivo.Exists Then
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.ClearContent()
HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = "txt", "text/plain", "application/pdf")
HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = ".txt", "text/plain", "application/pdf")
HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" & Archivo.Name)
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
HttpContext.Current.Response.TransmitFile(Path)
@@ -739,7 +739,7 @@ Partial Class PopUpVerFactura
If Archivo.Exists Then
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.ClearContent()
HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = "xml", "application/xml", "application/pdf")
HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = ".xml", "application/xml", "application/pdf")
HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name))
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
HttpContext.Current.Response.TransmitFile(Path)
@@ -868,7 +868,7 @@ Partial Class PopUpVerFactura
If Archivo.Exists Then
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.ClearContent()
HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = "xml", "application/xml", "application/pdf")
HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = ".xml", "application/xml", "application/pdf")
HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name))
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
HttpContext.Current.Response.TransmitFile(Path)
@@ -1585,7 +1585,7 @@ Partial Class PopUpVerFactura
If Archivo.Exists Then
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.ClearContent()
HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = "xml", "application/xml", "application/pdf")
HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = ".xml", "application/xml", "application/pdf")
HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name))
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
HttpContext.Current.Response.TransmitFile(Path)
@@ -1626,7 +1626,7 @@ Partial Class PopUpVerFactura
Private Sub DescargarArchivoPDFTraslado(Archivo As System.IO.FileInfo, path As String)
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.ClearContent()
HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = "xml", "text/xml", "application/pdf")
HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = ".xml", "text/xml", "application/pdf")
HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name))
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
HttpContext.Current.Response.TransmitFile(path)
@@ -1856,7 +1856,7 @@ Partial Class PopUpVerFactura
If Archivo.Exists Then
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.ClearContent()
HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name).ToLower = "xml", "application/xml", "application/pdf")
HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name).ToLower = ".xml", "application/xml", "application/pdf")
HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name))
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
HttpContext.Current.Response.TransmitFile(Path)

View File

@@ -0,0 +1,142 @@
<%@ Page Title="Rep. Carta Porte Traslados" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepCartaPorteTraslados.aspx.vb" Inherits="Compras_RepCartaPorteTraslados" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.dataTables_scrollHead {
background-color: #95A5A6;
color: white;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Rep. Carta Porte Traslados
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:UpdatePanel runat="server" ID="UpdatePanel1" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server" Visible="false"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkExcel" />
</Triggers>
</asp:UpdatePanel>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpFiltros" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultarFiltros" OnClick="BtnConsultarFiltros_Click" runat="server" Text="Consultar" ValidationGroup="GrpFiltros" class="btn btn-primary" />
<a href="javascript;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a>
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
</div>
<div class="titlefiltros caption ">
<div class="row">
<div class="col-md-1" style="max-width: 120px">Proveedor:</div>
<div class="col-md-2">
<ADS:Dropdownlost ID="DdlProveedores" CssClassDdl="form-control input-sm select2me" Style="min-width: 160px;" CssStyle="width:100%" DataTextField="RazonSocial" DataValueField="CveProveedor" AppendDataBoundItems="true" runat="server"></ADS:Dropdownlost>
</div>
<div class="col-md-1" style="max-width: 90px">Fecha Inicio:</div>
<div class="col-md-2" style="max-width: 130px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 90px !important; padding: 0px;">
<asp:TextBox ID="TxtFiltrosFechaInicio" CssClass="form-control input-sm ADSMaskDate" Style="width: 88px" runat="server"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LBCalendarFiltrosFechaInicio" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFiltrosFechaInicio" runat="server" TargetControlID="TxtFiltrosFechaInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFiltrosFechaInicio" TargetControlID="TxtFiltrosFechaInicio" PopupButtonID="LBCalendarFiltrosFechaInicio" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFiltrosFechaInicio" runat="server" ControlToValidate="TxtFiltrosFechaInicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFiltros"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFiltrosFechaInicio" runat="server" HighlightCssClass="vco" TargetControlID="RFVFiltrosFechaInicio"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="col-md-1" style="max-width: 75px">Fecha Fin:</div>
<div class="col-md-2" style="max-width: 130px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 90px !important; padding: 0px;">
<asp:TextBox ID="TxtFiltrosFechaFin" CssClass="form-control input-sm ADSMaskDate" Style="width: 88px" runat="server"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LBCalendarFiltrosFechaFin" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFiltrosFechaFin" runat="server" TargetControlID="TxtFiltrosFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFiltrosFechaFin" TargetControlID="TxtFiltrosFechaFin" PopupButtonID="LBCalendarFiltrosFechaFin" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFiltrosFechaFin" runat="server" ControlToValidate="TxtFiltrosFechaFin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFiltros"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFiltrosFechaFin" runat="server" HighlightCssClass="vco" TargetControlID="RFVFiltrosFechaFin"></ajax:ValidatorCalloutExtender>
</div>
</div>
<asp:Label ID="LblSubProyecto" runat="server" class="col-md-1 truncate">SubProyecto:</asp:Label>
<div class="col-md-2">
<asp:DropDownList ID="DdlSubProyecto" CssClass="form-control input-sm select2me" Width="120px" runat="server" DataValueField="CveSubProyecto" DataTextField="SubProyecto">
</asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
<div class="row">
<label class="col-md-1 truncate">Tipo Proveedor:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlTipoProveedor" CssClass="form-control input-sm select2me" Width="260px" runat="server">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Proveedor" Value="1"></asp:ListItem>
<asp:ListItem Text="Acreedor" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 truncate">Usuario Registró:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlUsuarioRegistra" CssClass="form-control input-sm select2me" Width="120px" runat="server" DataValueField="CveUsuario" DataTextField="Nombre">
</asp:DropDownList>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<table class="table Widthall ">
<tr>
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 60%; border-right: 3px solid white;">Compra</td>
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 40%; border-right: 3px solid white;">Traslado</td>
</tr>
</table>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="Sin resultados" ShowHeaderWhenEmpty="true" CssClass="table table-striped table-hover Widthall ScrollAD"
DataKeyNames="CveComplementoTraslado,FechaIng,CveCompra,SerieFolioCompra,FechaCompra,FechaFactura,UUID,SerieFolioFactura,CveProveedor,RazonSocial,CveUsuario,Usuario"
GridLines="None" data-sort="true">
<Columns>
<asp:HyperLinkField HeaderText="Proveedor" DataTextField="RazonSocial" DataNavigateUrlFields="CveProveedor" DataNavigateUrlFormatString="/Compras/Proveedores.aspx?CveProveedor={0}" Target="_blank" ItemStyle-Width="40%" />
<asp:HyperLinkField HeaderText="SerieFolio" DataTextField="SerieFolioCompra" DataNavigateUrlFields="CveCompra" DataNavigateUrlFormatString="/Compras/Compras.aspx?CveCompra={0}" Target="_blank" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Fecha" DataField="FechaCompra" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" />
<asp:BoundField HeaderText="Folio" DataField="SerieFolioFactura" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
<asp:BoundField HeaderText="Folio Fiscal" DataField="UUID" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="20%" />
<asp:BoundField HeaderText="Fecha" DataField="FechaFactura" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,117 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class Compras_RepCartaPorteTraslados
Inherits ClsPaginas
'Private Property DTComplemntos As DataTable
' Get
' If ViewState("DTComplemntos") Is Nothing Then
' Return New DataTable
' Else
' Return DirectCast(ViewState("DTComplemntos"), DataTable)
' End If
' End Get
' Set(value As DataTable)
' ViewState("DTComplemntos") = value
' End Set
'End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
InicializaValores()
End If
End Sub
#Region " INICIALIZA VALORES "
Private Sub InicializaValores()
TxtFiltrosFechaInicio.Text = Now.FirstDayOfMonth.ToShortDateString
TxtFiltrosFechaFin.Text = Now.ToShortDateString
DdlProveedores.setEsWebService(True)
DdlProveedores.Attributes.Add("data-metodo", "getproveedores")
'DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
'DdlProveedores.DataBind()
'DdlProveedores.Items.Insert(0, New ListItem("Todos", "-1"))
'DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
'DdlSubProyecto.DataBind()
'DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto:=LblSubProyecto)
DdlUsuarioRegistra.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa)
DdlUsuarioRegistra.DataBind()
DdlUsuarioRegistra.Items.Insert(0, New ListItem("Todos", "-1"))
UpFiltros.Update()
End Sub
#End Region
#Region " CARGA DATOS "
Protected Sub BtnConsultarFiltros_Click(sender As Object, e As EventArgs)
CargaDatos()
End Sub
Private Sub CargaDatos()
LnkExcel.Visible = False
Dim CveProveedor As Integer = If(DdlProveedores.SelectedValue.ToEntero = 0, -1, DdlProveedores.SelectedValue.ToEntero)
Dim CveTipoProveedor = DdlTipoProveedor.SelectedValue.ToEntero
Dim FechaInicio = If(IsDate(TxtFiltrosFechaInicio.Text), TxtFiltrosFechaInicio.Text.ToDate, MinFecha)
Dim FechaFin = If(IsDate(TxtFiltrosFechaFin.Text), TxtFiltrosFechaFin.Text.ToDate, MaxFecha)
Dim Count As Integer = 0
Dim ObjCompras As New ClsCompras
If ObjCompras.GetComplementoTrasladoRep(UsuarioActual.CveEmpresa, CveProveedor, CveTipoProveedor, FechaInicio, FechaFin, UsuarioActual.CveUsuario, DdlUsuarioRegistra.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero) Then
GvDatos.DataSource = ObjCompras.DtResultados
If ObjCompras.DtResultados.Rows.Count > 0 Then
LnkExcel.Visible = True
End If
Else
GvDatos.DataSource = Nothing
End If
ObjCompras.Dispose()
GvDatos.DataBind()
UpAcciones.Update()
UpDatos.Update()
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
End If
End Sub
#End Region
#Region "IMPRESION"
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs)
GeneraImpresion("Excel")
End Sub
Private Sub GeneraImpresion(Optional Formato As String = "PDF")
GvDatos.ExportToExcel2("RepCartaPorteTraslados.xlsx")
End Sub
#End Region
End Class