This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2020-09-22 20:15:50 -07:00
parent e1c02482fc
commit bc7143a261
13 changed files with 389 additions and 26 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -253,19 +253,19 @@
</div>
</div>
<div style="float: right;">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="FiltrarTabla('#TxtBusqueda','.GvNominas')" style="display: inline-block; margin-right: -20px; width: 150px;">
<a href="javascript:;" onclick="FiltrarTabla('#TxtBusqueda','.GvNominas')" style="margin-top: -3px;" class="btn btn-circle btn-sm font-bold yellow-gold"><i class="icon-magnifier" style="font-weight: bold;"></i></a>
<asp:TextBox CssClass="TxtBusqueda form-control input-sm" runat="server" onkeyup="FiltrarTablaFreezcol('.TxtBusqueda','.GvNominas')" Style="display: inline-block; margin-right: -20px; width: 150px;"></asp:TextBox>
<a href="javascript:;" onclick="FiltrarTablaFreezcol('.TxtBusqueda','.GvNominas')" style="margin-top: -3px;" class="btn btn-circle btn-sm font-bold yellow-gold"><i class="icon-magnifier" style="font-weight: bold;"></i></a>
</div>
</div>
<div class="portlet-body nomarginleftright form-horizontal form-row-sepe formnombottom ">
<asp:GridView ID="GvNominas" runat="server" DataKeyNames="CvePeriodo,CvePersonal,CveNomina,SeTimbro,SerieFolio,Nombre,Correo,Codigo,Turno,SubProyecto,NomAutorizado" AutoGenerateColumns="False" OnRowDataBound="GvNominas_RowDataBound"
CssClass="table table-striped table-advance table-hover mysmallbtn ScrollAD Widthall GvNominas" Style="text-align: center;" GridLines="None" data-cols="2" data-rows="2">
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">
<Columns>
<asp:TemplateField>
<HeaderTemplate></HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="LnkSobreRecibo" OnClick="LnkSobreRecibo_Click" runat="server"><i class='fa fa-list-alt'></i></asp:LinkButton>
<asp:LinkButton ID="LnkSobreRecibo" OnClick="LnkSobreRecibo_Click" runat="server"><i class='fa fa-list-alt'></i></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="20px" HorizontalAlign="Left" />
</asp:TemplateField>
@@ -1558,7 +1558,7 @@
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script>
function shownew() {
setTimeout(function () {
@@ -1626,6 +1626,7 @@
<%= String.Format("$('#{0}').click();", btnasis.ClientID) %>
}
function ADSBegin() {
debugger;
if ($('.GvConceptos .thTituloConcepto').length == 0) {
$('.GvConceptos').prepend("<tr class=\"thTituloConcepto\"> <th scope=\"col\" colspan=\"3\">Percepciones</th><th scope=\"col\" colspan=\"3\">Deducciones</th> </tr>");
}
@@ -1635,12 +1636,11 @@
//$('.GvConceptossimulador').append($('#Totalesperdeduccion'));
$('.GvConceptossimulador').append($('#trnetoapagar'));
}
function FiltrarTabla(idtxt, idtable, idcontador) {
if ($('' + idtxt).val() == '') { $('table' + idtable + ' tr').css('display', ''); }
else { $('table' + idtable + ' tr:not(.ADtr):not(.SearchADHeader):not(.Titulos)').css('display', 'none'); $('table' + idtable + ' tr:contains("' + $('' + idtxt).val() + '")').css('display', ''); }
if ($('' + idcontador).length > 0) {
$('' + idcontador).html('(' + $('' + idtable + ' tr:not(.ADtr):not(.SearchADHeader):visible').length + '/' + $('' + idtable + ' tr:not(.ADtr):not(.SearchADHeader)').length + ')');
}
function ADSReady() {
setTimeout(function () { FiltrarTablaFreezcol('.TxtBusqueda', '.GvNominas');}, 250);
}
</script>
</asp:Content>

View File

@@ -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 = $('<div class="ADSCroll" style="width:' + (widthGral - anchoc1) + 'px;"></div>').append(THeader2);
divheaderScroll = $('<div class="ADSCroll RHeader" style="width:' + (widthGral - anchoc1) + 'px;"></div>').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') {

View File

@@ -26,7 +26,7 @@
<asp:DropDownList ID="DdlEmpresa" runat="server" AutoPostBack="true" DataTextField="Empresa" DataValueField="CveEmpresa" style="width:100%;" Class="form-control select2me"></asp:DropDownList>
</div>
<div class="has-info col-sm-6">
<asp:TextBox id="TxtBusqueda" CssClass="form-control input-sm" placeholder="" style="width:100%" runat="server" ClientIDMode="Static"/></label>
<asp:TextBox id="TxtBusqueda" CssClass="form-control input-sm" placeholder="" style="width:100%" runat="server" ClientIDMode="Static"/>
<asp:Button ID="BtnFiltrar" runat="server" Text="Filtrar" class="btn btn-primary" style="display: none;"/>
</div>
</div>

View File

@@ -0,0 +1,85 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpCambiaUsuarioEmpresa.aspx.vb" Inherits="Sistemas_PopUpCambiaUsuarioEmpresa" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
<link href="/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Cambio de Usuario
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:Panel ID="PnlGral" runat="server">
<asp:UpdatePanel ID="UPPGral" runat="server">
<ContentTemplate>
<h4>&nbsp;Usuario Actual:&nbsp;&nbsp;<asp:Label ID="LblUsuario" runat="server" Text="" Font-Bold="True"></asp:Label><br />
</h4>
<div class="row">
<%-- <div class="col-sm-6">
<asp:Label AssociatedControlID="DdlEmpresa" runat="server" Text="Empresa:"></asp:Label></div>--%>
<div class="col-sm-6">Nombre de Usuario:</div>
</div>
<%--<div class="row">
<div class="col-sm-6">
<asp:DropDownList ID="DdlEmpresa" runat="server" AutoPostBack="true" DataTextField="Empresa" DataValueField="CveEmpresa" style="width:100%;" Class="form-control select2me"></asp:DropDownList>
</div>
<div class="has-info col-sm-6">
</div>
</div>--%>
<asp:TextBox ID="TxtBusqueda" CssClass="form-control input-sm" placeholder="" Style="width: 100%" runat="server" ClientIDMode="Static" />
<asp:Button ID="BtnFiltrar" runat="server" Text="Filtrar" class="btn btn-primary" Style="display: none;" />
<div>
<asp:GridView ID="gvUsuarios" runat="server" data-sort="true" CssClass="table table-striped table-advance table-hover Widthall ScrollAD " AutoGenerateColumns="False" ClientIDMode="Static" DataKeyNames="Usuario,Contraseña,CveEmpresa" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Nombre">
<ItemTemplate>
&nbsp;
<asp:LinkButton ID="LnkNombre" runat="server" CssClass="Texto"
Text='<%#String.Format("{0}({1})", Eval("Nombre"), Eval("Usuario")) %>' ToolTip='<%# Eval("CveUsuario") %>' CommandName="Usuarios" CommandArgument='<%# eval("CveUsuario") %>'></asp:LinkButton>
</ItemTemplate>
<%-- <ItemStyle Width="250px" />
<HeaderStyle CssClass="Titulo" HorizontalAlign="Center" />--%>
</asp:TemplateField>
<asp:BoundField DataField="Rol" HeaderText="Rol" DataFormatString="&nbsp;{0}">
<ItemStyle HorizontalAlign="Left" Width="150px" />
</asp:BoundField>
</Columns>
<%-- <RowStyle CssClass="Texto" Height="19px" />
<HeaderStyle CssClass="Titulo" />
<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
jQuery(document).ready(function () {
buscarDT();
Sys.Application.add_load(function (s, e) {
buscarDT();
});
});
function buscarDT() {
$('#TxtBusqueda').on('keyup', function () {
if (this.value == '') {
$('table#' + $(this).attr('data-table') + ' tr').css('display', 'table-row');
} else {
$('table#' + $(this).attr('data-table') + ' tr').css('display', 'none');
$('table#' + $(this).attr('data-table') + ' tr:contains("' + this.value + '")').css('display', 'table-row');
}
});
}
</script>
</asp:Content>

View File

@@ -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("<i class='fa fa-sort-asc' style='color:#999' ></i>")
Else
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
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

View File

@@ -267,6 +267,7 @@
<i class="fa fa-angle-down"></i>
</a>
<ul class="dropdown-menu dropdown-menu-default">
<li runat="server" id="DivCambiarUsuarioEmpresa" visible="false"><a runat="server" id="BtnCambiarUsuarioEmpresa" style="cursor: pointer;"><i class="fa fa-exchange"></i>Cambiar Usuario</a></li>
<li runat="server" id="DivCambiarUsuario" visible="false"><a runat="server" id="BtnCambiarUsuario" style="cursor: pointer;"><i class="fa fa-exchange"></i>Cambiar Usuario</a></li>
<li runat="server" id="DivCambiarEmpresa" visible="false"><a runat="server" id="BtnCambiarEmpresa" style="cursor: pointer;"><i class="fa fa-exchange"></i>Cambiar Empresa</a></li>
<li class="divider"></li>

View File

@@ -168,6 +168,10 @@ Partial Class Site
DivCambiarUsuario.Visible = True
BtnCambiarUsuario.Attributes.Add("onclick", "javascript:AbrirVentana('/Sistemas/PopUpCambiaUsuario.aspx');")
End If
If UsuarioActual.ModoSimulacionXEmpresa Then '.TienePermisoProceso(ADSSession.ADSSessionConfig.procesomodosimulacion) Then
DivCambiarUsuarioEmpresa.Visible = True
BtnCambiarUsuarioEmpresa.Attributes.Add("onclick", "javascript:AbrirVentana('/Sistemas/PopUpCambiaUsuarioEmpresa.aspx');")
End If
If UsuarioActual.MultipleEmpresa Then
BtnCambiarEmpresa.Attributes.Add("onclick", "javascript:AbrirVentana('/Sistemas/PopUpSeleccionarEmpresa.aspx');")
DivCambiarEmpresa.Visible = True

View File

@@ -159,6 +159,28 @@
</div>
<asp:Panel ID="pnlOrden" Visible="false" runat="server" CssClass="row">
<label class="col-md-1 truncate">Orden:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlOrden" runat="server" CssClass="select2me" Width="100%">
<asp:ListItem Text="Seleccione" Value="-1" Selected="True" />
<asp:ListItem Text="Marca,Modelo,Rin,Medida de Barrenación" Value="1" />
<asp:ListItem Text="Familia,Marca,Rin,Medida de Barrenación" Value="2" />
<asp:ListItem Text="Familia,Linea,Rin,Medida de Barrenación" Value="3" />
</asp:DropDownList>
</div>
<%--<div class="col-md-3">
<div class="row">
<label class="col-md-3 truncate">Marca:</label>
<div class="col-md-9">
<asp:ListBox ID="DdlMarca" runat="server" DataTextField="Marca" DataValueField="CveMarca" data-text="Todos" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%; height:50px !important;">
<asp:ListItem Text="Todas" Value="-1"></asp:ListItem>
</asp:ListBox>
</div>
</div>
</div>--%>
</asp:Panel>
</div>
</div>
</ContentTemplate>

View File

@@ -21,6 +21,20 @@ Partial Class Ventas_RepPS
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
pnlOrden.Visible = False
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
pnlOrden.Visible = True
DdlOrden.SelectedValue = "2"
'Using ObjPS As New ClsProductosServicios
' If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then
' DdlMarca.DataSource = ObjPS.DtResultados.Copy()
' End If
'End Using
'DdlMarca.DataBind()
'DdlMarca.Items.Insert(0, New ListItem("Todos", "-1"))
End If
CargaDatosIniciales()
CargaCombos()
CargaDatos()
@@ -69,6 +83,7 @@ Partial Class Ventas_RepPS
End Sub
Private Sub CargaTipoCentroCosto()
Dim index As Integer = 17
If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then
DdlSubProyecto.Items.Clear()
@@ -88,13 +103,19 @@ Partial Class Ventas_RepPS
ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 3 Then
DdlGrupo.Items.Insert(0, New ListItem("Proyecto", "1"))
DdlGrupo.Items.Insert(1, New ListItem("SubProyecto", "2"))
DdlGrupo.Items.Insert(17, New ListItem("SubProyecto Ejec.", "19"))
If DdlGrupo.Items.Count < 17 Then
index = DdlGrupo.Items.Count
End If
DdlGrupo.Items.Insert(index, New ListItem("SubProyecto Ejec.", "19"))
DdlGrupo.DataBind()
ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 4 Then
LblSubProyecto.InnerText = "Proyecto:"
DdlGrupo.Items.Insert(0, New ListItem("Proyecto", "1"))
DdlGrupo.Items.Insert(1, New ListItem("SubProyecto", "2"))
DdlGrupo.Items.Insert(17, New ListItem("SubProyecto Ejec.", "19"))
If DdlGrupo.Items.Count < 17 Then
index = DdlGrupo.Items.Count
End If
DdlGrupo.Items.Insert(index, New ListItem("SubProyecto Ejec.", "19"))
DdlGrupo.DataBind()
ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 5 Then
LblSubProyecto.InnerText = "Sucursal:"
@@ -117,7 +138,7 @@ Partial Class Ventas_RepPS
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.ToDate, MaxFecha)
Dim ObjVentas As New ClsVentas()
If ObjVentas.GetRepPSEcono(CveSubProyecto, CvePS, FechaI, FechaF, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, GPO:=Grupo, CveMoneda:=CveMoneda, TipoCambio:=TC, TCEspecifico:=TCEspecifico, Clasificacion:=Clasificacion, Linea:=Linea, Marca:=Marca) Then
If ObjVentas.GetRepPSEcono(CveSubProyecto, CvePS, FechaI, FechaF, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, GPO:=Grupo, CveMoneda:=CveMoneda, TipoCambio:=TC, TCEspecifico:=TCEspecifico, Clasificacion:=Clasificacion, Linea:=Linea, Marca:=Marca, orden:=DdlOrden.SelectedValue.ToEntero()) Then
DtReporte = ObjVentas.DtResultados.Copy()
GvDatos.DataSource = DtReporte
Else

View File

@@ -108,6 +108,8 @@