This commit is contained in:
2020-04-14 21:02:25 -07:00
10 changed files with 2854 additions and 38 deletions

View File

@@ -4433,13 +4433,14 @@ Public Class ClsVentas
Return retorno Return retorno
End Function End Function
Public Function GetRepTopClientesVentas(CveEmpresa As Integer, Mes As Integer, Año As Integer, Optional CveSubProyecto As Integer = -1) As Boolean Public Function GetRepTopClientesVentas(CveEmpresa As Integer, Mes As Integer, Año As Integer, Optional Top As Integer = 20, Optional CveSubProyecto As Integer = -1) As Boolean
Dim retorno As Boolean = False Dim retorno As Boolean = False
DataAdapter("PA_Vta_Top20ClientesMasVendidos", CommandType.StoredProcedure) DataAdapter("PA_Vta_Top20ClientesMasVendidos", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Mes", SqlDbType.Int).Value = Mes .Add("@Mes", SqlDbType.Int).Value = Mes
.Add("@Año", SqlDbType.Int).Value = Año .Add("@Año", SqlDbType.Int).Value = Año
.Add("@Top", SqlDbType.Int).Value = Top
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
End With End With
Try Try

View File

@@ -250,6 +250,9 @@
<ItemTemplate> <ItemTemplate>
<asp:HyperLink ID="HLImporte" Text='<%# Eval("Abonado", "{0:N2}") %>' Target="_blank" CssClass="Texto" runat="server" />&nbsp;&nbsp; <asp:HyperLink ID="HLImporte" Text='<%# Eval("Abonado", "{0:N2}") %>' Target="_blank" CssClass="Texto" runat="server" />&nbsp;&nbsp;
</ItemTemplate> </ItemTemplate>
<HeaderTemplate>
<asp:LinkButton ID="LnkCabeceraPendientes" runat="server" OnClick="LnkCabecera_Click" Text="" CssClass="Texto" ></asp:LinkButton>
</HeaderTemplate>
</asp:TemplateField> </asp:TemplateField>
<%--<asp:BoundField DataField="Abonado" HeaderText="Importe" DataFormatString="{0:N2}" />--%> <%--<asp:BoundField DataField="Abonado" HeaderText="Importe" DataFormatString="{0:N2}" />--%>
</Columns> </Columns>
@@ -621,6 +624,64 @@
<asp:Button ID="BtnReporteAltaGenera" ClientIDMode="Static" Text="" runat="server" Style="display: none;" OnClick="BtnReporteAltaGenera_Click" /> <asp:Button ID="BtnReporteAltaGenera" ClientIDMode="Static" Text="" runat="server" Style="display: none;" OnClick="BtnReporteAltaGenera_Click" />
<asp:Button ID="BtnReportePago" ClientIDMode="Static" Text="" runat="server" Style="display: none;" OnClick="BtnReportePago_Click" /> <asp:Button ID="BtnReportePago" ClientIDMode="Static" Text="" runat="server" Style="display: none;" OnClick="BtnReportePago_Click" />
<div id="UpModalCuentas" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content" style="width:750px!important">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Alta Cuentas</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel ID="UpModalCuentasCuerpo" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvCuentasModal" runat="server" DataKeyNames="CveCuentaDeposito" AutoGenerateColumns="False" ToolTip="Cuentas modal" OnRowDataBound="GvCuentasModal_RowDataBound"
CssClass="table table-striped table-hover Widthall" Style="text-align: center;" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Razon Social" DataField="RazonSocial" ItemStyle-Width="200" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Banco" DataField="BancoNombre" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Cuenta" DataField="Cuenta" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Clabe" DataField="CLABEDestino" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Alias" DataField="BBVAAlias" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Alta" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="40px">
<ItemTemplate>
<asp:CheckBox ID="ChkCuentasEstatus" runat="server" Checked='<%# Eval("EstatusPagoElectronicoGrupos") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnModalCuentasGuardar" Text="Guardar" runat="server" ClientIDMode="Static" CssClass="btn btn-primary" OnClick="BtnModalCuentasGuardar_Click" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</asp:Content> </asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">

View File

@@ -230,7 +230,19 @@ Partial Class Bancos_PagoElectronicoGrupos
Else Else
DTEnviadas = Nothing DTEnviadas = Nothing
End If End If
ObjBancos.Dispose() ObjBancos.Dispose()
If DTPendientes IsNot Nothing AndAlso DTPendientes.Rows.Count > 0 Then
CargaDatosInformativos()
Else
LbNumeroMovimientos.Text = "0"
LbImporteMovimientos.Text = "0"
UpComandosGeneracion.Update()
End If
'Carga GvPendientes 'Carga GvPendientes
@@ -245,18 +257,10 @@ Partial Class Bancos_PagoElectronicoGrupos
End If End If
GvEnviadas.DataBind() GvEnviadas.DataBind()
UpGVDatos.Update() UpGVDatos.Update()
If DTPendientes IsNot Nothing AndAlso DTPendientes.Rows.Count > 0 Then
CargaDatosInformativos()
Else
LbNumeroMovimientos.Text = "0"
LbImporteMovimientos.Text = "0"
UpComandosGeneracion.Update()
End If
End Sub End Sub
Private Sub CargaDatosInformativos() Private Sub CargaDatosInformativos()
Dim Altas = 0 Dim Altas = 0
@@ -393,11 +397,21 @@ Partial Class Bancos_PagoElectronicoGrupos
' Return Retorno ' Return Retorno
'End Function 'End Function
#End Region #End Region
#Region " TAB PRINCIPAL " #Region " TAB PRINCIPAL "
Protected Sub GvPendientes_RowDataBound(sender As Object, e As GridViewRowEventArgs) Protected Sub GvPendientes_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.Header Then
e.Row.FCLinkButton("LnkCabeceraPendientes").Text = LbNumeroAltas.Text
End If
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
'Colorea GV 'Colorea GV
@@ -430,6 +444,8 @@ Partial Class Bancos_PagoElectronicoGrupos
e.Row.FCHyperLink("HLImporte").NavigateUrl = String.Format("IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE")) e.Row.FCHyperLink("HLImporte").NavigateUrl = String.Format("IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE"))
End If End If
End Sub End Sub
Protected Sub GvEnviadas_RowDataBound(sender As Object, e As GridViewRowEventArgs) Protected Sub GvEnviadas_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
@@ -549,7 +565,7 @@ Partial Class Bancos_PagoElectronicoGrupos
Dim DtCuentasPendientesInterbancarias As DataTable = DtCuentasPendientesTemp.FiltraParametros($" (EstatusPagoElectronicoGrupos IS NULL OR EstatusPagoElectronicoGrupos = False) AND (BancoNombre not like '%BBVA%' AND BancoNombre not like '%BANCOMER%' ) ", "", {"CveCuentaDeposito", "BancoNombre", "CLABEDestino", "Abreviatura", "RazonSocial", "CveProveedor", "CveBanco", "Cuenta", "BBVAAlias"}) Dim DtCuentasPendientesInterbancarias As DataTable = DtCuentasPendientesTemp.FiltraParametros($" (EstatusPagoElectronicoGrupos IS NULL OR EstatusPagoElectronicoGrupos = False) AND (BancoNombre not like '%BBVA%' AND BancoNombre not like '%BANCOMER%' ) ", "", {"CveCuentaDeposito", "BancoNombre", "CLABEDestino", "Abreviatura", "RazonSocial", "CveProveedor", "CveBanco", "Cuenta", "BBVAAlias"})
Dim ObjGrales As New ClsGenerales 'Dim ObjGrales As New ClsGenerales
If DtCuentasPendientesBancomer.Rows.Count > 0 Then If DtCuentasPendientesBancomer.Rows.Count > 0 Then
For Each dRow As DataRow In DtCuentasPendientesBancomer.Rows For Each dRow As DataRow In DtCuentasPendientesBancomer.Rows
@@ -594,7 +610,7 @@ Partial Class Bancos_PagoElectronicoGrupos
If Not ErrorLineaBancomer Then If Not ErrorLineaBancomer Then
RegistrosAltaBancomer.Append(SBTmpBancomer.ToString) RegistrosAltaBancomer.Append(SBTmpBancomer.ToString)
ObjGrales.UpdateCuentasDepositosEstatusPagoElectronicoGrupos(dRow("CveCuentaDeposito").ToString.ToEntero, True) ' ObjGrales.UpdateCuentasDepositosEstatusPagoElectronicoGrupos(dRow("CveCuentaDeposito").ToString.ToEntero, True)
Else Else
SBErroresBancomer.Append("<br>") SBErroresBancomer.Append("<br>")
SBErrores.AppendLine(SBErroresBancomer.ToString) SBErrores.AppendLine(SBErroresBancomer.ToString)
@@ -671,7 +687,7 @@ Partial Class Bancos_PagoElectronicoGrupos
If Not ErrorLineaInterbancaria Then If Not ErrorLineaInterbancaria Then
RegistrosAltaInterbancario.Append(SBTmpInterbancarias.ToString) RegistrosAltaInterbancario.Append(SBTmpInterbancarias.ToString)
ObjGrales.UpdateCuentasDepositosEstatusPagoElectronicoGrupos(dRow("CveCuentaDeposito").ToString.ToEntero, True) ' ObjGrales.UpdateCuentasDepositosEstatusPagoElectronicoGrupos(dRow("CveCuentaDeposito").ToString.ToEntero, True)
Else Else
SBErroresInterBancario.Append("<br>") SBErroresInterBancario.Append("<br>")
SBErrores.AppendLine(SBErroresInterBancario.ToString) SBErrores.AppendLine(SBErroresInterBancario.ToString)
@@ -688,7 +704,7 @@ Partial Class Bancos_PagoElectronicoGrupos
End If End If
ObjGrales.Dispose() ' ObjGrales.Dispose()
Dim Mensaje As New StringBuilder Dim Mensaje As New StringBuilder
@@ -1935,7 +1951,7 @@ Partial Class Bancos_PagoElectronicoGrupos
Dim DtCuentasPendientesInterbancarias As DataTable = DtCuentasPendientesTemp.FiltraParametros($" (EstatusPagoElectronicoGrupos IS NULL OR EstatusPagoElectronicoGrupos = False) AND (BancoNombre not like '%BBVA%' AND BancoNombre not like '%BANCOMER%' ) ", "", {"CveCuentaDeposito", "BancoNombre", "CLABEDestino", "Abreviatura", "RazonSocial", "CvePersonal", "CveBanco", "Cuenta", "BBVAAlias"}) Dim DtCuentasPendientesInterbancarias As DataTable = DtCuentasPendientesTemp.FiltraParametros($" (EstatusPagoElectronicoGrupos IS NULL OR EstatusPagoElectronicoGrupos = False) AND (BancoNombre not like '%BBVA%' AND BancoNombre not like '%BANCOMER%' ) ", "", {"CveCuentaDeposito", "BancoNombre", "CLABEDestino", "Abreviatura", "RazonSocial", "CvePersonal", "CveBanco", "Cuenta", "BBVAAlias"})
'CLABEDestino 'CLABEDestino
Dim ObjGrales As New ClsGenerales ' Dim ObjGrales As New ClsGenerales
If DtCuentasPendientesBancomer.Rows.Count > 0 Then If DtCuentasPendientesBancomer.Rows.Count > 0 Then
For Each dRow As DataRow In DtCuentasPendientesBancomer.Rows For Each dRow As DataRow In DtCuentasPendientesBancomer.Rows
@@ -1986,7 +2002,7 @@ Partial Class Bancos_PagoElectronicoGrupos
If Not ErrorLineaBancomer Then If Not ErrorLineaBancomer Then
RegistrosAltaBancomer.Append(SBTmpBancomer.ToString) RegistrosAltaBancomer.Append(SBTmpBancomer.ToString)
ObjGrales.UpdateCuentasDepositosEstatusPagoElectronicoGrupos(dRow("CveCuentaDeposito").ToString.ToEntero, True) ' ObjGrales.UpdateCuentasDepositosEstatusPagoElectronicoGrupos(dRow("CveCuentaDeposito").ToString.ToEntero, True)
Else Else
SBErroresBancomer.Append("<br>") SBErroresBancomer.Append("<br>")
SBErrores.AppendLine(SBErroresBancomer.ToString) SBErrores.AppendLine(SBErroresBancomer.ToString)
@@ -2070,7 +2086,7 @@ Partial Class Bancos_PagoElectronicoGrupos
If Not ErrorLineaInterbancaria Then If Not ErrorLineaInterbancaria Then
RegistrosAltaInterbancario.Append(SBTmpInterbancarias.ToString) RegistrosAltaInterbancario.Append(SBTmpInterbancarias.ToString)
ObjGrales.UpdateCuentasDepositosEstatusPagoElectronicoGrupos(dRow("CveCuentaDeposito").ToString.ToEntero, True) ' ObjGrales.UpdateCuentasDepositosEstatusPagoElectronicoGrupos(dRow("CveCuentaDeposito").ToString.ToEntero, True)
Else Else
SBErroresInterBancario.Append("<br>") SBErroresInterBancario.Append("<br>")
SBErrores.AppendLine(SBErroresInterBancario.ToString) SBErrores.AppendLine(SBErroresInterBancario.ToString)
@@ -2087,7 +2103,7 @@ Partial Class Bancos_PagoElectronicoGrupos
End If End If
ObjGrales.Dispose() ' ObjGrales.Dispose()
Dim Mensaje As New StringBuilder Dim Mensaje As New StringBuilder
@@ -3046,8 +3062,74 @@ Partial Class Bancos_PagoElectronicoGrupos
'NO QUITAR, SE OCUPA PARA EXPORTAR PDF 'NO QUITAR, SE OCUPA PARA EXPORTAR PDF
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
Return Return
End Sub End Sub
Protected Sub LnkCabecera_Click(sender As Object, e As EventArgs)
CargaGVPendintesModal()
RegistraScript("$('#UpModalCuentas').modal();")
End Sub
Private Sub CargaGVPendintesModal()
Dim DTGvCuentasPendientes As DataTable = DTPendientes.Copy.FiltraParametros("CveCuentaDeposito > 0", "", {"CveCuentaDeposito", "BancoNombre", "RazonSocial", "Cuenta", "CLABEDestino", "BBVAAlias", "EstatusPagoElectronicoGrupos"})
GvCuentasModal.DataSource = DTGvCuentasPendientes
GvCuentasModal.DataBind()
UpModalCuentasCuerpo.Update()
End Sub
Protected Sub GvCuentasModal_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCCheckBox("ChkCuentasEstatus").Checked = True
End If
End Sub
Protected Sub BtnModalCuentasGuardar_Click(sender As Object, e As EventArgs)
Dim ErrorProceso As Boolean = False
Dim CountAltas As Integer = 0
Dim ObjGenerales As New ClsGenerales
ObjGenerales.IniciaTransacSQL()
For Each GvRow As GridViewRow In GvCuentasModal.Rows
Dim CveCuentaDeposito As Integer = GvRow.DataKey("CveCuentaDeposito").ToEntero
Dim ChkCuentasEstatus As CheckBox = GvRow.FCCheckBox("ChkCuentasEstatus")
If Not ObjGenerales.UpdateCuentasDepositosEstatusPagoElectronicoGrupos(CveCuentaDeposito, ChkCuentasEstatus.Checked) Then
ErrorProceso = True
Exit For
End If
Next
If ErrorProceso Then
ObjGenerales.RollBack()
Alert("Se presentoun error al actualziar las cuentas", TipoMensaje.MsgError)
Else
ObjGenerales.Commit()
Alert("Estado de cuentas actualizado correctamente.")
RegistraScript("$('#UpModalCuentas').modal('hide');")
End If
ObjGenerales.Dispose()
CargaDatos()
End Sub
End Class End Class

View File

@@ -2517,8 +2517,6 @@ Partial Class Bancos_ProveedoresAbonar
ElseIf DdlTipoTransaccion.SelectedValue = "17" Then ElseIf DdlTipoTransaccion.SelectedValue = "17" Then
'''Permitir pago sin cuneta deposito
If Dep.DtResultados.Rows.Count > 0 Then If Dep.DtResultados.Rows.Count > 0 Then
DdlCuentaDeposito.DataSource = Dep.DtResultados '.FiltraParametros("EstatusPagoElectronicoGrupos = 'True' AND Estatus ='True'") DdlCuentaDeposito.DataSource = Dep.DtResultados '.FiltraParametros("EstatusPagoElectronicoGrupos = 'True' AND Estatus ='True'")
trCuentaDeposito.Visible = True trCuentaDeposito.Visible = True
@@ -2556,6 +2554,17 @@ Partial Class Bancos_ProveedoresAbonar
DdlCuentaDeposito.SelectedIndex = 1 DdlCuentaDeposito.SelectedIndex = 1
End If End If
Else
If DdlTipoTransaccion.SelectedValue = "17" Then
BtnIEGuardar.Enabled = False
BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito"
UpGuardar.Update()
End If
End If End If
End If End If

View File

@@ -5,13 +5,13 @@
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catálogo de Empresas CRM Catálogo de Prospectos
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server"> <asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li> <li>
<asp:HyperLink ID="LnkAgregar" NavigateUrl="/CRM/EmpresaCRM.aspx" runat="server" Target="_blank"><i class="fa fa-plus"></i><span style="padding-left:5px;">Agregar Empresa</span></asp:HyperLink> <asp:HyperLink ID="LnkAgregar" NavigateUrl="/CRM/EmpresaCRM.aspx" runat="server" Target="_blank"><i class="fa fa-plus"></i><span style="padding-left:5px;">Agregar Prospecto</span></asp:HyperLink>
</li> </li>
</asp:Content> </asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server"> <asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
@@ -48,7 +48,7 @@
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" /> <input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
<asp:GridView ID="GVDatos" runat="server" DataKeyNames="CveEmpresaCRM, Empresa, RFC, CveMedioCaptacion, MedioCaptacion, CveVendedorAsignado, Vendedor, NoContactos, NoAcercamientos, CveUsuarioIng, UsuarioIng, FechaIng" EmptyDataText="No se han registrado de Empresas" <asp:GridView ID="GVDatos" runat="server" DataKeyNames="CveEmpresaCRM, Empresa, RFC, CveMedioCaptacion, MedioCaptacion, CveVendedorAsignado, Vendedor, NoContactos, NoAcercamientos, CveUsuarioIng, UsuarioIng, FechaIng" EmptyDataText="No se han registrado de Prospectos"
EmptyDataRowStyle-HorizontalAlign="Center" CssClass="table table-striped table-advance table-hover ScrollAD Widthall mysmallbtn" data-sort="true" EmptyDataRowStyle-HorizontalAlign="Center" CssClass="table table-striped table-advance table-hover ScrollAD Widthall mysmallbtn" data-sort="true"
GridLines="None" AutoGenerateColumns="false" OnRowDeleting="GVDatos_RowDeleting" OnRowDataBound="GVDatos_RowDataBound"> GridLines="None" AutoGenerateColumns="false" OnRowDeleting="GVDatos_RowDeleting" OnRowDataBound="GVDatos_RowDataBound">
<Columns> <Columns>

View File

@@ -28,7 +28,7 @@
</tr> </tr>
<tr align="left" visible="true"> <tr align="left" visible="true">
<td class="text-right" style="width: 140px;"><b>Empresa CRM:</b></td> <td class="text-right" style="width: 140px;"><b>Prospecto:</b></td>
<td> <td>
<asp:DropDownList ID="DdlEmpresaCRM" runat="server" AppendDataBoundItems="true" DataTextField="Empresa" DataValueField="CveEmpresaCRM" Class="table-group-action-input form-control input-inline input-sm select2me" Width="200px"></asp:DropDownList> <asp:DropDownList ID="DdlEmpresaCRM" runat="server" AppendDataBoundItems="true" DataTextField="Empresa" DataValueField="CveEmpresaCRM" Class="table-group-action-input form-control input-inline input-sm select2me" Width="200px"></asp:DropDownList>
</td> </td>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -5,6 +5,54 @@
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" /> <link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
<style> <style>
.btnopaco {
background-color: rgba(0,0,0,0.2);
color: #FFF;
}
.btnopaco:hover {
background-color: rgba(0,0,0,0.4);
color: #FFF;
font-weight: bold;
}
.select2 .select2-selection__rendered {
line-height: 1;
color: #111;
}
.select2 .select2-selection--multiple {
box-sizing: border-box;
cursor: pointer;
display: block;
min-height: 20px;
user-select: none;
-webkit-user-select: none;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
margin-top: 10px;
}
.select2-selection__rendered {
margin-top: 0px;
height: 25px;
}
.select2-selection {
margin-top: 0px;
height: 31px;
}
.select2-container--default.select2-container--focus .select2-selection--multiple {
border: none;
outline: 0;
}
#chartdiv {
width: 100%;
height: 700px;
}
</style> </style>
</asp:Content> </asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="HA" runat="Server"> <asp:Content ID="Content8" ContentPlaceHolderID="HA" runat="Server">
@@ -13,6 +61,13 @@
<li> <li>
<asp:LinkButton ID="ImgImprimir" runat="server"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF</asp:LinkButton> <asp:LinkButton ID="ImgImprimir" runat="server"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF</asp:LinkButton>
</li> </li>
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkVerGrafica" OnClick="LnkVerGrafica_Click" runat="server"><i class="fa fa-signal"></i> Ver Grafica</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Reporte de Top de Ventas por Cliente Reporte de Top de Ventas por Cliente
@@ -53,11 +108,16 @@
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<label class="col-md-1 ">Grupo:</label> <label class="col-md-1 ">Sucursal:</label>
<div class="col-md-2"> <div class="col-md-1">
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataValueField="CveSubProyecto" DataTextField="SubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me"> <asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataValueField="CveSubProyecto" DataTextField="SubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<label class="col-md-1 " style="margin-left: 40px">Top:</label>
<div class="col-md-1">
<asp:TextBox runat="server" ID="TxtTop" CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" Style="width: 50%"></asp:TextBox>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -67,17 +127,81 @@
</asp:UpdatePanel> </asp:UpdatePanel>
<asp:UpdatePanel ID="UppGrid" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UppGrid" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvM" runat="server" GridLines="none" CssClass="table table-striped table-advance table-hover" Style="margin-top: 10px; text-align: center; width: 100%" ShowHeader="False" EmptyDataText="Aún no hay registros." <asp:GridView ID="GvM" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCliente,NombreComercial,ImporteAcumulado" EmptyDataText="No se encontraron Motivo de Baja Registrados"
DataKeyNames="NombreComercial,ImporteAcumulado" AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True" ShowHeaderWhenEmpty="True"> ToolTip="Listado de Top de Clientes" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" Style="text-align: center; width: 100%" GridLines="None">
<Columns> <Columns>
<asp:BoundField HeaderText="Cliente" DataField="NombreComercial" ItemStyle-HorizontalAlign="Left" /> <asp:HyperLinkField DataTextField='NombreComercial' HeaderText="Cliente" DataNavigateUrlFormatString="/Ventas/Clientes.aspx?CveCliente={0}" DataNavigateUrlFields="CveCliente" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Importe" DataField="ImporteAcumulado" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Importe" DataField="ImporteAcumulado" ItemStyle-HorizontalAlign="Left" DataFormatString="{0:C2}" />
</Columns> </Columns>
</asp:GridView> </asp:GridView>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<div id="DivModalGrafica" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog modal-lg" runat="server" ID="UPModalProd" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label ID="LblTituloGrafica" runat="server" ClientIDMode="Static" Text=""></asp:Label>
</h4>
</div>
<div class="modal-body">
<br />
<div id="chartdiv"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content> </asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script src="//www.amcharts.com/lib/4/core.js"></script>
<script src="//www.amcharts.com/lib/4/charts.js"></script>
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
<script src="https://www.amcharts.com/lib/3/pie.js"></script>
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
<script> <script>
function CargaGraficaBarras(data) {
var chart = am4core.createFromConfig({
"data": data,
"xAxes": [{
"type": "CategoryAxis",
"dataFields": {
"category": "Cliente"
},
"renderer": {
"minGridDistance":10,
"labels": {
"rotation": 90,
"verticalCenter": "middle",
"horizontalCenter": "left",
"truncate": true,
"maxWidth": 200
}
}
}],
"yAxes": [{
"type": "ValueAxis"
}],
"series": [{
"type": "ColumnSeries",
"dataFields": {
"valueY": "Importe",
"categoryX": "Cliente"
}
}]
}, "chartdiv", am4charts.XYChart);
</script> </script>
</asp:Content> </asp:Content>

View File

@@ -9,6 +9,15 @@ Imports Microsoft.Reporting.WebForms
Partial Class Ventas_RepTopClientesVentas Partial Class Ventas_RepTopClientesVentas
Inherits ClsPaginas Inherits ClsPaginas
Private Property DtClientes As DataTable
Get
Return DirectCast(ViewState("DtClientes"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtClientes") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
CargarFiltros() CargarFiltros()
@@ -47,12 +56,16 @@ Partial Class Ventas_RepTopClientesVentas
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
DdlSubProyecto.DataBind() DdlSubProyecto.DataBind()
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
TxtTop.Text = "20"
End Sub End Sub
Private Sub CargaDatos() Private Sub CargaDatos()
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
If ObjVentas.GetRepTopClientesVentas(UsuarioActual.CveEmpresa, DdlMes.SelectedValue.ToEntero, DdlAño.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero) Then If ObjVentas.GetRepTopClientesVentas(UsuarioActual.CveEmpresa, DdlMes.SelectedValue.ToEntero, DdlAño.SelectedValue.ToEntero, TxtTop.Text.ToEntero,
DdlSubProyecto.SelectedValue.ToEntero) Then
GvM.DataSource = ObjVentas.DtResultados GvM.DataSource = ObjVentas.DtResultados
DtClientes = ObjVentas.DtResultados
End If End If
ObjVentas.Dispose() ObjVentas.Dispose()
GvM.DataBind() GvM.DataBind()
@@ -62,4 +75,50 @@ Partial Class Ventas_RepTopClientesVentas
CargaDatos() CargaDatos()
UppGrid.Update() UppGrid.Update()
End Sub End Sub
Protected Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles ImgImprimir.Click
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString))
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)
If Imagen.Exists Then
params.Add(New ReportParameter("pImg", logouri))
Else
params.Add(New ReportParameter("pImg", ""))
End If
ImprimirPDF("Empresas/Grales/Formatos/TopClientes.rdlc", DtClientes, params, String.Format("ReporteVentas-{0}", Now.ToDateTime.ToShortDateString), Formato:="PDF")
End Sub
Protected Sub LnkVerGrafica_Click(sender As Object, e As EventArgs)
If Not DtClientes IsNot Nothing AndAlso DtClientes.Rows.Count > 0 Then
Alert("No hay datos disponibles", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
LblTituloGrafica.Text = $"Agrupado por: Clientes"
RegistraScript("$('#DivModalGrafica').modal('show')")
CambioGrafica()
End Sub
Private Sub CambioGrafica()
Dim Dt As New DataTable()
Dt.Columns.Add("Cliente")
Dt.Columns.Add("Importe")
For Each Dr As DataRow In DtClientes.Rows
Dim Row As DataRow = Nothing
Row = Dt.NewRow()
Row("Cliente") = Dr("NombreComercial").ToString
Row("Importe") = Dr("ImporteAcumulado").ToString.FormatoNumero
Dt.Rows.Add(Row)
Next
Dim query = From s In Dt.AsEnumerable() Select New With {.Cliente = s("Cliente").ToString(), .Importe = s("Importe").ToString().ToDouble()}
Dim json As String = Newtonsoft.Json.JsonConvert.SerializeObject(query)
RegistraScript($"CargaGraficaBarras({json})", "22")
UPModalProd.Update()
End Sub
End Class End Class