Refacturacion sin aceptacion

This commit is contained in:
2019-09-09 16:20:54 -07:00
parent e259e7d7e8
commit f9aa4b899f
5 changed files with 110 additions and 109 deletions

View File

@@ -667,7 +667,7 @@ Public Class ClsVentas
Return Retorno
End Function
Public Function UpdateCancelaVenta(CveVenta As Integer, FechaCancelacion As DateTime, SelloCancelacionSAT As String, CveEmpresa As Integer, Optional CvePAC As Integer = -1) As Boolean
Public Function UpdateCancelaVenta(CveVenta As Integer, FechaCancelacion As DateTime, SelloCancelacionSAT As String, CveEmpresa As Integer, Optional CvePAC As Integer = -1, Optional CveEstatusRefacturacion As Integer = 0) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasCancelacion")
@@ -678,6 +678,7 @@ Public Class ClsVentas
.Add("@SelloDigitalSAT", SqlDbType.VarChar).Value = SelloCancelacionSAT
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CvePAC", SqlDbType.SmallInt).Value = CvePAC
.Add("@CveEstatusRefacturacion", SqlDbType.TinyInt).Value = CveEstatusRefacturacion
End With
Try

View File

@@ -4297,7 +4297,7 @@ Namespace Modelos
End Select
If CveEstatus.Contiene(4, 5) Then
If Not ObjVentas.UpdateCancelaVenta(CveVenta, CancelacionFecha, CancelacionAcuse, UsuarioActual.CveEmpresa, CvePACCancelacion) Then
If Not ObjVentas.UpdateCancelaVenta(CveVenta, CancelacionFecha, CancelacionAcuse, UsuarioActual.CveEmpresa, CvePACCancelacion, CveEstatusRefacturacion) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al guardar el estatus de cancelación."
End If

View File

@@ -603,9 +603,9 @@
ObjGPS.Dispose()
If EsProduccion = "1" Then
RegisterNotification()
End If
'If EsProduccion = "1" Then
' RegisterNotification()
'End If
'-----------------
AspMap.License.SetLicenseKey("ccfecfcegknepnhmjighpjjpmpmbajfejhnladegmeanci")
@@ -668,44 +668,44 @@
#Region "S Q L D E P E N D E N C Y"
Public Sub RegisterNotification()
Try
'Get the connection string from the Web.Config file. Make sure that the key exists and it is the connection string for the Notification Database and the NotificationList Table that we created
Dim connectionString As String = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString
'We have selected the entire table as the command, so SQL Server executes this script and sees if there is a change in the result, raise the event
Dim commandText As String = "SELECT [FechaNotificacion] FROM dbo.Sis_NotificacionesActualizaciones"
'Start the SQL Dependency
SqlDependency.Start(connectionString)
Using connection As New SqlConnection(connectionString)
Using command As New SqlCommand(commandText, connection)
connection.Open()
Dim sqlDependency = New SqlDependency(command)
AddHandler sqlDependency.OnChange, AddressOf sqlDependency_OnChange
' NOTE: You have to execute the command, or the notification will never fire.
Using reader As SqlDataReader = command.ExecuteReader()
End Using
End Using
End Using
Catch ex As Exception
'Public Sub RegisterNotification()
' Try
' 'Get the connection string from the Web.Config file. Make sure that the key exists and it is the connection string for the Notification Database and the NotificationList Table that we created
' Dim connectionString As String = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString
' 'We have selected the entire table as the command, so SQL Server executes this script and sees if there is a change in the result, raise the event
' Dim commandText As String = "SELECT [FechaNotificacion] FROM dbo.Sis_NotificacionesActualizaciones"
' 'Start the SQL Dependency
' SqlDependency.Start(connectionString)
' Using connection As New SqlConnection(connectionString)
' Using command As New SqlCommand(commandText, connection)
' connection.Open()
' Dim sqlDependency = New SqlDependency(command)
' AddHandler sqlDependency.OnChange, AddressOf sqlDependency_OnChange
' ' NOTE: You have to execute the command, or the notification will never fire.
' Using reader As SqlDataReader = command.ExecuteReader()
' End Using
' End Using
' End Using
' Catch ex As Exception
End Try
' End Try
End Sub
'End Sub
Private Sub sqlDependency_OnChange(sender As Object, e As SqlNotificationEventArgs)
If e.Info = SqlNotificationInfo.Update Then
Try
Dim ObjNotificaciones As New ClsSisNotificaciones
ObjNotificaciones.ObtenerNotificaciones()
ObjNotificaciones.Dispose()
'System.Threading.Thread.Sleep(5000)
RegisterNotification()
Catch ex As Exception
'Private Sub sqlDependency_OnChange(sender As Object, e As SqlNotificationEventArgs)
' If e.Info = SqlNotificationInfo.Update Then
' Try
' Dim ObjNotificaciones As New ClsSisNotificaciones
' ObjNotificaciones.ObtenerNotificaciones()
' ObjNotificaciones.Dispose()
' 'System.Threading.Thread.Sleep(5000)
' RegisterNotification()
' Catch ex As Exception
End Try
End If
'Call the RegisterNotification method again
End Sub
' End Try
' End If
' 'Call the RegisterNotification method again
'End Sub
#End Region

View File

@@ -50,7 +50,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
}
ObjVentas.Dispose();
GvDatos.DataSource = DtVentas.FiltraParametros("CveEstatusFactura = 20 AND CveEstatusRefacturacion = 0");
var DtRefacturar = DtVentas.FiltraParametros("CveEstatusRefacturacion = 1");
var DtRefacturar = DtVentas.FiltraParametros("CveEstatusRefacturacion IN (1,3)");
if (DtRefacturar.Rows.Count > 0)
{
DivRefacturar.Visible = true;

View File

@@ -15529,7 +15529,7 @@ Partial Class Ventas
CancelarDocumento(True)
End Sub
Private Sub BtnRefacturacionConfirmarAceptacion_Click(sender As Object, e As System.EventArgs) Handles BtnRefacturacionConfirmarAceptacion.Click
Response.Redirect(String.Format("Ventas.aspx?CveDevolucion={0}&NuevaFactura=1", CveVenta))
CancelarDocumento(True)
End Sub
Private Sub BtnContabilizar_Click(sender As Object, e As System.EventArgs) Handles BtnContabilizar.Click
'Dim ObjMov As New ClsContabilidad