This commit is contained in:
2025-01-06 07:04:55 -07:00
11 changed files with 2275 additions and 2081 deletions

View File

@@ -201,6 +201,32 @@ Public Class ClsPaginas
#End Region #End Region
#Region "GlobalDTs" #Region "GlobalDTs"
Public Shared Property GlobalDTNotificacionesUsuarios(CveUsuario As Integer, CveEmpresa As Integer) As DataTable
Get
Dim AppNombre As String = $"GlobalDTNotificacionesUsuarios-{CveEmpresa}"
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Using ObjUsuarios As New ClsSisNotificaciones
If ObjUsuarios.NotificacionesUsuariosGet(-1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjUsuarios.DtResultados
End Using
End If
Dim filtros As New List(Of String)
If CveUsuario <> -1 Then filtros.Add($"CveUsuario = {CveUsuario}")
If filtros.Count > 0 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
GlobalDTNotificacionesUsuarios = Dv.ToTable
Dv.Dispose()
Else
GlobalDTNotificacionesUsuarios = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
Dim AppNombre As String = $"GlobalDTNotificacionesUsuarios-{CveEmpresa}"
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Public Shared Property GlobalTipoCambio(Optional Fecha As Date = MinFecha) As Double Public Shared Property GlobalTipoCambio(Optional Fecha As Date = MinFecha) As Double
Get Get
If GlobalTipoCambio <= 0 Then If GlobalTipoCambio <= 0 Then

View File

@@ -2323,7 +2323,107 @@ Public Class ClsSisNotificaciones
Return retorno Return retorno
End Function End Function
#Region "Notifica2.0"
''' <summary>
''' Obtiene mensajes de notificaciones de usuarios, por defecto obtine los ultimos 20.
''' </summary>
''' <param name="cveusuarioPara">Clave del usuario destinatario.</param>
''' <param name="cveEmpresa">Clave de la empresa.</param>
''' <param name="mostrarTodos">determina si retorna todos los mensanjes o solo los ultimos 20.</param>
''' <returns>Devuelve True si la operación fue exitosa, de lo contrario False.</returns>
Public Function NotificacionesUsuariosMensajesGet(cveusuario As Int32, cveEmpresa As Int32, mostrarTodos As Boolean, verVistos As Boolean) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_SIGNotificacionesUsuariosMensajesGet", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CveusuarioPara", SqlDbType.Int).Value = cveusuario
.Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa
.Add("@MostrarTodos", SqlDbType.Bit).Value = mostrarTodos
.Add("@verVistos", SqlDbType.Bit).Value = verVistos
End With
Try
SqlAdapter.Fill(Data)
retorno = True
Catch Ex1 As SqlException
Me.OnError("Ocurrió un error al intentar obtener Notificación.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
OnError("Ocurrió un error al intentar obtener Notificación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return retorno
End Function
''' <summary>
''' Obtiene notificaciones de usuarios.
''' </summary>
''' <param name="cveusuarioPara">Clave del usuario destinatario.</param>
''' <param name="cveEmpresa">Clave de la empresa.</param>
''' <param name="mostrarTodos">determina si retorna todos los mensanjes o solo los ultimos 20.</param>
''' <returns>Devuelve True si la operación fue exitosa, de lo contrario False.</returns>
Public Function NotificacionesUsuariosGet(cveusuario As Int32, cveEmpresa As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_SIGNotificacionesUsuariosGet", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@Cveusuario", SqlDbType.Int).Value = cveusuario
.Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa
End With
Try
SqlAdapter.Fill(Data)
retorno = True
Catch Ex1 As SqlException
Me.OnError("Ocurrió un error al intentar obtener Notificación.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
OnError("Ocurrió un error al intentar obtener Notificación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return retorno
End Function
Public Function NotificacionesUsuariosAdd(cveOrigen As Int32, cveusuarioPara As Int32, cveUsuarioDe As Int32, notificaCorreo As Boolean, notificaToast As Boolean, notificaCampana As Boolean,
icono As String, asunto As String, mensaje As String, cveEmpresa As Int32) As Boolean
Dim notificacion As String = "1"
NotificacionesUsuariosMensajesAdd(cveOrigen, cveusuarioPara, cveUsuarioDe, notificaCorreo, notificaToast, notificaCampana, icono, asunto, mensaje, cveEmpresa)
If (notificaCampana) Then
If (Not IsNothing(Data) AndAlso Data.Rows.Count > 0) Then
notificacion = Data(0)("Notificaciones").ToString()
End If
Dim _hubContext As IHubContext = GlobalHost.ConnectionManager.GetHubContext(Of Notificaciones)()
_hubContext.Clients.Client(Notificaciones.UsuariosConexiones(cveusuarioPara)).ContadorCampana(notificacion)
ClsPaginas.GlobalDTNotificacionesUsuarios(-1, cveEmpresa) = Nothing
End If
End Function
Private Function NotificacionesUsuariosMensajesAdd(cveOrigen As Int32, cveusuarioPara As Int32, cveUsuarioDe As Int32, notificaCorreo As Boolean, notificaToast As Boolean, notificaCampana As Boolean,
icono As String, asunto As String, mensaje As String, cveEmpresa As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_SIGNotificacionesUsuariosMensajesAdd", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CveOrigen", SqlDbType.Int).Value = cveOrigen
.Add("@CveusuarioPara", SqlDbType.Int).Value = cveusuarioPara
.Add("@CveUsuarioDe", SqlDbType.Int).Value = cveUsuarioDe
.Add("@NotificaCorreo", SqlDbType.Bit).Value = notificaCorreo
.Add("@NotificaToast", SqlDbType.Bit).Value = notificaToast
.Add("@NotificaCampana", SqlDbType.Bit).Value = notificaCampana
.Add("@Icono", SqlDbType.VarChar).Value = icono
.Add("@Asunto", SqlDbType.VarChar).Value = asunto
.Add("@Mensaje", SqlDbType.VarChar).Value = mensaje
.Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa
End With
Try
SqlAdapter.Fill(Data)
retorno = True
Catch Ex1 As SqlException
Me.OnError("Ocurrió un error al intentar agregar Notificación.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
OnError("Ocurrió un error al intentar agregar Notificación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return retorno
Return retorno
End Function
#End Region
#Region " IDisposable Support " #Region " IDisposable Support "

View File

@@ -28,7 +28,7 @@ Public Class NotificacionesSQLWatcher
Using connection As New SqlConnection(rutadb) Using connection As New SqlConnection(rutadb)
' Consulta para detectar cambios recientes ' Consulta para detectar cambios recientes
Dim command As New SqlCommand( Dim command As New SqlCommand(
"SELECT CveUsuario, Notificaciones, Fecha FROM NotificacionesUsuarios", connection) "SELECT CveUsuario, Notificaciones, Fecha FROM SIG_NotificacionesUsuarios", connection)
' Asociar dependencia SQL a la consulta ' Asociar dependencia SQL a la consulta
Dim dependency As New SqlDependency(command) Dim dependency As New SqlDependency(command)
@@ -51,7 +51,7 @@ Public Class NotificacionesSQLWatcher
' Método para enviar notificaciones solo de los registros actualizados ' Método para enviar notificaciones solo de los registros actualizados
Private Sub SendNotifications() Private Sub SendNotifications()
Using connection As New SqlConnection(rutadb) Using connection As New SqlConnection(rutadb)
Dim query As String = "SELECT CveUsuario, Notificaciones, Fecha FROM NotificacionesUsuarios WHERE Fecha > DATEADD(MINUTE, -1, GETDATE())" Dim query As String = "SELECT CveUsuario, Notificaciones, Fecha FROM SIG_NotificacionesUsuarios WHERE Fecha > DATEADD(MINUTE, -1, GETDATE())"
Dim command As New SqlCommand(query, connection) Dim command As New SqlCommand(query, connection)
connection.Open() connection.Open()

View File

@@ -180,7 +180,7 @@
<label style="width: 100px;">Forma de Pago:</label> <label style="width: 100px;">Forma de Pago:</label>
</div> </div>
<div class="col-md-1" runat="server" id="divTipoPago" > <div class="col-md-1" runat="server" id="divTipoPago" >
<asp:DropDownList ID="DdlTipoDeposito" runat="server" Width="100%" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" AutoPostBack="true" DataValueField="CveCuenta" OnSelectedIndexChanged="DdlTipoPago_SelectedIndexChanged" Class="table-group-action-input form-control input-inline input-small input-sm select2me" > <asp:DropDownList ID="DdlTipoDeposito" runat="server" Width="100%" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Class="table-group-action-input form-control input-inline input-small input-sm select2me" >
<asp:ListItem Value="-1" Text="Seleccione" Selected="True"></asp:ListItem> <asp:ListItem Value="-1" Text="Seleccione" Selected="True"></asp:ListItem>
<asp:ListItem Value="13" Text="Efectivo"></asp:ListItem> <asp:ListItem Value="13" Text="Efectivo"></asp:ListItem>
<asp:ListItem Value="3" Text="Cheque"></asp:ListItem> <asp:ListItem Value="3" Text="Cheque"></asp:ListItem>

View File

@@ -234,6 +234,12 @@ Partial Class Bancos_DepositosCaja
TotalImporte = TotalImporte - TxtComisionIntermediario.Text.ToDecimal - IVA TotalImporte = TotalImporte - TxtComisionIntermediario.Text.ToDecimal - IVA
End If End If
If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso TotalImportePrePoliza = 0 Then
Alert("No se ha especificado un importe a depositar.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim OcurrioError As Boolean = False Dim OcurrioError As Boolean = False
Dim NuevaCvePrePoliza As Integer Dim NuevaCvePrePoliza As Integer
@@ -621,6 +627,8 @@ Partial Class Bancos_DepositosCaja
DDlMesesSinIntereses.Visible = False DDlMesesSinIntereses.Visible = False
End If End If
DDlMesesSinIntereses.SelectedValue = "-1" DDlMesesSinIntereses.SelectedValue = "-1"
UPPFiltros.Update()
End Sub End Sub
Private Function ImpresionDirectaPDF(CveIEOrigen As Integer, CvePrePoliza As Integer) As String Private Function ImpresionDirectaPDF(CveIEOrigen As Integer, CvePrePoliza As Integer) As String

View File

@@ -49,9 +49,9 @@
GlobalConfiguration.Configure(AddressOf WebApiConfig.Register) GlobalConfiguration.Configure(AddressOf WebApiConfig.Register)
GlobalConfiguration.Configuration.EnsureInitialized() GlobalConfiguration.Configuration.EnsureInitialized()
'se comenta ya que se envbia directo desde el metodo NotificacionesUsuariosAdd en clssisnotificaciones
Dim watcher As New NotificacionesSQLWatcher() 'Dim watcher As New NotificacionesSQLWatcher()
watcher.StartWatching() 'watcher.StartWatching()
End Sub End Sub

View File

@@ -20,12 +20,12 @@
</style> </style>
<%: Scripts.Render("~/bundles/modernizr") %> <%: Scripts.Render("~/bundles/modernizr") %>
<%: Styles.Render("~/Content/AjaxControlToolkit/Styles/Bundle") %> <%: Styles.Render("~/Content/AjaxControlToolkit/Styles/Bundle") %>
<link rel="preconnect" href="https://fonts.googleapis.com"/> <link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous" /> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous" />
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css" /> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css" />
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700;800" rel="stylesheet"/> <link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700;800" rel="stylesheet" />
<link href="/Metronic/fontawesome6/css/all.min.css" rel="stylesheet" type="text/css" /> <link href="/Metronic/fontawesome6/css/all.min.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="/Scripts/PrintJS/print.min.css"/> <link rel="stylesheet" type="text/css" href="/Scripts/PrintJS/print.min.css" />
<%-- <link href="/Metronic/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" /> <%-- <link href="/Metronic/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<link href="/Metronic/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <link href="/Metronic/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="/Metronic/assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />--%> <link href="/Metronic/assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />--%>
@@ -139,13 +139,18 @@
<span class='SigCampananoti badge <%=If(countNotificaciones > 0, "badge-danger", "badge-default") %>'><%= countNotificaciones %> </span> <span class='SigCampananoti badge <%=If(countNotificaciones > 0, "badge-danger", "badge-default") %>'><%= countNotificaciones %> </span>
</a> </a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li class="external"> <li class="external" onclick ="$('.btnSigCampananoti').click();">
<h3><span class="bold"><%= countNotificaciones %></span> Notificaciones pendientes</h3> <h3>Click para ver notificaciones (<span class="bold"><%= countNotificaciones %></span>) pendientes</h3>
</li> </li>
<li> <li>
<ul class="dropdown-menu-list scroller" style="height: 250px;" data-handle-color="#637283"> <asp:UpdatePanel ID="UpNotificaciones" runat="server" UpdateMode="Conditional">
<asp:Literal ID="LtlMNotificaciones" runat="server"></asp:Literal> <ContentTemplate>
</ul> <asp:Button ID="btnSigCampananoti" CssClass="btnSigCampananoti" runat="server" Text="Enviar" OnClick="btnSigCampananoti_Click" Style="display:none" />
<ul class="dropdown-menu-list scroller" style="height: 250px;" data-handle-color="#637283">
<asp:Literal ID="LtlMNotificaciones" runat="server"></asp:Literal>
</ul>
</ContentTemplate>
</asp:UpdatePanel>
</li> </li>
</ul> </ul>
</li> </li>
@@ -347,8 +352,8 @@
<div class="page-container" runat="server" id="divpagecontainer"> <div class="page-container" runat="server" id="divpagecontainer">
<!-- BEGIN SIDEBAR --> <!-- BEGIN SIDEBAR -->
<div class="page-sidebar-wrapper" runat="server" id="divMenuB" style=" position: fixed;"> <div class="page-sidebar-wrapper" runat="server" id="divMenuB" style="position: fixed;">
<div class="page-sidebar navbar-collapse collapse" > <div class="page-sidebar navbar-collapse collapse">
<!-- add "navbar-no-scroll" class to disable the scrolling of the sidebar menu --> <!-- add "navbar-no-scroll" class to disable the scrolling of the sidebar menu -->
<!-- BEGIN SIDEBAR MENU --> <!-- BEGIN SIDEBAR MENU -->
<ul class="page-sidebar-menu" id='ulmenulateralmaster' data-keep-expanded="false" data-auto-scroll="true" data-slide-speed="200"> <ul class="page-sidebar-menu" id='ulmenulateralmaster' data-keep-expanded="false" data-auto-scroll="true" data-slide-speed="200">

View File

@@ -435,12 +435,19 @@ Partial Class Site
#Region "Notificaciones" #Region "Notificaciones"
Private Sub CargarNotificaciones() Protected Sub btnSigCampananoti_Click(sender As Object, e As EventArgs)
CargarNotificaciones(True)
End Sub
Private Sub CargarNotificaciones(Optional obtnerNotis As Boolean = False)
Dim Notificaciones As New StringBuilder Dim Notificaciones As New StringBuilder
'Bienvenida 'Bienvenida
Notificaciones.Append(ItemNotificaciones("Bienvenido a SIG ", "Hoy", "fa fa-bullhorn")) 'Notificaciones.Append(ItemNotificaciones("Bienvenido a SIG ", "Hoy", "fa fa-bullhorn"))
countNotificaciones = 0
Dim dt As DataTable = ClsPaginas.GlobalDTNotificacionesUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If Not IsNothing(dt) AndAlso dt.Rows.Count() > 0 Then
countNotificaciones = dt(0)("Notificaciones").ToString().ToEntero()
End If
'Certificado 'Certificado
Dim fechacer As String = ConvertCER() Dim fechacer As String = ConvertCER()
If fechacer = "" OrElse (((DateTime.Parse(fechacer).Month - ClsPaginas.NowADS().Month) < 2) AndAlso ((DateTime.Parse(fechacer).Year - ClsPaginas.NowADS().Year) < 1)) Then If fechacer = "" OrElse (((DateTime.Parse(fechacer).Month - ClsPaginas.NowADS().Month) < 2) AndAlso ((DateTime.Parse(fechacer).Year - ClsPaginas.NowADS().Year) < 1)) Then
@@ -461,6 +468,16 @@ Partial Class Site
End If End If
OC.Dispose() OC.Dispose()
End If End If
If obtnerNotis Then
Using objnoti As New ClsSisNotificaciones()
If objnoti.NotificacionesUsuariosMensajesGet(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, True, True) Then
For Each row As DataRow In objnoti.DtResultados.Rows
Notificaciones.Append(ItemNotificaciones(row("Mensaje").ToString(), row("Asunto").ToString(), row("Icono").ToString()))
Next
End If
End Using
End If
'If UsuarioActual.TienePermisoProceso(303) Then 'If UsuarioActual.TienePermisoProceso(303) Then
' Using objgen As New ClsGenerales ' Using objgen As New ClsGenerales
' pnlNotificacionSAT.Visible = True ' pnlNotificacionSAT.Visible = True
@@ -487,7 +504,8 @@ Partial Class Site
'End If 'End If
'OC.Dispose() 'OC.Dispose()
LtlMNotificaciones.Text = String.Format("{0}{1}", LtlMNotificaciones.Text, Notificaciones.ToString()) 'LtlMNotificaciones.Text = String.Format("{0}{1}", LtlMNotificaciones.Text, Notificaciones.ToString())
LtlMNotificaciones.Text = Notificaciones.ToString()
Notificaciones.Clear() Notificaciones.Clear()
End Sub End Sub
@@ -593,4 +611,5 @@ Partial Class Site
Catch ex As Exception Catch ex As Exception
End Try End Try
End Sub End Sub
End Class End Class

View File

@@ -770,7 +770,16 @@ Partial Class Clientes
HplAddVenta.NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveCliente={0}", CveCliente) HplAddVenta.NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveCliente={0}", CveCliente)
HplAddCotizacion.NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveCliente={0}&Op=Cot", CveCliente) HplAddCotizacion.NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveCliente={0}&Op=Cot", CveCliente)
'ImgAddObs.Attributes.Add("onclick", "javascript:PosicionaObjeto(this.id,'DivEventoBitacora',null,-250,-250); $('#DivEventoBitacora').show(1000); ") 'ImgAddObs.Attributes.Add("onclick", "javascript:PosicionaObjeto(this.id,'DivEventoBitacora',null,-250,-250); $('#DivEventoBitacora').show(1000); ")
If Request("Opt") IsNot Nothing AndAlso IsNumeric(Request("Opt")) Then Tab.ActiveTabIndex = Request("Opt").ToEntero() If Request("Opt") IsNot Nothing AndAlso IsNumeric(Request("Opt")) Then
Tab.ActiveTabIndex = Request("Opt").ToEntero()
'CARGA LOS DATOS DEL TAB QUE SELECCIONO
Select Case Tab.ActiveTabIndex
Case 2 'Historial de ventas
BtnHistorialVentas_Click(Nothing, EventArgs.Empty)
End Select
End If
CargaDireccionesEnvio() CargaDireccionesEnvio()
CargaAFAsignados() CargaAFAsignados()

View File

@@ -222,7 +222,7 @@ Partial Class Ventas_Promociones
divBitacora.Visible = True divBitacora.Visible = True
Dim ObjGral As New ClsGenerales() Dim ObjGral As New ClsGenerales()
If ObjGral.GetHistorialBitacora(-1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa, CvePromocion:=CvePromocion) Then If ObjGral.GetHistorialBitacora(-1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa, CvePromocion:=CvePromocion) Then
GvBitacora.DataSource = ObjGral.DtResultados GvBitacora.DataSource = ObjGral.DtResultados.FiltraParametros("", "CveHistorialBitacora DESC")
End If End If
ObjGral.Dispose() ObjGral.Dispose()
GvBitacora.DataBind() GvBitacora.DataBind()
@@ -969,14 +969,20 @@ Partial Class Ventas_Promociones
If Not TieneError And Dr("HoraInicio").ToString <> Dr2("HoraInicio").ToString Then If Not TieneError And Dr("HoraInicio").ToString <> Dr2("HoraInicio").ToString Then
If Not ObjGral.AddHistorialBitacora(372, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr("HoraInicio").ToString, $"{Dr("CodigoPS").ToString} - {Dr2("HoraInicio").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
Dim Anterior As String = If(Dr2("HoraInicio").ToString.ToDate.Year = 1900, "", Dr2("HoraInicio").ToString)
If Not ObjGral.AddHistorialBitacora(372, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr("HoraInicio").ToString, $"{Dr("CodigoPS").ToString} - { Anterior}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True TieneError = True
Exit For Exit For
End If End If
End If End If
If Not TieneError And Dr("HoraFin").ToString <> Dr2("HoraFin").ToString Then If Not TieneError And Dr("HoraFin").ToString <> Dr2("HoraFin").ToString Then
If Not ObjGral.AddHistorialBitacora(373, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr("HoraFin").ToString, $"{Dr("CodigoPS").ToString} - {Dr2("HoraFin").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
Dim Anterior As String = If(Dr2("HoraFin").ToString.ToDate.Year = 9999, "", Dr2("HoraFin").ToString)
If Not ObjGral.AddHistorialBitacora(373, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr("HoraFin").ToString, $"{Dr("CodigoPS").ToString} - {Anterior}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
TieneError = True TieneError = True
Exit For Exit For
End If End If

View File

@@ -8286,6 +8286,16 @@ Partial Class Ventas
End If End If
End If End If
'SOLO HABILITAR PARA GENERAR NOTAS DE CREDITO
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ClienteEsDistribuidor AndAlso Not PermiteCredito AndAlso Not LnkSolicitarCredito.Visible Then
LnkSolicitarCredito.Visible = True
If DdlSolCreditoTipoDocto.Items.FindByValue("Ing") IsNot Nothing Then
DdlSolCreditoTipoDocto.Items.Remove(DdlSolCreditoTipoDocto.Items.FindByValue("Ing"))
End If
End If
If DdlTipoComprobante.SelectedValue.Contiene("Rem", "PeC", "PA", "Ped") Then If DdlTipoComprobante.SelectedValue.Contiene("Rem", "PeC", "PA", "Ped") Then
'ENVIO DE FACTURA 'ENVIO DE FACTURA
ChkEnviarFactura.Checked = False ChkEnviarFactura.Checked = False
@@ -17994,16 +18004,27 @@ Partial Class Ventas
End If End If
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant", "Egs") Then If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant", "Egs") Then
'If Not ImprimeAlert Then
Dim ArchivoIng As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.rdlc", UsuarioActual.Empresa.Ruta)) If UsuarioActual.Empresa.Funcionalidad(707) = "1" Then
Dim ArchivoRem As New System.IO.FileInfo(String.Format("{0}Formatos/Remision.rdlc", UsuarioActual.Empresa.Ruta)) Dim ArchivoIng As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.mrt", UsuarioActual.Empresa.Ruta))
Dim ArchivoEgs As New System.IO.FileInfo(String.Format("{0}Formatos/NotaCredito.rdlc", UsuarioActual.Empresa.Ruta)) Dim ArchivoRem As New System.IO.FileInfo(String.Format("{0}Formatos/Remision.mrt", UsuarioActual.Empresa.Ruta))
Dim ArchivoEgs As New System.IO.FileInfo(String.Format("{0}Formatos/NotaCredito.mrt", UsuarioActual.Empresa.Ruta))
If ArchivoIng.Exists Or ArchivoRem.Exists Or ArchivoEgs.Exists Then If ArchivoIng.Exists Or ArchivoRem.Exists Or ArchivoEgs.Exists Then
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta))) MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta)))
Else
MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ")
End If
Else Else
MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ") Dim ArchivoIng As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.rdlc", UsuarioActual.Empresa.Ruta))
Dim ArchivoRem As New System.IO.FileInfo(String.Format("{0}Formatos/Remision.rdlc", UsuarioActual.Empresa.Ruta))
Dim ArchivoEgs As New System.IO.FileInfo(String.Format("{0}Formatos/NotaCredito.rdlc", UsuarioActual.Empresa.Ruta))
If ArchivoIng.Exists Or ArchivoRem.Exists Or ArchivoEgs.Exists Then
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta)))
Else
MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ")
End If
End If End If
End If End If