diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index 40bcd70e1..95802d410 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -2457,6 +2457,33 @@ Public Class ClsCompras End Function + + Public Function GetComplementoTrasladoRep(CveEmpresa As Integer, CveProveedor As Integer, CveTipoProveedor As Integer, FechaI As Date, FechaF As Date, CveUsuario As Integer, CveUsuarioRegistro As Integer, CveSubProyecto As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Comp_ComplementoTrasladoRepGet") + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@CveTipoProveedor", SqlDbType.Int).Value = CveTipoProveedor + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveUsuarioRegistro", SqlDbType.Int).Value = CveUsuarioRegistro + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + + + + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error obtener las vinculaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + Public Function AddVincularPago(CveFactura As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Comp_VincularPagoAdd") diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index e9be16c6c..5f01455d4 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4760,6 +4760,11 @@ Public Class ClsPaginas PaginaDict.Add("/OI/CircularDetalleB.aspx".ToUpper(), 757) PaginaDict.Add("/Compras/CatTipoGasto.aspx".ToUpper(), 759) + PaginaDict.Add("/Compras/RepCartaPorteTraslados.aspx".ToUpper(), 1323) + + + + #End Region 'CONTABILIDAD diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 569ba4d2f..92847ae3c 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -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) diff --git a/Compras/RepCartaPorteTraslados.aspx b/Compras/RepCartaPorteTraslados.aspx new file mode 100644 index 000000000..ee9712803 --- /dev/null +++ b/Compras/RepCartaPorteTraslados.aspx @@ -0,0 +1,142 @@ +<%@ Page Title="Rep. Carta Porte Traslados" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepCartaPorteTraslados.aspx.vb" Inherits="Compras_RepCartaPorteTraslados" %> + + + + + + + + Rep. Carta Porte Traslados + + + + + + + + + + + +
  • + Excel +
  • +
    + + + +
    +
    +
    +
    + + + + + + + +
    +
    +
    + + "> + +
    +
    +
    +
    Proveedor:
    +
    + +
    +
    Fecha Inicio:
    +
    +
    + + + + + + + + +
    +
    +
    Fecha Fin:
    +
    +
    + + + + + + + + +
    +
    + + SubProyecto: +
    + + +
    + +
    +
    +
    +
    > +
    + +
    + + + + + +
    + + +
    + + +
    +
    +
    +
    +
    +
    + + + + + + + + +
    CompraTraslado
    + + + + + + + + + + +
    +
    + + +
    + + + diff --git a/Compras/RepCartaPorteTraslados.aspx.vb b/Compras/RepCartaPorteTraslados.aspx.vb new file mode 100644 index 000000000..6c883a8eb --- /dev/null +++ b/Compras/RepCartaPorteTraslados.aspx.vb @@ -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