From f3730e30e8b91a2ab034706adfc99096670a27cc Mon Sep 17 00:00:00 2001 From: janeth arvizu Date: Tue, 22 Oct 2019 13:51:09 -0700 Subject: [PATCH] Reporte de REQ-OC-Compra-Inv --- App_Code/ClsCompras.vb | 47 +++- App_Code/ClsPaginas.vb | 15 +- Compras/RepReqOCCompraInv.aspx | 365 ++++++++++++++++++++++++++++++ Compras/RepReqOCCompraInv.aspx.vb | 161 +++++++++++++ 4 files changed, 579 insertions(+), 9 deletions(-) create mode 100644 Compras/RepReqOCCompraInv.aspx create mode 100644 Compras/RepReqOCCompraInv.aspx.vb diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index ce3783cd5..1f9dedf7e 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -2997,9 +2997,52 @@ Public Class ClsCompras OnError("Ocurrió un error al obtener las compras con método de pago PUE.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try Return retorno - End Function - + End Function + #End Region +#Region "Reporte de REQ-OC-Compra-Inv" + Public Function GetRepReqOCCompraInv(FI As Date, FF As Date, CveProveedor As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Comp_ReqOCCompraInvGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@FI", SqlDbType.Date).Value = FI + .Add("@FF", SqlDbType.Date).Value = FF + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el reporte de REQ-OC-Compra-Inv", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function +#End Region +#Region "Reporte de Precios de Compras" + Public Function GetRepComprasPrecios(CveProveedor As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Comp_ComprasPreciosGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el reporte de Precios de Compras.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function +#End Region End Class diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index d7a1a565b..55e577b76 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3757,15 +3757,16 @@ Public Class ClsPaginas PaginaDict.Add("/Compras/ProveedoresAuxiliar.aspx".ToUpper(), 536) PaginaDict.Add("/Compras/RepComprasInventarios.aspx".ToUpper(), 537) PaginaDict.Add("/Compras/RepAnt-NC-EXC.aspx".ToUpper(), 538) - PaginaDict.Add("/Compras/RepAnt-NC-EXCDetalle.aspx".ToUpper(), 538) - 'EvaluacionProveedor.aspx - PaginaDict.Add("/Compras/EvaluacionProveedor.aspx".ToUpper(), 715) - PaginaDict.Add("/Compras/RepPUESinPago.aspx".ToUpper(), 675) + PaginaDict.Add("/Compras/RepAnt-NC-EXCDetalle.aspx".ToUpper(), 538) + PaginaDict.Add("/Compras/EvaluacionProveedor.aspx".ToUpper(), 715) 'EvaluacionProveedor.aspx + PaginaDict.Add("/Compras/RepPUESinPago.aspx".ToUpper(), 675) + PaginaDict.Add("/Compras/RepReqOCCompraInv.aspx".ToUpper(), 689) + PaginaDict.Add("/Compras/RepComprasPrecios.aspx".ToUpper(), 690) #End Region - - 'CONTABILIDAD + + 'CONTABILIDAD #Region "Contabilidad" - 'CONTABILIDAD ELECTRONICA + 'CONTABILIDAD ELECTRONICA PaginaDict.Add("/Contabilidad/ContabilidadElectronica.aspx".ToUpper(), 566) PaginaDict.Add("/Contabilidad/RepGastosCC.aspx".ToUpper(), 535) PaginaDict.Add("/Contabilidad/ContabilizarPagosCliente.aspx".ToUpper(), 52) diff --git a/Compras/RepReqOCCompraInv.aspx b/Compras/RepReqOCCompraInv.aspx new file mode 100644 index 000000000..8360ec7ca --- /dev/null +++ b/Compras/RepReqOCCompraInv.aspx @@ -0,0 +1,365 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepReqOCCompraInv.aspx.vb" Inherits="RepReqOCCompraInv" %> + + + + + + + +<%--
  • + PDF +
  • +
  • + Excel +
  • --%> +
    + + + + + + + + + <%-- + +
    + +
    +
    +
    --%> +
    + + + + +
    +
    +
    + + "> + +
    +
    +
    + + + +
    +
    + + + + + + + + + + +
    +
    + +
    +
    + + + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    +
    + +
    > +
    + +
    + +
    + +<%-- +
    + +
    --%> +
    +
    +
    +
    +
    +
    +
    +
    + " style="display: inline-block; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + <%----%> + + + + + + + + diff --git a/Compras/RepReqOCCompraInv.aspx.vb b/Compras/RepReqOCCompraInv.aspx.vb new file mode 100644 index 000000000..d92cc9125 --- /dev/null +++ b/Compras/RepReqOCCompraInv.aspx.vb @@ -0,0 +1,161 @@ +Option Explicit On +Option Strict On + +Imports System.Data +Imports Microsoft.Reporting.WebForms +Imports Extensiones +Partial Class RepReqOCCompraInv + Inherits ClsPaginas + Private Shared missing As Object = System.Reflection.Missing.Value + +#Region "PROPIEDADES" + Private Property FechaI As String + Get + Return ViewState("FechaI").ToString + End Get + Set(value As String) + ViewState("FechaI") = value + End Set + End Property + Private Property FechaF As String + Get + Return ViewState("FechaF").ToString + End Get + Set(value As String) + ViewState("FechaF") = value + End Set + End Property + 'Private Property CveCliente As Integer + ' Get + ' Return ViewState("CveCliente").ToString.ToEntero + ' End Get + ' Set(value As Integer) + ' ViewState("CveCliente") = value + ' End Set + 'End Property + 'Private Property Sucursales As String + ' Get + ' Return ViewState("Sucursales").ToString + ' End Get + ' Set(value As String) + ' ViewState("Sucursales") = value + ' End Set + 'End Property + Private Property DtCompras As DataTable + Get + Return DirectCast(ViewState("DtCompras"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtCompras") = value + End Set + End Property + +#End Region + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + txtFechaI.Text = Now.ToShortDateString + txtFechaF.Text = Now.ToShortDateString + + CargaSucursal() + CargaProveedor() + CargaDatos() + + End If + End Sub + +#Region " C A R G A - D A T O S " + Public Sub CargaDatos() + Dim ObjCompras As New ClsCompras + + FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), MinFecha.ToShortDateString) + FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), MaxFecha.ToShortDateString) + + If ObjCompras.GetRepReqOCCompraInv(FechaI.ToDate, FechaF.ToDate, DdlProveedor.SelectedValue.ToEntero, DdlSucursal.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + GvDatos.DataSource = ObjCompras.DtResultados + DtCompras = ObjCompras.DtResultados + GvDatos.DataBind() + UPDatos.Update() + End If + + ObjCompras.Dispose() + End Sub +#End Region + +#Region "G V - D A T O S " + 'Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound + ' If e.Row.RowType = DataControlRowType.DataRow Then + + ' 'Cuando es titulo + ' 'If e.Row.DBCampo("PS").ToString.Trim = "" Then + ' ' e.Row.CssClass = "Totales" + + ' ' e.Row.Cells(0).Text = String.Format("Folio: {0} ", e.Row.DBCampo("FolioSalida"), e.Row.DBCampo("CveMovimientoSalida")) + ' ' e.Row.Cells(1).Text = String.Format("{0}", e.Row.DBCampo("FechaMovto").ToString.ToDate.ToShortDateString) + ' ' e.Row.Cells(3).Text = String.Format("Almacen Destino: {0}       Responsable: {1}", e.Row.DBCampo("AlmacenDestino"), e.Row.DBCampo("Recibio")) + ' 'End If + + ' End If + 'End Sub +#End Region + +#Region "CARGA COMBOS FILTRO" + Private Sub CargaSucursal() + DdlSucursal.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa) + DdlSucursal.DataBind() + DdlSucursal.Items.Insert(0, New ListItem("Todos", "-1")) + DdlSucursal.SelectedValue = "-1" + End Sub + Private Sub CargaProveedor() + DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) + DdlProveedor.DataBind() + DdlProveedor.Items.Insert(0, New ListItem("Todos", "-1")) + DdlProveedor.SelectedValue = "-1" + End Sub +#End Region + +#Region "IMPRESION" + 'Private Sub LnkPdf_Click(sender As Object, e As EventArgs) Handles LnkPdf.Click + ' Imprime("PDF") + 'End Sub + 'Private Sub Imprime(Formato As String) + ' If DtInventarios IsNot Nothing Then + ' Dim StrFiltro As New StringBuilder + ' If txtFechaI.Text <> "" Then StrFiltro.AppendFormat(" Fecha Inicio: {0}", txtFechaI.Text.ToDate.ToShortDateString) + ' If txtFechaF.Text <> "" Then StrFiltro.AppendFormat(" Fecha Fin: {0}", txtFechaF.Text.ToDate.ToShortDateString) + + ' If DdlAlmacenOrigen.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Almacén Origen: {0}", DdlAlmacenOrigen.SelectedItem.Text) + ' If DdlAlmacenDestino.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Almacén Destino: {0}", DdlAlmacenDestino.SelectedItem.Text) + ' If ChkRecibido.Checked Then StrFiltro.AppendFormat(" Recibidos: Si") Else StrFiltro.AppendFormat(" Recibidos: No") + + ' Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + ' Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + + ' Dim FechaI, FechaF As String + ' FechaI = If(txtFechaI.Text = "" Or txtFechaI.Text = "__/__/____", "-1", txtFechaI.Text) + ' FechaF = If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", "-1", txtFechaF.Text) + + ' Dim params As New List(Of ReportParameter) + ' params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) + ' params.Add(New ReportParameter("FechaInicio", FechaI)) + ' params.Add(New ReportParameter("FechaFin", FechaF)) + ' params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) + ' params.Add(New ReportParameter("Filtros", StrFiltro.ToString)) + ' If Imagen.Exists Then + ' params.Add(New ReportParameter("LogoPath", logouri)) + ' Else + ' params.Add(New ReportParameter("LogoPath", "")) + ' End If + ' ImprimirPDF("Empresas/Grales/Formatos/RepTraspasoAlmacen.rdlc", DtInventarios, params, String.Format("RepTraspasoAlmacen-{0}", Now.ToDateTime.ToShortDateString), Formato) + ' Else + ' Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia) + ' End If + 'End Sub +#End Region + Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click + CargaDatos() + End Sub + + 'Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click + ' Imprime("Excel") + 'End Sub +End Class