GDiaz 2024.05.21

This commit is contained in:
rakcsle
2024-05-28 10:57:45 -07:00
parent 33ebe369fc
commit 511bd45cca
5 changed files with 167 additions and 81 deletions

View File

@@ -1,75 +1,75 @@
Option Strict Off
Imports System.Collections.Concurrent
Imports Extensiones
Imports Microsoft.AspNet.SignalR
Public Enum TipoNotificacion As Integer
ToastInformacion = 5 'succes
ToastInformacionB = 6 'info
ToastError = 7 'error
ToastAdventencia = 8 'Warning
AlertaVentana = 2
AlertaVentanaNoOcultar = 1
End Enum
Public Class Notificaciones
Option Strict Off
Imports System.Collections.Concurrent
Imports Extensiones
Imports Microsoft.AspNet.SignalR
Public Enum TipoNotificacion As Integer
ToastInformacion = 5 'succes
ToastInformacionB = 6 'info
ToastError = 7 'error
ToastAdventencia = 8 'Warning
AlertaVentana = 2
AlertaVentanaNoOcultar = 1
End Enum
Public Class Notificaciones
Inherits Hub
Public Shared UsuariosConexiones As ConcurrentDictionary(Of String, String) = New ConcurrentDictionary(Of String, String)
Public Shared UsuariosConexiones As ConcurrentDictionary(Of String, String) = New ConcurrentDictionary(Of String, String)
Public Overrides Function OnConnected() As System.Threading.Tasks.Task
NotificarConexion()
Return MyBase.OnConnected()
End Function
Public Overrides Function OnReconnected() As System.Threading.Tasks.Task
NotificarConexion()
Return MyBase.OnReconnected()
End Function
Public Overrides Function OnDisconnected(stopCalled As Boolean) As Threading.Tasks.Task
Return MyBase.OnDisconnected(stopCalled)
NotificarConexion()
Return MyBase.OnConnected()
End Function
Public Sub NotificarConexion()
If Context.User.Identity.IsAuthenticated Then
Dim ConnectionId As String = Context.ConnectionId
Dim CveUsuario As String = Context.User.Identity.Name
If UsuariosConexiones.ContainsKey(CveUsuario) Then
If UsuariosConexiones(CveUsuario) <> Context.ConnectionId Then
UsuariosConexiones.TryUpdate(CveUsuario, Context.ConnectionId, UsuariosConexiones(CveUsuario))
End If
Else
If CveUsuario.ToEntero > 0 Then
UsuariosConexiones.TryAdd(CveUsuario, ConnectionId)
End If
End If
End If
Public Overrides Function OnReconnected() As System.Threading.Tasks.Task
NotificarConexion()
Return MyBase.OnReconnected()
End Function
Public Overrides Function OnDisconnected(stopCalled As Boolean) As Threading.Tasks.Task
Return MyBase.OnDisconnected(stopCalled)
End Function
Public Sub NotificarConexion()
If Context.User.Identity.IsAuthenticated Then
Dim ConnectionId As String = Context.ConnectionId
Dim CveUsuario As String = Context.User.Identity.Name
If UsuariosConexiones.ContainsKey(CveUsuario) Then
If UsuariosConexiones(CveUsuario) <> Context.ConnectionId Then
UsuariosConexiones.TryUpdate(CveUsuario, Context.ConnectionId, UsuariosConexiones(CveUsuario))
End If
Else
If CveUsuario.ToEntero > 0 Then
UsuariosConexiones.TryAdd(CveUsuario, ConnectionId)
End If
End If
End If
End Sub
Public Sub TestMessage(message As String)
Clients.All.testMessage(message)
End Sub
Public Sub AlertaVentana(Message As String, Para As String, Optional Titulo As String = "", Optional timeoutseconds As Integer = 5, Optional Tipo As TipoNotificacion = TipoNotificacion.AlertaVentanaNoOcultar)
Dim lPara As New List(Of String)
lPara.Add(Para)
AlertaVentana(Message, lPara, Titulo, timeoutseconds, Tipo)
End Sub
Public Sub AlertaVentana(Message As String, Para As List(Of String), Optional Titulo As String = "", Optional timeoutseconds As Integer = 5, Optional Tipo As TipoNotificacion = TipoNotificacion.AlertaVentanaNoOcultar)
If (Para IsNot Nothing) AndAlso Para.Count > 0 Then
Dim Clients As Hubs.IHubConnectionContext(Of Object) = GlobalHost.ConnectionManager.GetHubContext(Of Notificaciones)().Clients
Clients.Users(Para).AlertaVentana(Titulo, Message, DirectCast(Tipo, Integer), timeoutseconds)
End If
End Sub
End Class
Public Class MyhubUserIdProvider
Implements IUserIdProvider
Private Function IUserIdProvider_GetUserId(request As IRequest) As String Implements IUserIdProvider.GetUserId
Dim userId = Decripta(request.User.Identity.Name) 'MyCustomUserClass.FindUserId(request.User.Identity.Name)
Return userId.ToString()
End Function
End Class
Public Sub TestMessage(message As String)
Clients.All.testMessage(message)
End Sub
Public Sub AlertaVentana(Message As String, Para As String, Optional Titulo As String = "", Optional timeoutseconds As Integer = 5, Optional Tipo As TipoNotificacion = TipoNotificacion.AlertaVentanaNoOcultar)
Dim lPara As New List(Of String)
lPara.Add(Para)
AlertaVentana(Message, lPara, Titulo, timeoutseconds, Tipo)
End Sub
Public Sub AlertaVentana(Message As String, Para As List(Of String), Optional Titulo As String = "", Optional timeoutseconds As Integer = 5, Optional Tipo As TipoNotificacion = TipoNotificacion.AlertaVentanaNoOcultar)
If (Para IsNot Nothing) AndAlso Para.Count > 0 Then
Dim Clients As Hubs.IHubConnectionContext(Of Object) = GlobalHost.ConnectionManager.GetHubContext(Of Notificaciones)().Clients
Clients.Users(Para).AlertaVentana(Titulo, Message, DirectCast(Tipo, Integer), timeoutseconds)
End If
End Sub
End Class
Public Class MyhubUserIdProvider
Implements IUserIdProvider
Private Function IUserIdProvider_GetUserId(request As IRequest) As String Implements IUserIdProvider.GetUserId
Dim userId = Decripta(request.User.Identity.Name) 'MyCustomUserClass.FindUserId(request.User.Identity.Name)
Return userId.ToString()
End Function
End Class

View File

@@ -3594,9 +3594,14 @@ Partial Class Compras_Compras
End If
End If
<<<<<<< HEAD
CargaRetIVAConcepto(True, ObjProveedor.DIOTCveTipoOperacion)
CargaRetISRConcepto(True, ObjProveedor.DIOTCveTipoOperacion)
CargaRetIVAConcepto(True, ObjProveedor.DIOTCveTipoOperacion)
CargaRetISRConcepto(True, ObjProveedor.DIOTCveTipoOperacion)
>>>>>>> GDiaz 2024.05.21
LbAgregar.Enabled = True
UpPSS.Update()
UpPS.Update()
@@ -3642,26 +3647,31 @@ Partial Class Compras_Compras
PorcentajeProntoPago = ObjProveedor.PorcentajeProntoPago
End If
<<<<<<< HEAD
=======
>>>>>>> GDiaz 2024.05.21
Else
Alert("El Proveedor solicitado no existe, por favor intente de nuevo.", TipoMensaje.MsgAdvertencia)
End If
Else
Alert("Ocurrió un error al consultar el proveedor.", TipoMensaje.MsgError)
End If
<<<<<<< HEAD
=======
>>>>>>> GDiaz 2024.05.21
If UsuarioActual.Empresa.Funcionalidad(560) = "1" Then
If ObjProveedor.GetProveedoresEvaluacionPediente(Me.CveProveedor, UsuarioActual.CveEmpresa) Then
If ObjProveedor.DtResultados.Rows.Count > 0 Then
Me.RequiereEvaluacion = ObjProveedor.DtResultados.Rows(0)("RequiereEvaluacion").ToString() = "1"
Me.CveUsuarioEvaluador = ObjProveedor.DtResultados.Rows(0)("CveUsuarioEvaluador").ToString().ToEntero()
If ObjProveedor.GetProveedoresEvaluacionPediente(Me.CveProveedor, UsuarioActual.CveEmpresa) Then
If ObjProveedor.DtResultados.Rows.Count > 0 Then
Me.RequiereEvaluacion = ObjProveedor.DtResultados.Rows(0)("RequiereEvaluacion").ToString() = "1"
Me.CveUsuarioEvaluador = ObjProveedor.DtResultados.Rows(0)("CveUsuarioEvaluador").ToString().ToEntero()
End If
End If
End If
End If
End If
ObjProveedor.Dispose()
ObjProveedor.Dispose()
End Sub
Private Sub CargaAnticipos(CveProveedor As Integer, Optional FiltroTipo As String = "-1")

View File

@@ -155,7 +155,7 @@
<div class="row">
<div class="col-md-12">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtConcepto" runat="server" Width="100%" CssClass="form-control" ></asp:TextBox>
<asp:TextBox ID="TxtConcepto" runat="server" Width="100%" CssClass="form-control" onkeyup="asignaConcepto()" ClientIDMode="Static"></asp:TextBox>
<label for="<%= TxtConcepto.ClientID.ToString()%>">Concepto:</label>
<asp:RequiredFieldValidator ID="RFVConcepto" runat="server" ControlToValidate="TxtConcepto" Display="None" ErrorMessage="El campo <b>''Concepto''</b> es requerido, por favor ingrese uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEConcepto" runat="server" HighlightCssClass="vco" TargetControlID="RFVConcepto" Width="350px"></ajax:ValidatorCalloutExtender>
@@ -335,7 +335,7 @@
<HeaderTemplate>Concepto</HeaderTemplate>
<ItemTemplate>
<%--<asp:Literal ID="LrlConcepto" runat="server" Text='<%# Eval("Concepto")%>'></asp:Literal>--%>
<asp:TextBox ID="TxtConcepto" runat="server" Text='<%# Eval("Concepto")%>' Width="100%"></asp:TextBox>
<asp:TextBox ID="TxtConcepto" runat="server" Text='<%# Eval("Concepto")%>' Width="100%" CssClass="selTxtConcepto"></asp:TextBox>
</ItemTemplate>
<ItemStyle />
</asp:TemplateField>
@@ -1203,9 +1203,17 @@
}
function valorIE() {
}
function asignaConcepto() {
let valor = $('#TxtConcepto').val();
$('input[type="text"].selTxtConcepto').val(valor);
}
</script>
</asp:Content>

View File

@@ -191,6 +191,12 @@
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<asp:UpdatePanel ID="UpHB" runat="server">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkCobrosEnTranscurso" runat="server" OnClick="LnkCobrosEnTranscurso_Click"><i class="fa fa-money"></i> Cobros en Transcurso</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LkbEstadodeCaja" Visible="false" runat="server"><i class="fa fa-ad-excel"></i> Estado de Caja</asp:LinkButton>
</li>
@@ -315,7 +321,7 @@
CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-print'></i>" ToolTip="Imprimir"
OnClick="LnkImprimir_Click" Visible="false" />
&nbsp;
<asp:LinkButton ID="BtnPagar" runat="server" CssClass="btn btn-xs btn-success" Text="Cobrar" CommandName="Cobrar" CommandArgument='<%# Eval("CveVenta") %>' />
<asp:LinkButton ID="BtnPagar" runat="server" CssClass="btn btn-xs btn-success" Text="Cobrar" CommandName="Cobrar" CommandArgument='<%# Eval("CveVenta") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
@@ -952,6 +958,46 @@
</div>
<div id="DVModalCobrosEnTranscurso" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpDVModalCobrosEnTranscurso" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Label ID="Label1" runat="server">Cobros en Transcurso</asp:Label>
</h4>
</div>
<div class="modal-body">
<asp:GridView ID="GvModalCobrosEnTranscurso" runat="server" AutoGenerateColumns="False" Width="100%"
EmptyDataText="Cobros en Transcursos" data-sort="true" ToolTip="Cobros en Transcurso"
CssClass="ScrollAD table table-striped table-hover Widthall mysmallbtn" data-heighterror="320" data-freezecols="0" data-freezerows="0" GridLines="None"
DataKeyNames="CveVenta,TipoDocto,Saldo,AtencionA,CveFormaPago33,SerieFolio">
<Columns>
<asp:BoundField HeaderText="Atención" DataField="AtencionA" />
<asp:HyperLinkField HeaderText="Folio" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="SerieFolio" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Fecha/Hora" DataField="Fecha" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Importe" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Usuario" DataField="UsuarioCobranza" />
</Columns>
</asp:GridView>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script src="/Scripts/PrintJS/print.min.js"></script>

View File

@@ -1099,4 +1099,26 @@ Partial Class Ventas_PVCobranza
#End Region
Protected Sub LnkCobrosEnTranscurso_Click(sender As Object, e As EventArgs)
Dim ObjMovtos As New ClsMovimientos()
Dim FechaI, FechaF As Date
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim().ToDate, MinFecha)
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha).AddDays(1)
If ObjMovtos.GetRemisionesCobranza(UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, FechaI, FechaF) Then
Dim dtt As DataTable = ObjMovtos.DtResultados.FiltraParametros($"CveVenta > 0 AND CveUsuarioCobranza > 0 ")
GvModalCobrosEnTranscurso.DataSource = dtt
End If
ObjMovtos.Dispose()
GvModalCobrosEnTranscurso.DataBind()
UpDVModalCobrosEnTranscurso.Update()
RegistraScript("$('#DVModalCobrosEnTranscurso').modal('show');")
End Sub
End Class