Cancelacion IE
This commit is contained in:
@@ -837,6 +837,13 @@ Partial Class Bancos_IE
|
||||
|
||||
'End If
|
||||
|
||||
|
||||
|
||||
DdlMotivoCancelacion.DataSource = GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa)
|
||||
DdlMotivoCancelacion.DataBind()
|
||||
DdlMotivoCancelacion.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -1096,7 +1103,7 @@ Partial Class Bancos_IE
|
||||
HplDepositado.NavigateUrl = $"/Bancos/IE.aspx?CveIE={CveIEDeposito2}"
|
||||
End If
|
||||
|
||||
LnkCancelarComplemento.Visible = False
|
||||
'LnkCancelarComplemento.Visible = False
|
||||
LnkCancelarComplementoImporte.Visible = False
|
||||
UppEliminarIE.Update()
|
||||
|
||||
@@ -1267,7 +1274,7 @@ Partial Class Bancos_IE
|
||||
LnkEliminar.Visible = False
|
||||
'LnkCancelar.Visible = False
|
||||
|
||||
LnkCancelarComplemento.Visible = True
|
||||
'LnkCancelarComplemento.Visible = True
|
||||
LnkCancelarComplementoImporte.Visible = True
|
||||
|
||||
End If
|
||||
@@ -1275,7 +1282,7 @@ Partial Class Bancos_IE
|
||||
|
||||
Else
|
||||
BtnEditar.Visible = False
|
||||
LnkCancelarComplemento.Visible = False
|
||||
' LnkCancelarComplemento.Visible = False
|
||||
LnkCancelarComplementoImporte.Visible = False
|
||||
DVGenerarComplementoModal.Visible = False
|
||||
End If
|
||||
@@ -4587,22 +4594,23 @@ Partial Class Bancos_IE
|
||||
Dim ErrorCancelarComplemento As Boolean = True
|
||||
|
||||
If CancelarComplemento Then
|
||||
Dim ObjCancelacion As New Timbrado
|
||||
'Dim ObjBanco As New ClsBancos
|
||||
|
||||
If EstatusSATCancelado(FolioFiscalCancelar, UsuarioActual.Empresa.RFC, RFCReceptorCancelar) Then
|
||||
|
||||
If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=Date.Now, SelloCancelacion:="") Then
|
||||
CargaComplementosPago()
|
||||
RegistraScript("$('#ModalCancelarComplemetno').modal('hide');")
|
||||
ErrorCancelarComplemento = False
|
||||
Alert("El complemento se cancelo correctamente.")
|
||||
End If
|
||||
Dim CveMotivoCancelacion As Integer = DdlMotivoCancelacion.SelectedValue.ToEntero
|
||||
Dim CveSATMotivoCancelacion As Integer = GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa, CveMotivoCancelacion:=CveMotivoCancelacion).FiltroPrimeroValor("CveSATMotivoCancelacion").ToEntero()
|
||||
|
||||
Else
|
||||
If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion) Then
|
||||
If CveMotivoCancelacion <= 0 Or CveSATMotivoCancelacion <= 0 Then
|
||||
Alert("Debe de elegir un motivo de cancelación.", TipoMensaje.MsgAdvertencia)
|
||||
ErrorCancelarComplemento = True
|
||||
End If
|
||||
|
||||
If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse) Then
|
||||
|
||||
If Not ErrorCancelarComplemento Then
|
||||
|
||||
Dim ObjCancelacion As New Timbrado
|
||||
If EstatusSATCancelado(FolioFiscalCancelar, UsuarioActual.Empresa.RFC, RFCReceptorCancelar) Then
|
||||
|
||||
If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=Date.Now, SelloCancelacion:="") Then
|
||||
CargaComplementosPago()
|
||||
RegistraScript("$('#ModalCancelarComplemetno').modal('hide');")
|
||||
ErrorCancelarComplemento = False
|
||||
@@ -4610,12 +4618,25 @@ Partial Class Bancos_IE
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert("Se presento un error al cancelar el complemento.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion, CveSATMotivoCancelacion:=CveSATMotivoCancelacion) Then
|
||||
|
||||
If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse) Then
|
||||
CargaComplementosPago()
|
||||
RegistraScript("$('#ModalCancelarComplemetno').modal('hide');")
|
||||
ErrorCancelarComplemento = False
|
||||
Alert("El complemento se cancelo correctamente.")
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert("Se presento un error al cancelar el complemento.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
Else
|
||||
ErrorCancelarComplemento = False
|
||||
End If
|
||||
@@ -5804,11 +5825,9 @@ Partial Class Bancos_IE
|
||||
#End Region
|
||||
|
||||
#Region " COMPLEMENTOS PAGO "
|
||||
|
||||
Private Sub CargaComplementosPago()
|
||||
|
||||
|
||||
|
||||
|
||||
Dim ObjBancos As New ClsBancos
|
||||
|
||||
If UsuarioActual.CveRol = 1 Then
|
||||
@@ -5823,9 +5842,7 @@ Partial Class Bancos_IE
|
||||
|
||||
GvComplementoPagos.DataSource = ObjBancos.DtResultados
|
||||
|
||||
If ObjBancos.DtResultados.FiltraParametros(" Estatus IN (1,3) ").Rows.Count = 0 And Tipo.ToUpper = "CARGO" And CveCliente > 0 And CveEstatusIE <> 2 And ObjBancos.DtResultados.FiltraParametros(" CveIECancelacion > 0 ").Rows.Count = 0 Then
|
||||
DVGenerarComplementoModal.Visible = True
|
||||
End If
|
||||
|
||||
Else
|
||||
GvComplementoPagos.DataSource = Nothing
|
||||
End If
|
||||
@@ -5833,6 +5850,14 @@ Partial Class Bancos_IE
|
||||
If CveIE > 0 Then
|
||||
If ObjBancos.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
If ObjBancos.DtResultados.FiltraParametros(" Estatus IN (1,3) ").Rows.Count = 0 And Tipo.ToUpper = "CARGO" And CveCliente > 0 And CveEstatusIE <> 2 Then
|
||||
DVGenerarComplementoModal.Visible = True
|
||||
End If
|
||||
|
||||
If ObjBancos.DtResultados.FiltraParametros(" Estatus IN (1,3) ").Rows.Count = 1 And Tipo.ToUpper = "CARGO" And CveCliente > 0 And CveEstatusIE <> 2 Then
|
||||
DVmotivoCancelacion.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
' GvComplementoPagos.DataSource = ObjBancos.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "SerieFolio", "Fecha", "CveIE"})
|
||||
|
||||
@@ -5844,11 +5869,14 @@ Partial Class Bancos_IE
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
ObjBancos.Dispose()
|
||||
GvComplementoPagos.DataBind()
|
||||
UpComplementoPagos.Update()
|
||||
|
||||
|
||||
UpEliminarCotizacion.Update() 'Esto se ocupa para mostrar DVmotivoCancelacion
|
||||
|
||||
'ObjBancos.Dispose()
|
||||
'GvComplementoPagos.DataBind()
|
||||
'UpComplementoPagos.Update()
|
||||
@@ -5863,9 +5891,16 @@ Partial Class Bancos_IE
|
||||
e.Row.Cells(4).Text = String.Format("<a class="" texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"" target=""_blank""><i class="" fa fa-ad-pdf""></i></a>", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE"))))
|
||||
|
||||
If e.Row.DataKey("Estatus").Contiene("1", "3") Then
|
||||
|
||||
e.Row.FCLinkButton("LnkCancelarComplemetno").Visible = True
|
||||
e.Row.FCDropDownList("DdlMotivoCancelacion").Visible = True
|
||||
e.Row.FCDropDownList("DdlMotivoCancelacion").DataSource = GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa)
|
||||
e.Row.FCDropDownList("DdlMotivoCancelacion").DataBind()
|
||||
e.Row.FCDropDownList("DdlMotivoCancelacion").Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
|
||||
|
||||
Else
|
||||
e.Row.FCLinkButton("LnkCancelarComplemetno").Visible = False
|
||||
e.Row.FCDropDownList("DdlMotivoCancelacion").Visible = False
|
||||
End If
|
||||
|
||||
ElseIf e.Row.DataKey("Tipo") = "Egs" Then
|
||||
@@ -5876,6 +5911,7 @@ Partial Class Bancos_IE
|
||||
GvComplementoPagos.Columns(6).Visible = False
|
||||
GvComplementoPagos.Columns(7).Visible = False
|
||||
GvComplementoPagos.Columns(8).Visible = False
|
||||
GvComplementoPagos.Columns(9).Visible = False
|
||||
|
||||
End If
|
||||
|
||||
@@ -5950,13 +5986,13 @@ Partial Class Bancos_IE
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Protected Sub LnkCancelarComplemento_Click(sender As Object, e As EventArgs)
|
||||
If ChkConciliado.Checked Then
|
||||
Alert("El documento seleccionado no se puede eliminar porque se encuentra conciliado.", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
Confirmacion("¿Seguro que desea Cancelar el documento por Sustitución?", "", String.Format("document.location.href=""/Ventas/ClientesAbonar.aspx?CveIESustitucion={0}&CveCliente={1}&CveMoneda={2}""", CveIE, CveCliente, CveMoneda), "")
|
||||
End Sub
|
||||
'Protected Sub LnkCancelarComplemento_Click(sender As Object, e As EventArgs)
|
||||
' If ChkConciliado.Checked Then
|
||||
' Alert("El documento seleccionado no se puede eliminar porque se encuentra conciliado.", TipoMensaje.MsgError)
|
||||
' Exit Sub
|
||||
' End If
|
||||
' Confirmacion("¿Seguro que desea Cancelar el documento por Sustitución?", "", String.Format("document.location.href=""/Ventas/ClientesAbonar.aspx?CveIESustitucion={0}&CveCliente={1}&CveMoneda={2}""", CveIE, CveCliente, CveMoneda), "")
|
||||
'End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
@@ -6126,6 +6162,9 @@ Partial Class Bancos_IE
|
||||
CalendarioCancelacion.StartDate = fechaCancelacion.ToDate
|
||||
UpEliminarCotizacion.Update()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
RegistraScript("ShowDivCancelarIE();")
|
||||
End Sub
|
||||
Protected Sub BtnDesconciliar_Click(sender As Object, e As EventArgs)
|
||||
@@ -6605,6 +6644,16 @@ Partial Class Bancos_IE
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).BindingContainer, GridViewRow)
|
||||
|
||||
|
||||
|
||||
Dim CveMotivoCancelacion As Integer = GvRow.FCDropDownList("DdlMotivoCancelacion").SelectedValue.ToEntero
|
||||
Dim CveSATMotivoCancelacion As Integer = GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa, CveMotivoCancelacion:=CveMotivoCancelacion).FiltroPrimeroValor("CveSATMotivoCancelacion").ToEntero()
|
||||
|
||||
If CveMotivoCancelacion <= 0 Or CveSATMotivoCancelacion <= 0 Then
|
||||
Alert("Debe de elegir un motivo de cancelación.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
CveComplementoPagoCancelar = GvRow.DataKey("CveComplementoPago").ToEntero
|
||||
FolioFiscalCancelar = GvRow.DataKey("FolioFiscal").ToString
|
||||
'' Dim RFCEmisor As String = UsuarioActual.Empresa.RFC
|
||||
@@ -6622,7 +6671,7 @@ Partial Class Bancos_IE
|
||||
End If
|
||||
|
||||
Else
|
||||
Dim CveSATMotivoCancelacion As Integer = GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa, CveSATMotivoCancelacion:=2).FiltroPrimeroValor("CveSATMotivoCancelacion").ToEntero()
|
||||
|
||||
|
||||
If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion, CveSATMotivoCancelacion:=CveSATMotivoCancelacion) Then
|
||||
|
||||
@@ -6681,6 +6730,8 @@ Partial Class Bancos_IE
|
||||
|
||||
RegistraScript("$('#ModalCancelarComplemetno').modal('show');")
|
||||
DivFechaCancelación.Visible = True
|
||||
CargaComplementosPago()
|
||||
|
||||
UpModalCancelarComplemetno.Update()
|
||||
|
||||
Else
|
||||
|
||||
Reference in New Issue
Block a user