Marcas en Reportes de utilidad
- globaldtmarcas
This commit is contained in:
@@ -2356,6 +2356,33 @@ Public Class ClsPaginas
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property GlobalDTGralMarcas(CveEmpresa As Integer, Optional CveMarca As Integer = -1) As DataTable
|
||||
Get
|
||||
Dim AppNombre As String = String.Format("GlobalDTGralMarcas-{0}", CveEmpresa)
|
||||
'sino existe, recarga los datos
|
||||
If DirectCast(Application(AppNombre), DataTable) Is Nothing Then
|
||||
Dim ObjMarcas As New ClsProductosServicios
|
||||
If ObjMarcas.GetMarcas(CveEmpresa) Then Application(AppNombre) = ObjMarcas.DtResultados Else Application(AppNombre) = Nothing
|
||||
ObjMarcas.Dispose()
|
||||
End If
|
||||
|
||||
Dim filtro As New StringBuilder
|
||||
If CveMarca > 0 Then
|
||||
filtro.AppendFormat(" CveMarca={0} ", CveMarca)
|
||||
End If
|
||||
|
||||
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows)
|
||||
GlobalDTGralMarcas = Dv.ToTable
|
||||
Dv.Dispose()
|
||||
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
Dim AppNombre As String = String.Format("GlobalDTGralMarcas-{0}", CveEmpresa)
|
||||
Application(AppNombre) = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "***********************************************************************DT PROSPECTOS*************************************************************************************"
|
||||
|
||||
@@ -2826,7 +2826,7 @@ Public Class ClsVentas
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function GetReporteVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveClasificacion As Double) As Boolean
|
||||
Public Function GetReporteVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveClasificacion As Integer, CveMarca As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_VentasUtilidadGet")
|
||||
|
||||
@@ -2839,6 +2839,7 @@ Public Class ClsVentas
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
|
||||
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
|
||||
End With
|
||||
|
||||
Try
|
||||
@@ -2853,7 +2854,7 @@ Public Class ClsVentas
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function GetReporteVentasUtilidadDetalle(CveVendedor As String, CveVenta As Integer, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveClasificacion As Double) As Boolean
|
||||
Public Function GetReporteVentasUtilidadDetalle(CveVendedor As String, CveVenta As Integer, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveClasificacion As Integer, CveMarca As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_VentasUtilidadDetalleGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
@@ -2866,6 +2867,7 @@ Public Class ClsVentas
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
|
||||
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
|
||||
End With
|
||||
|
||||
Try
|
||||
@@ -2883,7 +2885,7 @@ Public Class ClsVentas
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function GetReportePadreVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Gpo As Integer, CvePS As Integer, CveClasificacion As Double) As Boolean
|
||||
Public Function GetReportePadreVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Gpo As Integer, CvePS As Integer, CveClasificacion As Integer, CveMarca As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_RepVentasUtilidadGet")
|
||||
|
||||
@@ -2897,6 +2899,7 @@ Public Class ClsVentas
|
||||
.Add("@Gpo", SqlDbType.Int).Value = Gpo
|
||||
.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
|
||||
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
@@ -1801,11 +1801,8 @@ Partial Class ProductosyServicios
|
||||
DivMarca.Visible = True
|
||||
End If
|
||||
|
||||
Dim ObjMarcas As New ClsProductosServicios
|
||||
ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa)
|
||||
DdlMarca.DataSource = ObjMarcas.DtResultados
|
||||
DdlMarcaPSDes.DataSource = ObjMarcas.DtResultados
|
||||
ObjMarcas.Dispose()
|
||||
DdlMarca.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
|
||||
DdlMarcaPSDes.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
|
||||
DdlMarca.DataBind()
|
||||
DdlMarcaPSDes.DataBind()
|
||||
End If
|
||||
|
||||
@@ -191,6 +191,12 @@
|
||||
<div class="col-md-2">
|
||||
<ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width: 100%;" CssClass="DdlPS" CssClassDdl="select2me " DataTextField="PSCodigo" DataValueField="CvePS" />
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
Marca:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<asp:Dropdownlist runat="server" ID="DdlMarcas" CssStyle="width: 100%;" CssClass="form-control input-small input-sm select2me" Width="100%" DataTextField="Marca" DataValueField="CveMarca" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -81,6 +81,10 @@ Partial Class Ventas_RepVentasUtilidad
|
||||
DdlPS.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
|
||||
DdlMarcas.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
|
||||
DdlMarcas.DataBind()
|
||||
DdlMarcas.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||
|
||||
Dim CveSubProyecto = If(Request("CveSubProyecto") IsNot Nothing, Request("CveSubProyecto").ToString, "-1").ToString
|
||||
Dim CveVendedor = If(Request("CveVendedor") IsNot Nothing AndAlso Request("CveVendedor") <> "", Request("CveVendedor"), "-1").ToString
|
||||
Dim CveCliente = If(Request("CveCliente") IsNot Nothing AndAlso Request("CveCliente") <> "", Request("CveCliente"), "-1").ToString
|
||||
@@ -90,6 +94,7 @@ Partial Class Ventas_RepVentasUtilidad
|
||||
Dim FechaF = If(Request("FechaF") IsNot Nothing, Request("FechaF").ToString, "-1").ToString
|
||||
Dim CveClasificacion = If(Request("CveClasificacion") IsNot Nothing AndAlso Request("CveClasificacion") <> "", Request("CveClasificacion"), "-1").ToString
|
||||
Dim CvePS = If(Request("CvePS") IsNot Nothing AndAlso Request("CvePS") <> "", Request("CvePS"), "-1").ToString
|
||||
Dim CveMarca = If(Request("CveMarca") IsNot Nothing AndAlso Request("CveMarca") <> "", Request("CveMarca"), "-1").ToString
|
||||
|
||||
DdlSubProyecto.SelectedValuesIfExistM(CveSubProyecto)
|
||||
DdlVendedor.SelectedValuesIfExistM(CveVendedor)
|
||||
@@ -105,6 +110,8 @@ Partial Class Ventas_RepVentasUtilidad
|
||||
DdlPS.SelectedText = "Todos"
|
||||
End If
|
||||
|
||||
DdlMarcas.SelectedValueExist(CveMarca)
|
||||
|
||||
txtFechaI.Text = FechaI
|
||||
txtFechaF.Text = FechaF
|
||||
|
||||
@@ -144,7 +151,7 @@ Partial Class Ventas_RepVentasUtilidad
|
||||
Dim Sucursales As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString
|
||||
Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString
|
||||
|
||||
If ObjVentas.GetReporteVentasUtilidad(Vendedores, DdlClientes.SelectedValue.ToEntero, Sucursales, FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero) Then
|
||||
If ObjVentas.GetReporteVentasUtilidad(Vendedores, DdlClientes.SelectedValue.ToEntero, Sucursales, FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero,) Then
|
||||
DtVentas = ObjVentas.DtResultados
|
||||
GvDatos.DataSource = ObjVentas.DtResultados
|
||||
GvDatos.DataBind()
|
||||
|
||||
@@ -90,6 +90,7 @@
|
||||
<asp:ListItem Text="Vendedor" Value="6"></asp:ListItem>
|
||||
<asp:ListItem Text="Producto/Servicio" Value="7"></asp:ListItem>
|
||||
<asp:ListItem Text="Clasificación" Value="8"></asp:ListItem>
|
||||
<asp:ListItem Text="Marca" Value="9"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
@@ -165,6 +166,12 @@
|
||||
<div class="col-md-2">
|
||||
<ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width: 100%;" CssClass="DdlPS" CssClassDdl="select2me " DataTextField="PSCodigo" DataValueField="CvePS" />
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
Marca:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<asp:Dropdownlist runat="server" ID="DdlMarcas" CssStyle="width: 100%;" CssClass="form-control input-small input-sm select2me" Width="100%" DataTextField="Marca" DataValueField="CveMarca" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -207,7 +214,7 @@
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ventas Utilidad con los filtros especificados" ToolTip="Listado de Ventas"
|
||||
CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None" Width="99%" OnRowDataBound="GvDatos_RowDataBound">
|
||||
<Columns>
|
||||
<asp:HyperLinkField ItemStyle-HorizontalAlign="Left" Target="_blank" HeaderText="Grupo" DataTextField="GPO" DataNavigateUrlFields="FechaI,FechaF,CveSubProyecto,CveCliente,CveVendedor,Grupo,GPO,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidad.aspx?FechaI={0}&FechaF={1}&CveSubProyecto={2}&CveCliente={3}&CveVendedor={4}&Gpo={5}&CveGpo={6}&CvePS={7}&CveClasificacion={8}" />
|
||||
<asp:HyperLinkField ItemStyle-HorizontalAlign="Left" Target="_blank" HeaderText="Grupo" DataTextField="GPO" DataNavigateUrlFields="FechaI,FechaF,CveSubProyecto,CveCliente,CveVendedor,Grupo,GPO,CvePS,CveClasificacion,CveMarca" DataNavigateUrlFormatString="RepVentasUtilidad.aspx?FechaI={0}&FechaF={1}&CveSubProyecto={2}&CveCliente={3}&CveVendedor={4}&Gpo={5}&CveGpo={6}&CvePS={7}&CveClasificacion={8}&CveMarca={9}" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Ventas" DataField="Ventas" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Descuento" DataField="Descuento" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Bonificación" DataField="Bonificacion" DataFormatString="{0:N2}" />
|
||||
|
||||
@@ -86,6 +86,10 @@ Partial Class Ventas_RepVentasUtilidadPadre
|
||||
DdlPS.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
|
||||
DdlMarcas.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
|
||||
DdlMarcas.DataBind()
|
||||
DdlMarcas.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||
|
||||
LblNeto.Text = "0"
|
||||
LblPorNeto.Text = "0"
|
||||
End Sub
|
||||
@@ -110,7 +114,8 @@ Partial Class Ventas_RepVentasUtilidadPadre
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetReportePadreVentasUtilidad(If(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM), DdlClientesWS.SelectedValue.ToEntero,
|
||||
If(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM), txtFechaI.Text.ToDate, txtFechaF.Text.ToDate,
|
||||
UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero) Then
|
||||
UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero,
|
||||
DdlMarcas.SelectedValue.ToEntero) Then
|
||||
GvDatos.DataSource = ObjVentas.DtResultados
|
||||
DtDatos = ObjVentas.DtResultados
|
||||
End If
|
||||
@@ -225,10 +230,10 @@ Partial Class Ventas_RepVentasUtilidadPadre
|
||||
e.Row.CssClass = "Totales"
|
||||
e.Row.Cells(0).Text = "Total"
|
||||
Dim Css As String = "Texto"
|
||||
Dim Liga As String = String.Format("/Ventas/RepVentasUtilidad.aspx?FechaI={0}&FechaF={1}&CveSubProyecto={2}&CveCliente={3}&CveVendedor={4}&Gpo={5}&CveGpo={6}&CvePS={7}&CveClasificacion={8}",
|
||||
Dim Liga As String = String.Format("/Ventas/RepVentasUtilidad.aspx?FechaI={0}&FechaF={1}&CveSubProyecto={2}&CveCliente={3}&CveVendedor={4}&Gpo={5}&CveGpo={6}&CvePS={7}&CveClasificacion={8}&CveMarca={9}",
|
||||
e.Row.DBCampo("FechaI"), e.Row.DBCampo("FechaF"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveVendedor"),
|
||||
e.Row.DBCampo("Grupo"), e.Row.DBCampo("GPO"), e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveClasificacion"))
|
||||
e.Row.Cells(0).Text = "<a class=""" & Css & """ href=""" & Liga & """>" & e.Row.Cells(0).Text & "</a>"
|
||||
e.Row.DBCampo("Grupo"), e.Row.DBCampo("GPO"), e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveClasificacion"), e.Row.DBCampo("CveMarca"))
|
||||
e.Row.Cells(0).Text = String.Format("<a class=""{0}"" href=""{1}"">{2}</a>", Css, Liga, e.Row.Cells(0).Text)
|
||||
Else
|
||||
e.Row.Cells(9).BackColor = Drawing.Color.LightGray
|
||||
End If
|
||||
@@ -261,6 +266,7 @@ Partial Class Ventas_RepVentasUtilidadPadre
|
||||
If DdlClasificacion.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" <b>Clasificación</b>: {0}", DdlClasificacion.SelectedItem.Text)
|
||||
If DdlClientesWS.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" <b>Cliente</b>: {0}", DdlClientesWS.SelectedText)
|
||||
If DdlVendedor.GetSelectedText <> "" Then StrFiltro.AppendFormat(" <b>Vendedor</b>: {0}", DdlVendedor.GetSelectedText)
|
||||
If DdlMarcas.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" <b>Marcas</b>: {0}", DdlMarcas.SelectedItem.Text)
|
||||
Dim params As List(Of ReportParameter) = New List(Of ReportParameter)()
|
||||
Dim Imagen As System.IO.FileInfo = 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)
|
||||
|
||||
Reference in New Issue
Block a user