This commit is contained in:
2025-04-24 10:16:39 -07:00
10 changed files with 289 additions and 104 deletions

View File

@@ -384,10 +384,32 @@ Public Class ClsGenerales
End Try
Return ds
End Function
End Function
Public Function GetDashboardData(CveEmpresa As Integer) As DataSet
Dim ds As New DataSet
DataAdapter("PA_Gral_DashboardsGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@Opcion", SqlDbType.Int).Value = 1
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@FechaInicio", SqlDbType.Date).Value = Date.Now.AddYears(-1)
.Add("@FechaFin", SqlDbType.Date).Value = Date.Now
End With
Try
SqlAdapter.Fill(ds)
ds.Tables(0).TableName = "Indicadores"
ds.Tables(1).TableName = "DetalleDia"
Return ds
Catch ex As Exception
' Manejo de errores
Return Nothing
End Try
End Function
#End Region
#Region " D I A S I N H A B I L E S "
Public Function DiasInhabiles_Add(CveEmpresa As Integer, CveUsuario As Integer, DiaInhabil As String, Descripcion As String, Estatus As Integer, FechaInhabil As Date) As Boolean
Dim Retorno As Boolean = False

View File

@@ -10556,6 +10556,7 @@ Public Class ClsPaginas
PaginaDict.Add("/General/CatMedidaEquivalencia.aspx".ToUpper(), 773)
PaginaDict.Add("/General/RepIndicadorResumen.aspx".ToUpper(), 110)
PaginaDict.Add("/General/SaldosMenores.aspx".ToUpper(), -1)
PaginaDict.Add("/General/Dashboard.aspx".ToUpper(), 17)
#End Region
#Region "GPS"
PaginaDict.Add("/GPS/RepTemperatura.aspx".ToUpper(), 681)

View File

@@ -7697,7 +7697,7 @@ Public Class ClsVentas
End Function
Public Function GetSMSIndicadores(Opcion As Integer, FechaInicio As Date, FechaFin As Date, CveUsuario As Integer, CveVendedor As Integer, CveUsuarioTecnico As Integer, CveEmpresa As Integer) As Boolean
Public Function GetSMSIndicadores(Opcion As Integer, FechaInicio As Date, FechaFin As Date, CveUsuario As Integer, CveVendedor As Integer, CveGerenteVendedor As Integer, CveUsuarioTecnico As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_SMS_IndicadoresGet")
With SqlAdapter.SelectCommand.Parameters
@@ -7706,6 +7706,7 @@ Public Class ClsVentas
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@CveGerenteVendedor", SqlDbType.Int).Value = CveGerenteVendedor
.Add("@CveUsuarioTecnico", SqlDbType.Int).Value = CveUsuarioTecnico
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With

55
General/Dashboard.aspx Normal file
View File

@@ -0,0 +1,55 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Dashboard.aspx.vb" Inherits="General_Dashboard" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
<style type="text/css">
.dashboard-stat {
padding: 15px;
margin-bottom: 20px;
border-radius: 4px;
color: white;
}
.dashboard-stat .visual > i {
font-size: 35px;
opacity: 0.3;
}
.dashboard-stat .details {
padding-right: 15px;
}
.blue { background: #3598dc; }
.green { background: #32c5d2; }
.purple { background: #8e44ad; }
.red { background: #e7505a; }
.indicador-valor { font-size: 24px; font-weight: bold; }
.indicador-detalle { margin-top: 10px; }
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
<asp:UpdatePanel ID="UPDashboard" runat="server">
<ContentTemplate>
<div class="row" id="DivIndicadores" runat="server">
<!-- Aquí se generarán los indicadores -->
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
<script type="text/javascript">
function pageLoad() {
$(document).ready(function(){
// Inicializar tooltips
$('.tooltips').tooltip();
});
}
</script>
</asp:Content>

101
General/Dashboard.aspx.vb Normal file
View File

@@ -0,0 +1,101 @@

Imports System.Data
Imports Extensiones
Imports System.Web.Services
Imports Newtonsoft.Json
Imports ADSNetLibrary.SIGAPI.Models.CRM.Request
Imports ADSNetLibrary.SIGAPI.Services.CRM
Partial Class General_Dashboard
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
CargarIndicadores()
End If
End Sub
Private Sub CargarIndicadores()
Dim Gral As New ClsGenerales
Dim ds As DataSet = Gral.GetDashboardData(UsuarioActual.CveEmpresa)
If ds IsNot Nothing AndAlso ds.Tables.Count > 0 Then
ProcesarDatosIndicadores(ds.Tables(0))
End If
End Sub
Private Sub ProcesarDatosIndicadores(dt As DataTable)
If dt.Rows.Count > 0 Then
Dim dr As DataRow = dt.Rows(0)
' Indicador Año
MuestraIndicador(DivIndicadores, "blue", "fa fa-calendar", "Año Actual", dr("AcumAño").ToString.FormatoNumero(0), "#", "Acumulado",
dr("AcumAñoPromedio").ToString.FormatoNumero(0), "#", "Promedio",
dr("AcumAñoContado").ToString.FormatoNumero(0), "#", "Contado",
dr("AcumAñoCredito").ToString.FormatoNumero(0), "#", "Crédito")
' Indicador Mes
MuestraIndicador(DivIndicadores, "green", "fa fa-calendar-check-o", "Mes Actual",
dr("AcumMes").ToString.FormatoNumero(0), "#", "Acumulado",
dr("AcumMesPromedio").ToString.FormatoNumero(0), "#", "Promedio",
dr("AcumMesContado").ToString.FormatoNumero(0), "#", "Contado",
dr("AcumMesCredito").ToString.FormatoNumero(0), "#", "Crédito")
' Indicador Semana
MuestraIndicador(DivIndicadores, "purple", "fa fa-calendar-minus-o", "Semana Actual",
dr("AcumSemana").ToString.FormatoNumero(0), "#", "Acumulado",
dr("AcumSemanaPromedio").ToString.FormatoNumero(0), "#", "Promedio",
dr("AcumSemanaContado").ToString.FormatoNumero(0), "#", "Contado",
dr("AcumSemanaCredito").ToString.FormatoNumero(0), "#", "Crédito")
MuestraIndicador(DivIndicadores, "red", "fa fa-sun-o", "Hoy",
"0".FormatoNumero(0), "#", "Acumulado",
"0".FormatoNumero(0), "#", "Promedio",
"0".FormatoNumero(0), "#", "Contado",
"0".FormatoNumero(0), "#", "Crédito")
End If
End Sub
Private Sub MuestraIndicador(DIV As HtmlGenericControl, Color As String, Icono As String, Titulo As String, Comentario As String, Link As String, TitleComentario As String)
Dim htmldiv As New StringBuilder
htmldiv.AppendFormat("{0}<div class='col-lg-4 col-md-4 col-sm-6 col-xs-12'><div class='dashboard-stat {1}'><div class='visual'><i class='{2}' '=''></i></div>", DIV.InnerHtml, Color, Icono)
htmldiv.AppendFormat("<div class='details'><div class='number'>{0}</div><div class='desc'><label class='indicadortipo1 tooltips' data-original-title='{1}'>{2}", Titulo, TitleComentario, Comentario)
htmldiv.AppendFormat("</label></div></div><a class='more' href='{0}'>Ver Más <i class='m-icon-swapright m-icon-white'></i></a></div></div>", Link)
DIV.InnerHtml = htmldiv.ToString
End Sub
Private Sub MuestraIndicador(DIV As HtmlGenericControl, Color As String, Icono As String, Titulo As String, C1 As String, CL1 As String, CT1 As String, C2 As String, CL2 As String, CT2 As String)
Dim htmldiv As New StringBuilder
htmldiv.AppendFormat("{0}<div class='col-lg-4 col-md-4 col-sm-6 col-xs-12'><div class='dashboard-stat {1}'><div class='visual'><i class='{2}' '=''></i></div>", DIV.InnerHtml, Color, Icono)
htmldiv.AppendFormat("<div class='details'><div class='number'>{0}</div><div class='desc'>", Titulo)
htmldiv.AppendFormat("<label class='indicadortipo2 col-md-6 tooltips' data-original-title='{0}'>{1}</label>", CT1, C1)
htmldiv.AppendFormat("<label class='indicadortipo2 col-md-6 tooltips' data-original-title='{0}'>{1}</label>", CT2, C2)
htmldiv.Append("</div></div><a class='more' href='javascript:;' data-toggle='dropdown' data-hover='dropdown' data-close-others='true' >Ver Más <i class='m-icon-swapright m-icon-white'></i></a>")
htmldiv.AppendFormat("<ul class='dropdown-menu pull-right' style='margin:0px;' ><li><a href='{0}'>{1}</a></li><li><a href='{2}'>{3}</a></li>", CL1, CT1, CL2, CT2)
htmldiv.Append("</ul></div></div>")
DIV.InnerHtml = htmldiv.ToString
End Sub
Private Sub MuestraIndicador(DIV As HtmlGenericControl, Color As String, Icono As String, Titulo As String, C1 As String, CL1 As String, CT1 As String, C2 As String, CL2 As String, CT2 As String, C3 As String, CL3 As String, CT3 As String)
Dim htmldiv As New StringBuilder
htmldiv.AppendFormat("{0}<div class='col-lg-4 col-md-4 col-sm-6 col-xs-12'><div class='dashboard-stat {1}'><div class='visual'><i class='{2}' '=''></i></div>", DIV.InnerHtml, Color, Icono)
htmldiv.AppendFormat("<div class='details'><div class='number'>{0}</div><div class='desc'><label class='indicadortipo4 col-md-6 tooltips' data-original-title=''></label>", Titulo)
htmldiv.AppendFormat("<label class='indicadortipo4 col-md-6 tooltips' data-original-title='{0}'>{1}</label>", CT1, C1)
htmldiv.AppendFormat("<label class='indicadortipo4 col-md-6 tooltips' data-original-title='{0}'>{1}</label>", CT2, C2)
htmldiv.AppendFormat("<label class='indicadortipo4 col-md-6 tooltips' data-original-title='{0}'>{1}</label>", CT3, C3)
htmldiv.Append("</div></div><a class='more' href='javascript:;' data-toggle='dropdown' data-hover='dropdown' data-close-others='true' >Ver Más <i class='m-icon-swapright m-icon-white'></i></a>")
htmldiv.AppendFormat("<ul class='dropdown-menu pull-right' style='margin:0px;' ><li><a href='{0}'>{1}</a></li><li><a href='{2}'>{3}</a></li><li><a href='{4}'>{5}</a></li>", CL1, CT1, CL2, CT2, CL3, CT3)
htmldiv.Append("</ul></div></div>")
DIV.InnerHtml = htmldiv.ToString
End Sub
Private Sub MuestraIndicador(DIV As HtmlGenericControl, Color As String, Icono As String, Titulo As String, C1 As String, CL1 As String, CT1 As String, C2 As String, CL2 As String, CT2 As String, C3 As String, CL3 As String, CT3 As String, C4 As String, CL4 As String, CT4 As String)
Dim htmldiv As New StringBuilder
htmldiv.AppendFormat("{0}<div class='col-lg-4 col-md-4 col-sm-6 col-xs-12'><div class='dashboard-stat {1}'><div class='visual'><i class='{2}' '=''></i></div>", DIV.InnerHtml, Color, Icono)
htmldiv.AppendFormat("<div class='details'><div class='number'>{0}</div><div class='desc'><label class='indicadortipo4 col-md-6 tooltips' data-original-title='{1}'>{2}</label>", Titulo, CT1, C1)
htmldiv.AppendFormat("<label class='indicadortipo4 col-md-6 tooltips' data-original-title='{0}'>{1}</label>", CT2, C2)
htmldiv.AppendFormat("<label class='indicadortipo4 col-md-6 tooltips' data-original-title='{0}'>{1}</label>", CT3, C3)
htmldiv.AppendFormat("<label class='indicadortipo4 col-md-6 tooltips' data-original-title='{0}'>{1}</label>", CT4, C4)
htmldiv.AppendFormat("</div></div><a class='more' href='{0}'>Ver Más <i class='m-icon-swapright m-icon-white'></i></a></div></div>", CL1)
DIV.InnerHtml = htmldiv.ToString
End Sub
End Class

View File

@@ -553,7 +553,7 @@
<ContentTemplate>
<div class="row" >
<div class="col-md-1">Opción:</div>
<div class="col-md-3">
<div class="col-md-1">
<asp:DropDownList ID="DdlSMSOpciones" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DdlSMSOpciones_SelectedIndexChanged">
<asp:ListItem Text="Vendedor" Value="1" />
<asp:ListItem Text="Gerente Ventas" Value="2" Selected="True" />

View File

@@ -181,19 +181,38 @@ Partial Class Inicio
If UsuarioActual.TienePermisoProceso(343) Then MuestraPsProximosAVencer()
If UsuarioActual.TienePermisoProceso(344) Then MuestraRSCOProximosAVencer()
If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso UsuarioActual.CveUsuario = 3964 Then 'AndAlso UsuarioActual.CveRol.Contiene(1577, 1639, 1573) Then
Dim Opcion As Integer = 1
Dim CveVendedor As Integer = -1
Dim CveUsuarioTecnico As Integer = -1
If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso (UsuarioActual.CveUsuario = 3964 Or UsuarioActual.CveRol = 1639) Then 'AndAlso UsuarioActual.CveRol.Contiene(1577, 1639, 1573) Then
'Dim Opcion As Integer = 1
'Dim CveVendedor As Integer = -1
'Dim CveUsuarioTecnico As Integer = -1
'If UsuarioActual.CveRol = 1577 Then 'vendedor
' Opcion = 1
' CveVendedor = UsuarioActual.CveVendedor
' CveUsuarioTecnico = UsuarioActual.CveUsuario 'GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUsuarioTecnico", $"CveVendedor = {CveVendedor}").ToEntero
'ElseIf UsuarioActual.CveRol.Contiene(1639, 1573) Then ' rol admin. 1573
' Opcion = 2 'gerente ventas
'End If
divsms1.Visible = True
If UsuarioActual.CveRol = 1577 Then 'vendedor
Opcion = 1
CveVendedor = UsuarioActual.CveVendedor
CveUsuarioTecnico = UsuarioActual.CveUsuario 'GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUsuarioTecnico", $"CveVendedor = {CveVendedor}").ToEntero
ElseIf UsuarioActual.CveRol.Contiene(1639, 1573) Then ' rol admin. 1573
Opcion = 2 'gerente ventas
If UsuarioActual.CveUsuario = 3964 Then
DdlSMSOpciones.SelectedValue = "2"
DdlSMSVendedores.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltraParametros($"CveEstatus=1 ")
DdlSMSVendedores.DataBind()
End If
CargaKPICirugias(Opcion, CveVendedor, CveUsuarioTecnico)
If UsuarioActual.CveRol.Contiene(1639) Then 'gerente ventas
DdlSMSOpciones.SelectedValue = "2"
DdlSMSOpciones.Items.RemoveAt(4)
DdlSMSOpciones.Items.RemoveAt(3)
DdlSMSOpciones.Items.RemoveAt(2)
Dim CveGerenteVendedor As Integer = -1
If UsuarioActual.CveUsuario = 4419 Then CveGerenteVendedor = 1386 '; --' daniela
If UsuarioActual.CveUsuario = 4137 Then CveGerenteVendedor = 1172 '; --'jesus alvarez
DdlSMSVendedores.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltraParametros($"CveEstatus=1 and CveSuperior = {CveGerenteVendedor} ")
DdlSMSVendedores.DataBind()
End If
CargaSMSKPI()
End If
If (UsuarioActual.CveRol = 1062) Or (UsuarioActual.CveUsuario = 100) Then
@@ -1437,7 +1456,6 @@ Partial Class Inicio
RegistraScript("$('#DvUnoaUno').modal('hide')")
End Sub
#Region "DOCUMENTACION"
Private Sub CargaDocumentacion()
@@ -1494,19 +1512,12 @@ Partial Class Inicio
#End Region
Protected Sub LnkInconsistencias_Click1(sender As Object, e As EventArgs)
MuestraInconsistencias()
End Sub
Private Sub IniializaDdlsOpcionesAgenda()
'CLIENTES
DdlClientesWS.setEsWebService(True)
'PROVEEDORES
@@ -1523,14 +1534,8 @@ Partial Class Inicio
DdlPersonal.DataBind()
DdlPersonal.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
CargaDdlEmpresaCRM()
RBLAgendaOpcion_SelectedIndexChanged(Nothing, Nothing)
End Sub
Private Sub CargaDdlEmpresaCRM()
@@ -1614,7 +1619,7 @@ Partial Class Inicio
#Region "S M S - I N D I C A D O R E S"
Private Sub CargaKPICirugias(Opcion As Integer, Optional CveVendedor As Integer = -1, Optional CveUsuarioTecnico As Integer = -1)
Private Sub CargaKPICirugias(Opcion As Integer, Optional CveVendedor As Integer = -1, Optional CveUsuarioTecnico As Integer = -1, Optional CveGerenteVendedor As Integer = -1)
DivIndicadores.InnerHtml = ""
Dim dtIndicadores As DataTable = Nothing
@@ -1625,7 +1630,7 @@ Partial Class Inicio
Dim FechaI As Date = Now.FirstDayOfMonth
Dim FechaF As Date = Now.LastDayOfMonth
If Gral.GetSMSIndicadores(Opcion, FechaI, FechaF, UsuarioActual.CveUsuario, CveVendedor, CveUsuarioTecnico, UsuarioActual.CveEmpresa) Then
If Gral.GetSMSIndicadores(Opcion, FechaI, FechaF, UsuarioActual.CveUsuario, CveVendedor, CveGerenteVendedor, CveUsuarioTecnico, UsuarioActual.CveEmpresa) Then
ds = Gral.DataSetResultados
End If
'0-ventas totales, 1-comisiones totales, 2-medicos sin consumo, 3-top10medicos, 4-top5marcas, 5-num pacientes
@@ -2513,14 +2518,22 @@ Partial Class Inicio
#End Region
Protected Sub DdlSMSOpciones_SelectedIndexChanged(sender As Object, e As EventArgs)
Private Sub CargaSMSKPI(Optional CveGerente As Integer = -1)
If DdlSMSOpciones.SelectedValue = "1" Then
DdlSMSVendedores.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltraParametros("CveEstatus=1")
DdlSMSVendedores.DataBind()
DdlSMSVendedores.Visible = True
DdlSMSTecnico.Visible = False
Dim CveUsuarioTecnico As Integer = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUsuario", $"CveVendedor = {DdlSMSVendedores.SelectedValue}").ToEntero
CargaKPICirugias(DdlSMSOpciones.SelectedValue.ToEntero, DdlSMSVendedores.SelectedValue.ToEntero, CveUsuarioTecnico)
ElseIf DdlSMSOpciones.SelectedValue = "2" Then ' ROL DE GERENTE DE VENTAS
Dim CveGerenteVendedor As Integer = -1
If UsuarioActual.CveRol = 1639 Then
If UsuarioActual.CveUsuario = 4419 Then CveGerenteVendedor = 1386 ' daniela
If UsuarioActual.CveUsuario = 4137 Then CveGerenteVendedor = 1172 'jesus alvarez
End If
DdlSMSVendedores.Visible = False
CargaKPICirugias(DdlSMSOpciones.SelectedValue.ToEntero, CveGerenteVendedor:=CveGerenteVendedor)
ElseIf DdlSMSOpciones.SelectedValue = "4" Then
DdlSMSTecnico.DataSource = GlobalDTUsuarios(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveRol = 1582")
DdlSMSTecnico.DataBind()
@@ -2533,9 +2546,14 @@ Partial Class Inicio
DdlSMSTecnico.Visible = False
CargaKPICirugias(DdlSMSOpciones.SelectedValue.ToEntero)
End If
End Sub
Protected Sub DdlSMSOpciones_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaSMSKPI()
End Sub
Protected Sub DdlSMSVendedores_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim CveUsuarioTecnico As Integer = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUsuario", $"CveVendedor = {DdlSMSVendedores.SelectedValue}").ToEntero
CargaKPICirugias(DdlSMSOpciones.SelectedValue.ToEntero, DdlSMSVendedores.SelectedValue.ToEntero, CveUsuarioTecnico)

View File

@@ -29,16 +29,14 @@ Partial Class LogIn
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
'"187.158.96.163" es la de mi casa
'If (Context.Session("UsuarioSIG") IsNot Nothing) OrElse Not User.Identity.IsAuthenticated Then
'Request.Headers.Add("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJOb21icmUiOiJhZG1pbiIsIkN2ZVVzdWFyaW8iOiIyMDA5IiwiQ3ZlRW1wcmVzYSI6IjIiLCJDdmVQZXJmaWwiOiIyIiwiTWFpbCI6ImFkbWluQGFkbWluLmNvbSIsImV4cCI6MTU5NDY3MzQ2NCwiaXNzIjoiVGVzdC5jb20iLCJhdWQiOiJUZXN0LmNvbSJ9.vmPRxGfxzR10Rf-4Luk2Ej0SVs7w2XGDGJBCyx5VSQI")
'Response.AddHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJOb21icmUiOiJhZG1pbiIsIkN2ZVVzdWFyaW8iOiIyMDA5IiwiQ3ZlRW1wcmVzYSI6IjIiLCJDdmVQZXJmaWwiOiIyIiwiTWFpbCI6ImFkbWluQGFkbWluLmNvbSIsImV4cCI6MTU5NDY3MzQ2NCwiaXNzIjoiVGVzdC5jb20iLCJhdWQiOiJUZXN0LmNvbSJ9.vmPRxGfxzR10Rf-4Luk2Ej0SVs7w2XGDGJBCyx5VSQI")
'Response.End()
'End If
Dim iplist As String() = New String() {"", ""}
If HttpContext.Current.Request.ServerVariables("REMOTE_ADDR").ToString().Contiene(iplist) Then
Response.Redirect("http://www.adsistemas.mx/login.aspx") 'si alguien lo ve es correcto la pagina vieja de adsistemas
End If
'leer un txt para validar una ip
Dim token As String = GetTokenAngular()
If (token.Length > 0) Then
If Not IsNothing(Request("port")) Then
@@ -92,7 +90,22 @@ Partial Class LogIn
PnlLoginB.CssClass = "logincint login-form "
PnlContraB.CssClass = "logincint login-form "
lnkFavicon.Href = "/Imagenes/favicongps.ico"
Else
End If
Dim clientIp As String = (If(Request.ServerVariables("HTTP_X_FORWARDED_FOR"),
Request.ServerVariables("REMOTE_ADDR"))).Split(","c)(0).Trim()
' Ruta del archivo con las IP bloqueadas
Dim path As String = Server.MapPath("/Utilerias/IPBloqueadas.txt")
If System.IO.File.Exists(path) Then
' Leer el contenido del archivo y separarlo por ";"
Dim contenido As String = System.IO.File.ReadAllText(path)
Dim ipBloqueadas As String() = contenido.Split(";"c)
' Verificar si la IP está en la lista
If ipBloqueadas.Any(Function(ip) ip.Trim() = clientIp) Then
Alert(" this site can't be reached <br/><br/>refused to connect.<br/><br/>ERR_CONNECTION_REFUSED<br/><br/>", TipoMensaje.MsgError)
BtnLogIn.Visible = False
End If
End If
HdfImagenes.Value = strimg.ToString()

View File

@@ -1239,8 +1239,7 @@
<input type="text" id="TxtBusquedaAnticipos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaAnticipos','{0}')", GVAnticipos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaAnticipos','{0}')", GVAnticipos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<br />
</div>
<div class="row">
<div class="col-md-12" style="display: flex; justify-content: end; font-size: 16px; font-weight: bold;">
<span>Total: </span>

View File

@@ -520,7 +520,7 @@ Partial Class Ventas_PVCobranza
HdnVentaCondicionesPago.Value = GvRow.DataKey("CondicionesPago")
HdnPlazoCobranza.Value = GvRow.DataKey("PlazoCobranza")
If UsuarioActual.CveEmpresa.Contiene(189, 193, 195, 196, 197) AndAlso GvRow.DataKey("TipoDocto") = "Rem" Then
If UsuarioActual.CveEmpresa.Contiene(189, 193, 195, 196, 197) AndAlso GvRow.DataKey("TipoDocto").Contiene("Rem", "Ant") Then
DivAnticipo.Visible = True
ImgAntiPend.Visible = True
End If
@@ -2254,43 +2254,32 @@ Partial Class Ventas_PVCobranza
Protected Sub ImgAntiPend_Click(sender As Object, e As EventArgs)
Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero()
'If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
' If DdlTipoAmortizacionAnticipo.Items.FindByValue("4") Is Nothing Then
' DdlTipoAmortizacionAnticipo.Items.Insert(1, New ListItem("Pago con devolución", "4"))
' End If
' DdlTipoAmortizacionAnticipo.SelectedValueExist("4")
' DdlTipoRelacionAnticipo.SelectedValueExist("-1")
' divAmortizacionTipoRelacion.Visible = False
' DdlTipoAmortizacionAnticipo_SelectedIndexChanged(DdlTipoAmortizacionAnticipo, EventArgs.Empty)
'End If
VerificaCargaAnticipo()
UpAnticipos.Update()
RegistraScript("$('#DivAnticipos').modal();", "AE")
End Sub
Private Sub VerificaCargaAnticipo()
Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero()
Dim DbRowVenta As DataRow = Nothing
Dim ObjVentas As New ClsVentas
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then
DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("")
End If
ObjVentas.Dispose()
Dim tTipoDocto As String
If DbRowVenta IsNot Nothing Then
CveCliente = DbRowVenta("CveCliente").ToString().ToEntero()
CveVendedor = DbRowVenta("CveVendedor").ToString().ToEntero()
tTipoDocto = DbRowVenta("TipoDocto").ToString()
End If
If CveCliente > 0 Then
CargaAnticipos(CveCliente)
CargaAnticipos(CveCliente, tTipoDocto)
End If
UpAnticipos.Update()
RegistraScript("$('#DivAnticipos').modal();", "AE")
End Sub
Private Sub CargaAnticipos(CveCliente As Integer)
Private Sub CargaAnticipos(CveCliente As Integer, TipoDocto As String)
If CveCliente > 0 Then
Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente) Then
@@ -2298,48 +2287,34 @@ Partial Class Ventas_PVCobranza
End If
ObjMovtos.Dispose()
Dim TipoAnticipo As String = "'NC','IxC','Ant'"
If TipoDocto = "Ant" Then TipoAnticipo = " 'IxC' "
If Me.TmpDTAnticiposNCIxCCliente IsNot Nothing Then
GVAnticipos.DataSource = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"ISTotal = 0 AND Saldo > 0 AND Tipo IN('NC','IxC','Ant') ")
Else
GVAnticipos.DataSource = Nothing
GVAnticipos.DataSource = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"ISTotal = 0 AND Saldo > 0 AND Tipo IN ({TipoAnticipo}) ")
Else
GVAnticipos.DataSource = Nothing
End If
GVAnticipos.Columns(5).Visible = False
GVAnticipos.Columns(9).Visible = False
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
GVAnticipos.Columns(7).Visible = True
End If
GVAnticipos.DataBind()
If ListaAnticiposAplicados IsNot Nothing Then
ListaAnticiposAplicados.Clear()
End If
TxtNCDev.Text = "0.00"
End If
GVAnticipos.Columns(5).Visible = False
GVAnticipos.Columns(9).Visible = False
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
GVAnticipos.Columns(7).Visible = True
End If
GVAnticipos.DataBind()
If ListaAnticiposAplicados IsNot Nothing Then
ListaAnticiposAplicados.Clear()
End If
TxtNCDev.Text = "0.00"
End If
UpAnticipos.Update()
UpAnticipos.Update()
End Sub
Protected Sub LnkRecargaAnticipos_Click(sender As Object, e As EventArgs)
Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero()
If CveCliente <= 0 Then
Dim DbRowVenta As DataRow = Nothing
Dim ObjVentas As New ClsVentas
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
DbRowVenta = ObjVentas.DtResultados.Copy().FiltroPrimero("")
End If
ObjVentas.Dispose()
If DbRowVenta IsNot Nothing Then
CveCliente = DbRowVenta("CveCliente").ToString().ToEntero()
End If
End If
If CveCliente > 0 Then
CargaAnticipos(CveCliente)
End If
VerificaCargaAnticipo()
End Sub
Protected Sub LnkSolicitarActivarAnticipo_Click(sender As Object, e As EventArgs)