diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index c228be401..68b4135f7 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4663,6 +4663,7 @@ Public Class ClsPaginas PaginaDict.Add("/Ventas/RepRemisionesNC.aspx".ToUpper(), 687) PaginaDict.Add("/Ventas/CatCobranzaEstatus.aspx".ToUpper(), 7003) PaginaDict.Add("/Ventas/CatCobranzaEstatusTurno.aspx".ToUpper(), 7004) + PaginaDict.Add("/Ventas/RepVentasMensuales.aspx".ToUpper(), 720) #End Region diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 04e7b8bb6..08e6787ab 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -4216,6 +4216,28 @@ Public Class ClsVentas Return retorno 'compila End Function + Public Function GetRepVentasMensuales(CveEmpresa As Integer, FechaInicio As Date, FechaFin As Date, Optional CveSubProyecto As Integer = -1, Optional CveClasificacion As Integer = -1, + Optional CveVendedor As Integer = -1, Optional CveMarca As Integer = -1, Optional Modalidad As Integer = 0) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Vta_VentasMensualesGet", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@FechaInicio", SqlDbType.DateTime).Value = FechaInicio + .Add("@FechaFin", SqlDbType.DateTime).Value = FechaFin + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@CveMarca", SqlDbType.Int).Value = CveMarca + .Add("@Modalidad", SqlDbType.Int).Value = Modalidad + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el reporte de ventas mensuales", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function #Region "Conciliación emitidas SAT" Public Function ConciliacionemitidasSATGet(cveEmpresa As Int32) As Boolean diff --git a/Ventas/RepVentasMensuales.aspx b/Ventas/RepVentasMensuales.aspx new file mode 100644 index 000000000..ab8d6d231 --- /dev/null +++ b/Ventas/RepVentasMensuales.aspx @@ -0,0 +1,332 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepVentasMensuales.aspx.vb" Inherits="RepVentasMensuales" %> + + + + + + + + + + Ventas Mensuales + + +
  • + PDF +
  • +
  • + Excel +
  • +
    + + + +
    +
    +
    + + "> + +
    +
    +
    + + <%--
    Proveedor
    +
    + +
    --%> + +
    Fecha Inicio:
    +
    +
    + + + + +
    + + + +
    + +
    Fecha Fin:
    +
    +
    + + + + +
    + + +
    + +
    Sucursal:
    +
    + +
    +
    +
    +
    Clasificación de Productos:
    +
    + +
    + +
    Vendedor:
    +
    + +
    + +
    Marca:
    +
    + +
    + +
    +
    +
    Grupo:
    +
    + + Clientes + Sucursales + Productos Servicios + +
    +
    + +
    +
    +
    > +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + <%-- --%> + diff --git a/Ventas/RepVentasMensuales.aspx.vb b/Ventas/RepVentasMensuales.aspx.vb new file mode 100644 index 000000000..d8f37b22f --- /dev/null +++ b/Ventas/RepVentasMensuales.aspx.vb @@ -0,0 +1,88 @@ +Imports System.Data +Imports Extensiones +Imports Microsoft.Reporting.WebForms + +Partial Class RepVentasMensuales + Inherits ClsPaginas + + Private Property DtDatos As DataTable + Get + DtDatos = DirectCast(ViewState("DtDatos"), DataTable) + End Get + + Set(ByVal value As DataTable) + ViewState("DtDatos") = value + End Set + End Property + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not IsPostBack Then + InicializarFiltros() + CargaDatos() + End If + End Sub + Private Sub InicializarFiltros() + Dim dNow As Date = Now + TxtFechaF.Text = dNow.ToString("dd/MM/yyyy") + dNow = dNow.AddDays(-30) + TxtFechaI.Text = dNow.ToString("dd/MM/yyyy") + + DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa) + DdlSubProyecto.DataBind() + DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) + + DdlClasificacionesPS.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) + DdlClasificacionesPS.DataBind() + DdlClasificacionesPS.Items.Insert(0, New ListItem("Todos", "-1")) + + DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa) + DdlVendedor.DataBind() + DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1")) + + Dim ObjPS As New ClsProductosServicios + If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then + DdlMarca.DataSource = ObjPS.DtResultados + End If + ObjPS.Dispose() + DdlMarca.DataBind() + DdlMarca.Items.Insert(0, New ListItem("Todos", "-1")) + End Sub + + Private Sub CargaDatos() + Dim ObjVentas As New ClsVentas + If ObjVentas.GetRepVentasMensuales(UsuarioActual.CveEmpresa, TxtFechaI.Text, TxtFechaF.Text, DdlSubProyecto.SelectedValue.ToEntero, DdlClasificacionesPS.SelectedValue.ToEntero, + DdlVendedor.SelectedValue.ToEntero, DdlMarca.SelectedValue.ToEntero, DdlModalidad.SelectedValue.ToEntero) Then + GV.DataSource = ObjVentas.DtResultados + DtDatos = ObjVentas.DtResultados + End If + ObjVentas.Dispose() + GV.DataBind() + End Sub + + Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click + CargaDatos() + UPDatos.Update() + End Sub + + Public Sub LnkPDF_Click() Handles LnkPDF.Click + 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 params As New List(Of ReportParameter) + params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa)) + If Imagen.Exists Then + params.Add(New ReportParameter("pImg", logouri)) + Else + params.Add(New ReportParameter("pImg", "")) + End If + params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario)) + params.Add(New ReportParameter("FechaImpresion", Today)) + params.Add(New ReportParameter("Modalidad", DdlModalidad.SelectedValue)) + + ImprimirPDF("Empresas/Grales/Formatos/RepVentasMensuales.rdlc", DtDatos, params, "Rep. Ventas Mensuales", "PDF", RDSName:="DataSet1") + End Sub + + Public Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click + GV.ExportToExcel("Evaluaciones de Proveedores" & Now.ToShortDateString & ".xls") + End Sub +End Class