diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 69f64de00..2b82c5a1b 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -2410,7 +2410,7 @@ Public Class ClsGenerales Public Function GetHistorialBitacora(CveAcarreo As Integer, CveOrdenCompra As Integer, CveActivoFijo As Integer, CveOS As Integer, CvePS As Integer, CveCompra As Integer, CveIE As Integer, CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional CvePersonal As Integer = -1, - Optional IdPoliza As Integer = -1) As Boolean + Optional IdPoliza As Integer = -1, Optional CvePrePoliza As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Gral_HistorialBitacoraGet") @@ -2422,6 +2422,7 @@ Public Class ClsGenerales .Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CveCompra", SqlDbType.Int).Value = CveCompra .Add("@CveIE", SqlDbType.Int).Value = CveIE + .Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal diff --git a/App_Code/ClsMovimientos.vb b/App_Code/ClsMovimientos.vb index 845ac3d6b..836be534b 100644 --- a/App_Code/ClsMovimientos.vb +++ b/App_Code/ClsMovimientos.vb @@ -319,7 +319,7 @@ Public Class ClsMovimientos End Function Public Function GetCxCDetalle(FechaI As String, FechaF As String, CveCliente As Integer, CveSubProyecto As Integer, CveVendedor As Integer, CveUsuario As Integer, Anio As Integer, Mes As Integer, - AnioMes As String, Fecha As String, CveClienteSucursal As Integer, Opcion As String, CveEstatus As Integer, IVA As String, Agrupador As Integer, CveEmpresa As Integer, + AnioMes As String, Fecha As String, CveClienteSucursal As Integer, Opcion As String, CveEstatus As Integer, IVA As String, Agrupador As Integer, CveEmpresa As Integer, CveResponsable As Integer, TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional TipoDocto As String = "-1", Optional FechaVI As String = "-1", Optional FechaVF As String = "1", Optional FechaCorte As Date = Nothing, Optional CveUsuarioConsulta As Integer = -1, Optional CveCobranzaEstatus As Integer = -1, Optional CveClienteClasificacion As Integer = -1, Optional LimiteCredito As Decimal = -1, @@ -361,10 +361,10 @@ Public Class ClsMovimientos .Add("@CveCobranzaEstatus", SqlDbType.Int).Value = CveCobranzaEstatus .Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion .Add("@LimiteCredito", SqlDbType.Float).Value = LimiteCredito - .Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente - .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda - .Add("@EstatusCliente", SqlDbType.Int).Value = EstatusCliente - + .Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente + .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda + .Add("@EstatusCliente", SqlDbType.Int).Value = EstatusCliente + End With Try @@ -545,7 +545,7 @@ Public Class ClsMovimientos - Try + Try SqlAdapter.SelectCommand.CommandTimeout = 0 SqlAdapter.Fill(Data) @@ -863,8 +863,8 @@ Public Class ClsMovimientos DataAdapter("PA_Banc_ReporteChequesFYEGet") With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@FechaI", SqlDbType.DateTime).Value = FechaI + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@FechaI", SqlDbType.DateTime).Value = FechaI .Add("@FechaF", SqlDbType.DateTime).Value = FechaF End With @@ -1190,9 +1190,9 @@ Public Class ClsMovimientos Public Function GetCxPDetalle(FechaI As String, FechaF As String, CveProveedor As Integer, CveProveedorClasificacion As Integer, CveProveedorSucursal As Integer, CveUsuario As Integer, CveUsuarioResponsable As Integer, Anio As Integer, Mes As Integer, AnioMes As String, CveMoneda As Integer, CveSubProyecto As Integer, - CveEstatusFactura As Integer, Fecha As String, Agrupador As Integer, Opcion As String, CveEmpresa As Integer, CveSucursal As Integer, - TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional FechaVI As String = "-1", Optional FechaVF As String = "1", - Optional FechaCorte As Date = Nothing, Optional CveUsuarioConsulta As Integer = -1, Optional CveTipoProveedor As Integer = -1, + CveEstatusFactura As Integer, Fecha As String, Agrupador As Integer, Opcion As String, CveEmpresa As Integer, CveSucursal As Integer, + TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional FechaVI As String = "-1", Optional FechaVF As String = "1", + Optional FechaCorte As Date = Nothing, Optional CveUsuarioConsulta As Integer = -1, Optional CveTipoProveedor As Integer = -1, Optional Comprobaciones As Integer = -1, Optional AplicaNC As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -1292,8 +1292,8 @@ Public Class ClsMovimientos .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal .Add("@CveCajaChica", SqlDbType.Int).Value = CveCajaChica - .Add("@NumeroReembolso", SqlDbType.VarChar).Value = NumeroReembolso - .Add("@FechaI", SqlDbType.DateTime).Value = FechaI + .Add("@NumeroReembolso", SqlDbType.VarChar).Value = NumeroReembolso + .Add("@FechaI", SqlDbType.DateTime).Value = FechaI .Add("@FechaF", SqlDbType.DateTime).Value = FechaF End With diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index e124244e4..c8384b872 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3786,6 +3786,7 @@ Public Class ClsPaginas PaginaDict.Add("/Prospectos/PopUpBuscarProspectos.aspx".ToUpper(), -1) PaginaDict.Add("/Sistemas/PopUpCambiaUsuario.aspx".ToUpper(), -1) + PaginaDict.Add("/Sistemas/PopUpCambiaUsuarioEmpresa.aspx".ToUpper(), -1) PaginaDict.Add("/Sistemas/CatDistribuidores.aspx".ToUpper(), -1) PaginaDict.Add("/Sistemas/CatPlataformas.aspx".ToUpper(), -1) PaginaDict.Add("/Sistemas/PopUpAddUsuario.aspx".ToUpper(), -1) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 0ca3ae809..a654c7650 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -1620,7 +1620,7 @@ Public Class ClsVentas Public Function GetRepPSEcono(CveSubProyecto As Integer, CvePS As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1, Optional GPO As Integer = -1, Optional CveMoneda As Integer = -1, Optional TipoCambio As Integer = -1, Optional TCEspecifico As Double = 0, - Optional Clasificacion As String = "-1", Optional Linea As String = "-1", Optional Marca As String = "-1") As Boolean + Optional Clasificacion As String = "-1", Optional Linea As String = "-1", Optional Marca As String = "-1", Optional orden As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_RepPSEconoGet") @@ -1638,6 +1638,7 @@ Public Class ClsVentas .Add("@Clasificacion", SqlDbType.VarChar).Value = Clasificacion .Add("@Linea", SqlDbType.VarChar).Value = Linea .Add("@Marca", SqlDbType.VarChar).Value = Marca + .Add("@Orden", SqlDbType.VarChar).Value = orden End With Try diff --git a/App_Code/Usuario.vb b/App_Code/Usuario.vb index 76c8a15e6..3a6066805 100644 --- a/App_Code/Usuario.vb +++ b/App_Code/Usuario.vb @@ -71,6 +71,16 @@ Public Class Usuario End If End Get End Property + Private _modoSimulacionXEmpresa As Boolean = False + Public Property ModoSimulacionXEmpresa As Boolean + Get + Return Not ModoSimulacion AndAlso (_modoSimulacionXEmpresa OrElse TienePermisoProceso(308)) + End Get + Set(value As Boolean) + + _modoSimulacionXEmpresa = value + End Set + End Property Public Property Sesion(Campo As String) As String Get diff --git a/Contabilidad/RegPrePoliza.aspx b/Contabilidad/RegPrePoliza.aspx index 691ac28d4..734a5ec1a 100644 --- a/Contabilidad/RegPrePoliza.aspx +++ b/Contabilidad/RegPrePoliza.aspx @@ -497,6 +497,42 @@ + + +
+
+
+
+
+ + Historial de Modificación +
+
+
+
+
+
+
+ + + + Fecha + + + + + + + + + + +
+
+
+
+
+
- - + +
+ CssClass="table table-striped table-advance table-hover mysmallbtn ScrollAD Widthall GvNominas" Style="text-align: center;" GridLines="None" data-cols="2" data-rows="2" data-heighterror="360"> - + @@ -1558,7 +1558,7 @@ diff --git a/Scripts/custom.js b/Scripts/custom.js index f3852450c..b4bf8334b 100644 --- a/Scripts/custom.js +++ b/Scripts/custom.js @@ -76,6 +76,30 @@ function FiltrarTabla(idtxt, idtable, idcontador) { } } + +function FiltrarTablaFreezcol(idtxt, idtable, idcontador) { + if ($('' + idtxt).val() == '') { $('div.ADSCroll:not(.RHeader) table' + idtable + ' tr').css('display', ''); } + else { + let idxlist = []; + $('div.ADSCroll:not(.RHeader) table' + idtable + ' tr:contains("' + $('' + idtxt).val() + '")').each(function () { let idx = $(this).index(); idxlist.push(idx) }); + + idxlist = idxlist.filter((x, i, a) => a.indexOf(x) == i) + $('div.ADSCroll:not(.RHeader) table' + idtable + ' tr:not(.ADtr):not(.SearchADHeader):not(.ADSRow):not(.Titulos)').each(function () { + let _tthis = $(this); + let idx = _tthis.index(); + if (idxlist.includes(idx)) { + _tthis.css('display', ''); + } else { + _tthis.css('display', 'none'); + + } + }); + } + if ($('' + idcontador).length > 0) { + $('' + idcontador).html('(' + $('div.ADSCroll:not(.RHeader) ' + idtable + ' tr:not(.ADtr):not(.ADSRow):not(.SearchADHeader):visible').length + '/' + $('div.ADSCroll:not(.RHeader) ' + idtable + ' tr:not(.ADtr):not(.ADSRow):not(.SearchADHeader)').length + ')'); + } +} + function clonsbuttons() { var copiasdelete = $('.clonehbutton_copy'); if (copiasdelete) { @@ -321,8 +345,8 @@ function ADScroller2() { var widthGral = $(document).width() - WidthMenos; var heightGral = $(window).height() - HeightMenos; if (Heightfijo > 0) { heightGral = Heightfijo; } - if (widthGral < 100) { widthGral = 100; } - if (heightGral < 100) { heightGral = 100; } + if (widthGral < 300) { widthGral = 300; } + if (heightGral < 300) { heightGral =300; } widthGral = Tthis.parent().parent().width(); Tthis.removeClass('ADSCROLLER2'); @@ -420,7 +444,7 @@ function ADScroller2() { var anchoc1 = divheader1.outerWidth(); var altoc1 = divheader1.outerHeight() + 15; - divheaderScroll = $('
').append(THeader2); + divheaderScroll = $('
').append(THeader2); divheader2.append(divheaderScroll); contenedor.append(divcenter); @@ -459,24 +483,29 @@ function ADScroller2() { contenedor.css('width', sizetable + altoc1); } }; - $(window).resize(function () { + let resizefncscroller = function () { + var widthGral = $(window).width() - WidthMenos; /*console.log(widthGral);*/ contenedor.css('width', 1); widthGral = Tthis.parent().parent().parent().parent().parent().width(); /* console.log(widthGral);*/ var heightGral = $(window).height() - HeightMenos; + //console.log(heightGral); if (Heightfijo > 0) { heightGral = Heightfijo; } - if (widthGral < 100) { widthGral = 100; } - if (heightGral < 100) { heightGral = 100; } + if (widthGral < 300) { widthGral = 300; } + if (heightGral < 300) { heightGral = 300; } contenedor.css('width', widthGral); divheader.css('width', widthGral); divcenter.css('width', widthGral); divheaderScroll.css('width', (widthGral - anchoc1)); - divcolsScroll.css('height', (heightGral - altoc1+20)); + divcolsScroll.css('height', (heightGral - altoc1 + 20)); divbodyScroll.css('width', (widthGral - anchoc1)); divbodyScroll.css('height', (heightGral - altoc1 + 20)); - setTimeout(sizeoftablefunc, 100); + }; + $(window).resize(function () { + setTimeout(resizefncscroller, 50); + setTimeout(sizeoftablefunc, 150); }); $('table#ADCol' + Tid + ' tr').hover( @@ -731,12 +760,13 @@ function loadadscroll() { if (height < 200) { height = 200; } - TThis.data('height', height) + TThis.data('height', height); } //ADSCROLLER2 var colVisibles = isNaN(Number(TThis.data('cols'))) ? 0 : Number(TThis.data('cols')); if (colVisibles > 0) { + if ((Number(TThis.data('heighterror'))) && !(Number(TThis.data('heightmenos')))) { TThis.data('heightmenos', TThis.data('heighterror'));} TThis.removeClass("ScrollAD"); TThis.addClass("ADSCROLLER2"); } else { @@ -1913,7 +1943,6 @@ jQuery(document).ready(function () { } }); ADSReady(); - } if (("Notification" in window)) { if (Notification.permission !== 'denied') { diff --git a/Sistemas/PopUpCambiaUsuario.aspx b/Sistemas/PopUpCambiaUsuario.aspx index c75bb1c7a..2217ac9ff 100644 --- a/Sistemas/PopUpCambiaUsuario.aspx +++ b/Sistemas/PopUpCambiaUsuario.aspx @@ -26,7 +26,7 @@
- +
diff --git a/Sistemas/PopUpCambiaUsuarioEmpresa.aspx b/Sistemas/PopUpCambiaUsuarioEmpresa.aspx new file mode 100644 index 000000000..ba7eb290f --- /dev/null +++ b/Sistemas/PopUpCambiaUsuarioEmpresa.aspx @@ -0,0 +1,85 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpCambiaUsuarioEmpresa.aspx.vb" Inherits="Sistemas_PopUpCambiaUsuarioEmpresa" %> + + + + + + + + + + Cambio de Usuario + + + + + + + +

 Usuario Actual:  
+

+
+<%--
+
--%> +
Nombre de Usuario:
+
+ <%--
+
+ +
+
+
+
--%> + +
+
+
+
+ + + + + diff --git a/Sistemas/PopUpCambiaUsuarioEmpresa.aspx.vb b/Sistemas/PopUpCambiaUsuarioEmpresa.aspx.vb new file mode 100644 index 000000000..25c34bee9 --- /dev/null +++ b/Sistemas/PopUpCambiaUsuarioEmpresa.aspx.vb @@ -0,0 +1,187 @@ +Imports ADSSession +Imports Extensiones +Imports System.Data + +Partial Class Sistemas_PopUpCambiaUsuarioEmpresa + Inherits ClsPaginas + + Property DTUsuarios() As Data.DataTable + Get + Return CType(ViewState("DTUsuarios"), DataTable) + End Get + Set(value As Data.DataTable) + ViewState("DTUsuarios") = value + End Set + End Property + + + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + + ViewState("Orden") = "" + + If Not (UsuarioActual.CveRol = 1 OrElse UsuarioActual.ModoSimulacionXEmpresa) Then + PnlGral.Visible = False + RegistraScript("window.close();") + End If + + 'Dim DtEmp As DataTable = GlobalDTEmpresas.Copy + Dim NombreEmp As String = UsuarioActual.Empresa.Empresa + '''condición para ocultar los nombres de las empresas y ponerles "mi empresa de venta (xxx)" + ''If UsuarioActual.CveUsuario = 100 Then + + '' Dim customerRow() As Data.DataRow + '' customerRow = DtEmp.Select("") + + '' For Each drt As DataRow In customerRow + '' drt("Empresa") = "Mi Empresa de ventas (" & drt("CveEmpresa") & ")" + '' Next + + + ''End If + + CType(Me.Master, BaseMasterPage).EsPopup = True + LblUsuario.Text = String.Format("{0} - {1}", UsuarioActual.Nombre, UsuarioActual.Empresa.Empresa) + + + 'DdlEmpresa.DataSource = DtEmp '.FiltraParametros(If(UsuarioActual.CveRol = 1, "CvePlataforma IN (1,2)", $"CvePlataforma={UsuarioActual.Empresa.CvePlataforma}")) + Dim CveEmpresa As String = UsuarioActual.CveEmpresa.ToString() + + Dim splitedtext As String() = Request.Url.AbsoluteUri.Replace("http://", "").Replace("https://", "").Split("."c) + If Request.Url.AbsoluteUri.Contains("sig.agrojam.com.mx") Then + CveEmpresa = 119 + End If + + If splitedtext.Length > 0 Then + Select Case splitedtext(0).ToUpper() + Case "VSH" : CveEmpresa = "7" + Case "JAM" : CveEmpresa = "119" + Case "COMPUPROVEEDORES" : CveEmpresa = "72" + Case "DNDIFUSA" : CveEmpresa = "80" + Case "SOGO" : CveEmpresa = "8" + Case "BDH" : CveEmpresa = "140" + Case "ECONOLLANTAS" : CveEmpresa = "141" + End Select + End If + 'DdlEmpresa.DataBind() + 'DdlEmpresa.SelectedValue = CveEmpresa + + 'DdlRol.DataSource = GlobalDTRoles(DdlEmpresa.SelectedValue.ToEntero) + 'DdlRol.DataBind() + 'DdlRol.Items.Insert(0, New ListItem("Todos", "-1")) + + TxtBusqueda.Attributes.Add("data-table", gvUsuarios.ClientID) + + CargaUsuarios() + 'LblUsuario.Text = usuarioactual. + + End If + End Sub + + + Protected Sub gvUsuarios_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles gvUsuarios.RowCommand + If e.CommandName = "Usuarios" Then + Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow) + 'Dim Dt As DataTable = GlobalDTUsuarios(e.CommandArgument.ToString.ToEntero) + Dim multiempresa As Boolean = ADSSessionConfig.sessionUser.MultipleEmpresa + Dim objempresa As Empresa = ADSSessionConfig.sessionUser.Empresa + If gvr IsNot Nothing Then + + Dim tUsuario, tContraseña As String + Dim tCveEmpresa As Integer + tUsuario = gvr.DataKey("Usuario").ToString + tContraseña = gvr.DataKey("Contraseña").ToString + tCveEmpresa = gvr.DataKey("CveEmpresa").ToString.ToEntero + + Dim ObjUsuario As New ClsSisUsuarios + Dim Usuario As Usuario + 'Dim UsuarioAsignaciones As Usuario + + Usuario = ObjUsuario.ValidaUsuario(tUsuario, tContraseña, IMEI, tCveEmpresa) + 'UsuarioAsignaciones = ObjUsuario.ValidaUsuarioAsignacion(Usuario.CveUsuario, Usuario.CveEmpresa) + ObjUsuario.Dispose() + + If Usuario IsNot Nothing Then + Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario) + ADSSessionConfig.sessionUser = Usuario + ADSSessionConfig.sessionUser.CvePlataforma = 1 + If Usuario.CveRol = 1200 Then + ADSSessionConfig.sessionUser.CvePlataforma = 3 + End If + ADSSessionConfig.sessionDpage = False + ADSSessionConfig.sessionUser.MultipleEmpresa = multiempresa + ADSSessionConfig.sessionUser.ModoSimulacion = False + ADSSessionConfig.sessionUser.ModoSimulacionXEmpresa = True + + UsuarioActual.Empresa = objempresa + dt.Dispose() + + If UsuarioActual.CveCliente > 0 Then + CargaZonasHorarias(UsuarioActual) + End If + End If + + RegistraScript("gotourl();") + + End If + + End If + End Sub + Private Sub CargaZonasHorarias(ByRef UsuarioActual As Usuario) + Dim ObjClientes As New ClsClientes + Try + If ObjClientes.GetClientes(UsuarioActual.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=1) Then + If ObjClientes.DtResultados.Rows.Count = 1 Then + UsuarioActual.UTCOffset = ObjClientes.DtResultados(0)("UTCOffset").ToString().ToEntero() + End If + End If + Catch ex As Exception + OnError("Ocurrió un error al obtener la zona horaria.", ex) + Finally + ObjClientes.Dispose() + End Try + End Sub + + Protected Sub BtnFiltrar_Click(sender As Object, e As EventArgs) Handles BtnFiltrar.Click + CargaUsuarios() + End Sub + +#Region "O R D E N A M I E N T O" + Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs) + Dim Orden As String = "" + Dim Campo As String = "" + Dim Literal As Literal = Nothing + Const OrdenInicial As String = "" + Dim Arg(2) As String + + Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c) + Campo = Arg(0) + Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal) + + If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then + ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo) + Literal.Text = String.Format("") + Else + ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo) + Literal.Text = String.Format("") + End If + Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString + ViewState("Orden") = Orden + CargaUsuarios(Orden) + End Sub + + Private Sub CargaUsuarios(Optional Orden As String = "Nombre") + Dim dtt As DataTable = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros("CveRol <> 1") + dtt = dtt.FiltraParametros("Estatus = 1", Orden, {"CveUsuario", "Usuario", "Nombre", "Contraseña", "CveEmpresa", "Rol"}) + gvUsuarios.DataSource = dtt + gvUsuarios.DataBind() + + If (gvUsuarios.Rows.Count > 0) Then + gvUsuarios.UseAccessibleHeader = True + gvUsuarios.HeaderRow.TableSection = TableRowSection.TableHeader + End If + TxtBusqueda.Focus() + End Sub + +#End Region +End Class diff --git a/Site.master b/Site.master index ac198d1a4..5c6489dad 100644 --- a/Site.master +++ b/Site.master @@ -267,6 +267,7 @@