-- que la cancelacion sea sobre el timbre, y que no genere 1 peso
This commit is contained in:
@@ -300,23 +300,72 @@ Partial Class Bancos_RepComplementoPago
|
|||||||
|
|
||||||
Dim CveIE As Integer = Gvr.DataKey("CveIE").ToEntero
|
Dim CveIE As Integer = Gvr.DataKey("CveIE").ToEntero
|
||||||
Dim SerieFolioPago As String = Gvr.DataKey("SerieFolioPago").ToString
|
Dim SerieFolioPago As String = Gvr.DataKey("SerieFolioPago").ToString
|
||||||
Dim CFDIRelacionado As String = Gvr.DataKey("FolioFiscalComplemento").ToString
|
Dim FolioFiscalCancelar As String = Gvr.DataKey("FolioFiscalComplemento").ToString
|
||||||
|
Dim CveComplementoPagoCancelar As Integer = Gvr.DataKey("CveComplementoPago").ToEntero
|
||||||
|
Dim CvePACCancelacion As Integer = UsuarioActual.Empresa.CvePAC
|
||||||
|
Dim RFCReceptorCancelar As String = Gvr.DataKey("RFC").ToString
|
||||||
|
|
||||||
If CFDIRelacionado <> "" Then
|
If FolioFiscalCancelar <> "" Then
|
||||||
Dim objBancos As New ClsBancos
|
Dim ObjCancelacion As New Timbrado
|
||||||
|
Dim ObjBanco As New ClsBancos
|
||||||
|
|
||||||
|
If EstatusSATCancelado(FolioFiscalCancelar, UsuarioActual.Empresa.RFC, RFCReceptorCancelar) Then
|
||||||
|
|
||||||
|
If ObjBanco.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=Date.Now, SelloCancelacion:="") Then
|
||||||
|
|
||||||
|
Alert("El complemento se cancelo correctamente.")
|
||||||
|
End If
|
||||||
|
|
||||||
If objBancos.GeneraTimbrePago(CveIE, -1, UsuarioActual, -1, CFDIRelacionado, True) Then
|
|
||||||
Alert($"Complemento {SerieFolioPago} cancelado correctamente.")
|
|
||||||
Else
|
Else
|
||||||
Alert($"Se presento un error al cancelar el complementob {SerieFolioPago}.", TipoMensaje.MsgError)
|
|
||||||
|
If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion) Then
|
||||||
|
|
||||||
|
If ObjBanco.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse) Then
|
||||||
|
|
||||||
|
Alert("El complemento se cancelo correctamente.")
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
Alert("Se presento un error al cancelar el complemento.", TipoMensaje.MsgError)
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
objBancos.Dispose()
|
ObjBanco.Dispose()
|
||||||
|
|
||||||
|
'Dim objBancos As New ClsBancos
|
||||||
|
|
||||||
|
'If objBancos.GeneraTimbrePago(CveIE, -1, UsuarioActual, -1, CFDIRelacionado, True) Then
|
||||||
|
' Alert($"Complemento {SerieFolioPago} cancelado correctamente.")
|
||||||
|
'Else
|
||||||
|
' Alert($"Se presento un error al cancelar el complementob {SerieFolioPago}.", TipoMensaje.MsgError)
|
||||||
|
'End If
|
||||||
|
|
||||||
|
'objBancos.Dispose()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Function EstatusSATCancelado(FolioFiscal As String, RFCDe As String, RFCReceptor As String) As Boolean
|
||||||
|
|
||||||
|
Dim respuesta As Boolean = False
|
||||||
|
|
||||||
|
Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, RFCDe, RFCReceptor, "0", True)
|
||||||
|
|
||||||
|
If Vigencia IsNot Nothing Then
|
||||||
|
If Vigencia.Estado.ToUpper = "CANCELADO" Then
|
||||||
|
respuesta = True
|
||||||
|
Else
|
||||||
|
respuesta = False
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
respuesta = False
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return respuesta
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
Protected Sub LnkSendMail_Click(sender As Object, e As EventArgs)
|
Protected Sub LnkSendMail_Click(sender As Object, e As EventArgs)
|
||||||
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||||
HdnSerieFolioPago.Value = gvRow.DataKey("SerieFolioPago").ToString
|
HdnSerieFolioPago.Value = gvRow.DataKey("SerieFolioPago").ToString
|
||||||
|
|||||||
Reference in New Issue
Block a user