diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 911f89a07..4085f9b24 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -253,7 +253,7 @@ Public Class ClsContabilidad Public Function UpdatePrepolizasDetalle(CvePrePolizaDetalle As Integer, Concepto As String, CveSubProyecto As Integer, IdCtaContable As Integer, TipoMovto As Boolean, ImporteMN As Decimal, Optional CveTipoGasto As Integer = -1, Optional CveConceptoContable As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCompra As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveCliente As Integer = -1, Optional CveVenta As Integer = -1, - Optional Referencia As String = "-1") As Boolean + Optional Referencia As String = "-1", Optional CveUsuarioModifico As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -274,6 +274,7 @@ Public Class ClsContabilidad .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal .Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico End With Try @@ -1360,7 +1361,7 @@ Public Class ClsContabilidad End If If Not OcurrioError Then - If Not UpdatePrePoliza(Fecha, ObjConta.Folio, CveTipoPoliza, tIdPoliza, CvePrePoliza, Empresa.CveEmpresa) Then + If Not UpdatePrePoliza(Fecha, ObjConta.Folio, CveTipoPoliza, tIdPoliza, CvePrePoliza, Empresa.CveEmpresa, CveUsuarioModifico:=CveUsuario) Then OcurrioError = True End If End If @@ -1506,7 +1507,8 @@ Public Class ClsContabilidad End Function - Public Function UpdatePrePoliza(FechaConta As Date, FolioPoliza As Integer, CveTipoPoliza As Integer, IdPoliza As Integer, CvePrePoliza As Integer, CveEmpresa As Integer, Optional Concepto As String = "-1", Optional FechaPoliza As Date = MinFecha, Optional xxx As Integer = -1) As Boolean + Public Function UpdatePrePoliza(FechaConta As Date, FolioPoliza As Integer, CveTipoPoliza As Integer, IdPoliza As Integer, CvePrePoliza As Integer, CveEmpresa As Integer, + Optional Concepto As String = "-1", Optional FechaPoliza As Date = MinFecha, Optional xxx As Integer = -1, Optional CveUsuarioModifico As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -1521,6 +1523,7 @@ Public Class ClsContabilidad .Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza .Add("@Concepto", SqlDbType.VarChar).Value = Concepto .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico End With Try 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/Compras/Compras.aspx b/Compras/Compras.aspx index 4afd58c6e..2edbabca2 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -37,9 +37,6 @@
  • Agregar Otros Gastos
  • -
  • - Gastos y Servicios -
  • Costo Indirecto/Importaciones
  • @@ -147,6 +144,17 @@ border: 1px solid black; width: 85%; } + + .GastoIndirectoOpciones { + margin-left:auto; + margin-right:auto; + width:400px; + } + + .GastoIndirectoOpciones td + { + text-align:right /* Or any other value */ + } /*IPP*/ @@ -477,6 +485,7 @@ + @@ -3296,195 +3305,6 @@ - <%--MODAL VINCULAR FLETES Y SERVICIOS--%> - - - - - - <%-- MODAL SERIE-LOTE ALMACEN --%> + + + + diff --git a/Inventarios/TrasladoSolicitud.aspx.vb b/Inventarios/TrasladoSolicitud.aspx.vb index 85eec4810..13286849f 100644 --- a/Inventarios/TrasladoSolicitud.aspx.vb +++ b/Inventarios/TrasladoSolicitud.aspx.vb @@ -36,19 +36,19 @@ Partial Class Inventarios_TrasladoSolicitud ViewState("CveDireccionEnvio") = value End Set End Property - 'Private Property CveUsuarioAutoriza As Integer - ' Get - ' If ViewState("CveUsuarioAutoriza") Is Nothing Then - ' Return -1 - ' Else - ' Return CType(ViewState("CveUsuarioAutoriza"), Integer) - ' End If + Private Property CveUsuarioSolicita As Integer + Get + If ViewState("CveUsuarioSolicita") Is Nothing Then + Return -1 + Else + Return CType(ViewState("CveUsuarioSolicita"), Integer) + End If - ' End Get - ' Set(value As Integer) - ' ViewState("CveUsuarioAutoriza") = value - ' End Set - 'End Property + End Get + Set(value As Integer) + ViewState("CveUsuarioSolicita") = value + End Set + End Property #End Region @@ -178,6 +178,8 @@ Partial Class Inventarios_TrasladoSolicitud HplContrato.Text = ObjInventarios.DtResultados.Rows(0)("DescripcionContrato").ToString HplContrato.NavigateUrl = $"/Contratos/Contrato.aspx?CveContrato={ObjInventarios.DtResultados.Rows(0)("CveContrato").ToString.ToEntero}" + CveUsuarioSolicita = ObjInventarios.DtResultados.Rows(0)("CveUsuario").ToString.ToEntero + '25/04/2018 CveDireccionEnvio = ObjInventarios.DtResultados.Rows(0)("CveDireccionEnvio").ToString.ToEntero If CveDireccionEnvio > 0 And ObjClientes.DireccionEnvioGet(CveDireccionEnvio, -1, -1) Then @@ -994,15 +996,85 @@ Partial Class Inventarios_TrasladoSolicitud CargaDatos() End Sub + Protected Sub LnkRechazarTraslado_Click(sender As Object, e As EventArgs) + TxtMotivoRechazo.Text = "" + UpModalRechazo.Update() + RegistraScript("$('#ModalRechazarTraslado').modal();") + + End Sub + + + Protected Sub BtnModalRechazo_Click(sender As Object, e As EventArgs) + RechazarTraslado() + End Sub + + Private Sub RechazarTraslado() + + Dim ErrorProceso As Boolean = False + + If TxtMotivoRechazo.Text.Trim.Length.ToEntero = 0 Then + Alert("El motivo de rechazo es necesario", TipoMensaje.MsgAdvertencia) + End If + + Dim ObjInven As New ClsInventarios + If ObjInven.UpdateTrasladoAutorizar(CveTraspasoSolicitud, UsuarioActual.CveEmpresa, 3, UsuarioActual.CveUsuario, Now) Then Alert("Rechazado correctamente.") + ErrorProceso = False + Else + ErrorProceso = True End If + ObjInven.Dispose() - CargaDatos() + If Not ErrorProceso Then + MandaCorreoRechazo(LbFolio.Text.ToEntero, CveTraspasoSolicitud, CveUsuarioSolicita, TxtMotivoRechazo.Text) + CargaDatos() + RegistraScript("$('#ModalRechazarTraslado').modal('hide');") + End If + + End Sub + + + Private Sub MandaCorreoRechazo(Folio As Integer, CveTraspasoSolicitud As Integer, CveUsuarioSolicita As Integer, MotivoRechazo As String) + + Dim SB As New StringBuilder + + Dim CorreoDestino As String = GlobalDTUsuarios(CveUsuarioSolicita)(0)("Correo").ToString.Trim + + + If CorreoDestino.Length > 0 Then + + + SB.AppendLine($"

    Se ha rechazado la solicitud de traspaso con folio {Folio}, el traspaso fue rechazado por el usuario {UsuarioActual.Nombre }, el traspaso fue rechazado por el motivo: {MotivoRechazo}

    ") + + + + SB.AppendLine("
    ") + SB.AppendLine("") + SB.AppendLine("") + + For Each GvRow As GridViewRow In GvDatos.Rows + + If GvRow.RowType = DataControlRowType.DataRow Then + SB.AppendLine($"") + End If + + Next + SB.AppendLine("
    Cantidad U.M. Producto Observaciones
    {GvRow.DataKey("Cantidad")} {GvRow.DataKey("UnidadMedida")} {GvRow.DataKey("CodigoPS")} {GvRow.DataKey("Observaciones")}
    ") + SB.AppendLine("
    ") + + SB.AppendLine($" Ir a solicitud de traspaso folio {Folio}") + + + + Dim MandaCorre As New ClsSisMail + MandaCorre.SendMail(ClsPaginas.EmpresaNotificaciones, CorreoDestino, $"Rechazo de Autorización de traspaso #{Folio}", SB.ToString, Displayname:="SIG Notificaciones: Rechazo de Traspaso") + + End If End Sub @@ -1057,5 +1129,6 @@ Partial Class Inventarios_TrasladoSolicitud Next GvDatos.Columns(5).Visible = Mostrar End Sub + End Class diff --git a/Inventarios/TraspasoAlmacen.aspx b/Inventarios/TraspasoAlmacen.aspx index 392b44f2c..b347d8638 100644 --- a/Inventarios/TraspasoAlmacen.aspx +++ b/Inventarios/TraspasoAlmacen.aspx @@ -164,7 +164,7 @@ -
    + 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/OC/RepSolicitudesAnticipo.aspx b/OC/RepSolicitudesAnticipo.aspx index 1cb414460..4c03a5549 100644 --- a/OC/RepSolicitudesAnticipo.aspx +++ b/OC/RepSolicitudesAnticipo.aspx @@ -117,6 +117,11 @@ + + + + + diff --git a/OC/RepSolicitudesAnticipo.aspx.cs b/OC/RepSolicitudesAnticipo.aspx.cs index 265ea97ca..ae72827e5 100644 --- a/OC/RepSolicitudesAnticipo.aspx.cs +++ b/OC/RepSolicitudesAnticipo.aspx.cs @@ -110,13 +110,13 @@ public partial class OC_RepSolicitudesAnticipo : ClsPaginas { GvSolicitudes.Columns[4].Visible = true; GvSolicitudes.Columns[5].Visible = true; - GvSolicitudes.Columns[6].Visible = false; + GvSolicitudes.Columns[7].Visible = false; } else { GvSolicitudes.Columns[4].Visible = false; GvSolicitudes.Columns[5].Visible = false; - GvSolicitudes.Columns[6].Visible = true; + GvSolicitudes.Columns[7].Visible = true; } CargaDatos(); } diff --git a/PyME/Contabilidad/RegPrePoliza.aspx.vb b/PyME/Contabilidad/RegPrePoliza.aspx.vb index 965384706..43da76101 100644 --- a/PyME/Contabilidad/RegPrePoliza.aspx.vb +++ b/PyME/Contabilidad/RegPrePoliza.aspx.vb @@ -478,7 +478,7 @@ Partial Class Contabilidad_RegPrePoliza For Each row As GridViewRow In GvPrePoliza.Rows If Not ObjContabilidad.UpdatePrepolizasDetalle(row.DataKey("CvePrePolizaDetalle").ToEntero, row.FCTextBox("TxtConcepto").Text, row.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, row.FCDropDownList("DdlCtaContable").SelectedValue.ToEntero, If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCTextBox("TxtCargo").Text.ToDecimal <> 0, - row.FCTextBox("TxtCargo").Text.ToDecimal, row.FCTextBox("TxtAbono").Text.ToDecimal)) Then + row.FCTextBox("TxtCargo").Text.ToDecimal, row.FCTextBox("TxtAbono").Text.ToDecimal), CveUsuarioModifico:=UsuarioActual.CveUsuario) Then OcurrioError = True End If Next 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 @@