Marcas en Reportes de utilidad

- globaldtmarcas
This commit is contained in:
2021-08-20 20:34:04 -07:00
parent 39ebc429f6
commit 661c0126c7
7 changed files with 67 additions and 14 deletions

View File

@@ -2356,6 +2356,33 @@ Public Class ClsPaginas
End Set End Set
End Property 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 #End Region
#Region "***********************************************************************DT PROSPECTOS*************************************************************************************" #Region "***********************************************************************DT PROSPECTOS*************************************************************************************"

View File

@@ -2826,7 +2826,7 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function 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 Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasUtilidadGet") DataAdapter("PA_Vta_VentasUtilidadGet")
@@ -2839,6 +2839,7 @@ Public Class ClsVentas
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
End With End With
Try Try
@@ -2853,7 +2854,7 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function 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 Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasUtilidadDetalleGet") DataAdapter("PA_Vta_VentasUtilidadDetalleGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -2866,6 +2867,7 @@ Public Class ClsVentas
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
End With End With
Try Try
@@ -2883,7 +2885,7 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function 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 Dim Retorno As Boolean = False
DataAdapter("PA_Vta_RepVentasUtilidadGet") DataAdapter("PA_Vta_RepVentasUtilidadGet")
@@ -2897,6 +2899,7 @@ Public Class ClsVentas
.Add("@Gpo", SqlDbType.Int).Value = Gpo .Add("@Gpo", SqlDbType.Int).Value = Gpo
.Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -1801,11 +1801,8 @@ Partial Class ProductosyServicios
DivMarca.Visible = True DivMarca.Visible = True
End If End If
Dim ObjMarcas As New ClsProductosServicios DdlMarca.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) DdlMarcaPSDes.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
DdlMarca.DataSource = ObjMarcas.DtResultados
DdlMarcaPSDes.DataSource = ObjMarcas.DtResultados
ObjMarcas.Dispose()
DdlMarca.DataBind() DdlMarca.DataBind()
DdlMarcaPSDes.DataBind() DdlMarcaPSDes.DataBind()
End If End If

View File

@@ -191,6 +191,12 @@
<div class="col-md-2"> <div class="col-md-2">
<ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width: 100%;" CssClass="DdlPS" CssClassDdl="select2me " DataTextField="PSCodigo" DataValueField="CvePS" /> <ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width: 100%;" CssClass="DdlPS" CssClassDdl="select2me " DataTextField="PSCodigo" DataValueField="CvePS" />
</div> </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> </div>
</div> </div>

View File

@@ -81,6 +81,10 @@ Partial Class Ventas_RepVentasUtilidad
DdlPS.ddl.Items.Insert(0, New ListItem("Todos", "-1")) DdlPS.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End If 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 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 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 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 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 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 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) DdlSubProyecto.SelectedValuesIfExistM(CveSubProyecto)
DdlVendedor.SelectedValuesIfExistM(CveVendedor) DdlVendedor.SelectedValuesIfExistM(CveVendedor)
@@ -105,6 +110,8 @@ Partial Class Ventas_RepVentasUtilidad
DdlPS.SelectedText = "Todos" DdlPS.SelectedText = "Todos"
End If End If
DdlMarcas.SelectedValueExist(CveMarca)
txtFechaI.Text = FechaI txtFechaI.Text = FechaI
txtFechaF.Text = FechaF txtFechaF.Text = FechaF
@@ -144,7 +151,7 @@ Partial Class Ventas_RepVentasUtilidad
Dim Sucursales As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString Dim Sucursales As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString
Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.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 DtVentas = ObjVentas.DtResultados
GvDatos.DataSource = ObjVentas.DtResultados GvDatos.DataSource = ObjVentas.DtResultados
GvDatos.DataBind() GvDatos.DataBind()

View File

@@ -90,6 +90,7 @@
<asp:ListItem Text="Vendedor" Value="6"></asp:ListItem> <asp:ListItem Text="Vendedor" Value="6"></asp:ListItem>
<asp:ListItem Text="Producto/Servicio" Value="7"></asp:ListItem> <asp:ListItem Text="Producto/Servicio" Value="7"></asp:ListItem>
<asp:ListItem Text="Clasificación" Value="8"></asp:ListItem> <asp:ListItem Text="Clasificación" Value="8"></asp:ListItem>
<asp:ListItem Text="Marca" Value="9"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<div class="col-md-1 truncate"> <div class="col-md-1 truncate">
@@ -165,6 +166,12 @@
<div class="col-md-2"> <div class="col-md-2">
<ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width: 100%;" CssClass="DdlPS" CssClassDdl="select2me " DataTextField="PSCodigo" DataValueField="CvePS" /> <ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width: 100%;" CssClass="DdlPS" CssClassDdl="select2me " DataTextField="PSCodigo" DataValueField="CvePS" />
</div> </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> </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" <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"> CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None" Width="99%" OnRowDataBound="GvDatos_RowDataBound">
<Columns> <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="Ventas" DataField="Ventas" DataFormatString="{0:N2}" />
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Descuento" DataField="Descuento" 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}" /> <asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Bonificación" DataField="Bonificacion" DataFormatString="{0:N2}" />

View File

@@ -86,6 +86,10 @@ Partial Class Ventas_RepVentasUtilidadPadre
DdlPS.ddl.Items.Insert(0, New ListItem("Todos", "-1")) DdlPS.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End If End If
DdlMarcas.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
DdlMarcas.DataBind()
DdlMarcas.Items.Insert(0, New ListItem("Todas", "-1"))
LblNeto.Text = "0" LblNeto.Text = "0"
LblPorNeto.Text = "0" LblPorNeto.Text = "0"
End Sub End Sub
@@ -110,7 +114,8 @@ Partial Class Ventas_RepVentasUtilidadPadre
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
If ObjVentas.GetReportePadreVentasUtilidad(If(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM), DdlClientesWS.SelectedValue.ToEntero, If ObjVentas.GetReportePadreVentasUtilidad(If(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM), DdlClientesWS.SelectedValue.ToEntero,
If(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM), txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, 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 GvDatos.DataSource = ObjVentas.DtResultados
DtDatos = ObjVentas.DtResultados DtDatos = ObjVentas.DtResultados
End If End If
@@ -225,10 +230,10 @@ Partial Class Ventas_RepVentasUtilidadPadre
e.Row.CssClass = "Totales" e.Row.CssClass = "Totales"
e.Row.Cells(0).Text = "Total" e.Row.Cells(0).Text = "Total"
Dim Css As String = "Texto" 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("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.DBCampo("Grupo"), e.Row.DBCampo("GPO"), e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveClasificacion"), e.Row.DBCampo("CveMarca"))
e.Row.Cells(0).Text = "<a class=""" & Css & """ href=""" & Liga & """>" & e.Row.Cells(0).Text & "</a>" e.Row.Cells(0).Text = String.Format("<a class=""{0}"" href=""{1}"">{2}</a>", Css, Liga, e.Row.Cells(0).Text)
Else Else
e.Row.Cells(9).BackColor = Drawing.Color.LightGray e.Row.Cells(9).BackColor = Drawing.Color.LightGray
End If End If
@@ -261,6 +266,7 @@ Partial Class Ventas_RepVentasUtilidadPadre
If DdlClasificacion.SelectedValue <> "-1" Then StrFiltro.AppendFormat("&emsp;<b>Clasificación</b>: {0}", DdlClasificacion.SelectedItem.Text) If DdlClasificacion.SelectedValue <> "-1" Then StrFiltro.AppendFormat("&emsp;<b>Clasificación</b>: {0}", DdlClasificacion.SelectedItem.Text)
If DdlClientesWS.SelectedValue <> "-1" Then StrFiltro.AppendFormat("&emsp;<b>Cliente</b>: {0}", DdlClientesWS.SelectedText) If DdlClientesWS.SelectedValue <> "-1" Then StrFiltro.AppendFormat("&emsp;<b>Cliente</b>: {0}", DdlClientesWS.SelectedText)
If DdlVendedor.GetSelectedText <> "" Then StrFiltro.AppendFormat("&emsp;<b>Vendedor</b>: {0}", DdlVendedor.GetSelectedText) If DdlVendedor.GetSelectedText <> "" Then StrFiltro.AppendFormat("&emsp;<b>Vendedor</b>: {0}", DdlVendedor.GetSelectedText)
If DdlMarcas.SelectedValue <> "-1" Then StrFiltro.AppendFormat("&emsp;<b>Marcas</b>: {0}", DdlMarcas.SelectedItem.Text)
Dim params As List(Of ReportParameter) = New List(Of ReportParameter)() 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 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) Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)