Contratos, repcomplementos de pago motivo de cancelacion
This commit is contained in:
@@ -177,10 +177,10 @@
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="5%" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<asp:TemplateField Visible="true">
|
||||
<HeaderTemplate>Cancelar SAT</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkCancelarFolioFiscal" OnClick="LnkCancelaFolioFiscal" runat="server" AlternateText="Eliminar" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" Visible="false" />
|
||||
<asp:LinkButton ID="LnkCancelarFolioFiscal" OnClick="LnkCancelaFolioFiscal" runat="server" AlternateText="Eliminar" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" Visible="false" />
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="5%" />
|
||||
</asp:TemplateField>
|
||||
@@ -189,7 +189,94 @@
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div id="ModalDivMail" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
|
||||
<!-- Modal content-->
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">Correo</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpSendMail" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField ID="HdnSerieFolioPago" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<div class="row">
|
||||
<div class="col-xs-4">Para:</div>
|
||||
<div class="col-xs-8">
|
||||
<asp:TextBox ID="TxtParaMail" runat="server" Width="370px" CssClass="form-control" ClientIDMode="Static"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-4">
|
||||
Con copia para:<br />
|
||||
(Separar con: ;)
|
||||
</div>
|
||||
<div class="col-xs-8">
|
||||
<asp:TextBox ID="TxtCC" runat="server" TextMode="MultiLine" Columns="3" Rows="3" CssClass="form-control"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnSendMail" Text="Enviar" runat="server" ClientIDMode="Static" CssClass="btn btn-primary" ValidationGroup="GrpEnviarEmail" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="ModalCancelacion" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">Cancelar</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpModalCancelacion" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-xs-4">Motivo de Cancelación:</div>
|
||||
<div class="col-xs-8">
|
||||
|
||||
<asp:DropDownList runat="server" id="DdlMotivoCancelacion" DataTextField="CodigoSATDescripcion" DataValueField="CveMotivoCancelacion" CssClass="form-control input-sm select2me" Width="80%" >
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlMotivoCancelacion" InitialValue="-1" runat="server" ControlToValidate="DdlMotivoCancelacion" Display="None" ErrorMessage="El campo <b>''Motivo de Cancelación''</b> es requerido por la aplicación." ValidationGroup="GrpCancelacion"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VceRfvDdlMotivoCancelacion" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlMotivoCancelacion" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnCancelarComplemento" Text="Cancelar Complemento" runat="server" ClientIDMode="Static" CssClass="btn btn-primary" ValidationGroup="GrpCancelacion" OnClick="BtnCancelarComplemento_Click"
|
||||
data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,14 +6,89 @@ Imports Extensiones
|
||||
Imports GemBox.Spreadsheet
|
||||
|
||||
Partial Class Bancos_RepComplementoPago
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Sub Bancos_RepComplementoPago_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
#Region "C A N C E L A C I O N DE C O M P L E M E N T O S"
|
||||
|
||||
Private Property Can_FolioFiscalCancelar As String
|
||||
Get
|
||||
|
||||
If ViewState("Can_FolioFiscalCancelar") Is Nothing Then
|
||||
ViewState("Can_FolioFiscalCancelar") = ""
|
||||
End If
|
||||
|
||||
Return ViewState("Can_FolioFiscalCancelar").ToString
|
||||
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("Can_FolioFiscalCancelar") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Property Can_CveComplementoPagoCancelar As Integer
|
||||
Get
|
||||
|
||||
If ViewState("Can_CveComplementoPagoCancelar") Is Nothing Then
|
||||
ViewState("Can_CveComplementoPagoCancelar") = ""
|
||||
End If
|
||||
|
||||
Return ViewState("Can_CveComplementoPagoCancelar").ToString.ToEntero
|
||||
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("Can_CveComplementoPagoCancelar") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property Can_CvePACCancelacion As Integer
|
||||
Get
|
||||
|
||||
If ViewState("Can_CvePACCancelacion") Is Nothing Then
|
||||
ViewState("Can_CvePACCancelacion") = ""
|
||||
End If
|
||||
|
||||
Return ViewState("Can_CvePACCancelacion").ToString.ToEntero
|
||||
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("Can_CvePACCancelacion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property Can_RFCReceptorCancelar As String
|
||||
Get
|
||||
|
||||
If ViewState("Can_RFCReceptorCancelar") Is Nothing Then
|
||||
ViewState("Can_RFCReceptorCancelar") = ""
|
||||
End If
|
||||
|
||||
Return ViewState("Can_RFCReceptorCancelar").ToString
|
||||
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("Can_RFCReceptorCancelar") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Private Sub Bancos_RepComplementoPago_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
txtFechaI.Text = $"{New DateTime(Now.Year, Now.Month, 1).ToString("dd/MM/yyyy")}"
|
||||
txtFechaF.Text = DateTime.Now.ToString("dd/MM/yyyy")
|
||||
DdlCliente.setEsWebService(True)
|
||||
|
||||
DdlMotivoCancelacion.DataSource = GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa).FiltraParametros("CveSATMotivoCancelacion = 2 or CveSATMotivoCancelacion = 3 ")
|
||||
DdlMotivoCancelacion.DataBind()
|
||||
DdlMotivoCancelacion.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||
|
||||
|
||||
Dim objGral As New ClsGralFolios
|
||||
If objGral.GetFolios("CP", UsuarioActual.CveEmpresa) Then
|
||||
If objGral.DtResultados.Rows.Count > 0 Then
|
||||
@@ -150,9 +225,9 @@ Partial Class Bancos_RepComplementoPago
|
||||
e.Row.FCHyperLink("HplPDF").Visible = True : e.Row.FCHyperLink("HplPDF").NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CompP&EXT=pdf&CveComplementoPago={0}&SerieFolio={1}&CveIE={2}", e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("SerieFolioPago").ToString.Replace("&", "%26%"), e.Row.DBCampo("CveIE").ToString)))
|
||||
e.Row.FCLinkButton("LnkSendMail").Visible = True
|
||||
|
||||
'If DdlOpcion.SelectedValue.ToEntero = 2 Then
|
||||
' e.Row.FCLinkButton("LnkCancelarFolioFiscal").Visible = True
|
||||
'End If
|
||||
If DdlOpcion.SelectedValue.ToEntero = 2 Then
|
||||
e.Row.FCLinkButton("LnkCancelarFolioFiscal").Visible = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
@@ -326,53 +401,18 @@ Partial Class Bancos_RepComplementoPago
|
||||
|
||||
Protected Sub LnkCancelaFolioFiscal(sender As Object, e As EventArgs)
|
||||
|
||||
Dim Gvr As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
|
||||
Dim CveIE As Integer = Gvr.DataKey("CveIE").ToEntero
|
||||
Dim SerieFolioPago As String = Gvr.DataKey("SerieFolioPago").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 FolioFiscalCancelar <> "" Then
|
||||
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
|
||||
|
||||
Else
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
Dim Gvr As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
|
||||
Can_FolioFiscalCancelar = Gvr.DataKey("FolioFiscalComplemento").ToString
|
||||
Can_CveComplementoPagoCancelar = Gvr.DataKey("CveComplementoPago").ToEntero
|
||||
Can_CvePACCancelacion = UsuarioActual.Empresa.CvePAC
|
||||
Can_RFCReceptorCancelar = Gvr.DataKey("RFC").ToString
|
||||
|
||||
DdlMotivoCancelacion.SelectedValueExist(-1)
|
||||
|
||||
RegistraScript("$('#ModalCancelacion').modal('show');")
|
||||
|
||||
UpModalCancelacion.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -417,8 +457,6 @@ Partial Class Bancos_RepComplementoPago
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub Imprimir(Optional reporte As String = "PDF")
|
||||
If GvD.Rows.Count > 0 Then
|
||||
Dim StrFiltro As New StringBuilder
|
||||
@@ -482,7 +520,6 @@ Partial Class Bancos_RepComplementoPago
|
||||
worksheet.Columns("E").Width = 6000
|
||||
worksheet.Columns("F").Width = 6000
|
||||
worksheet.Columns("G").Width = 4000
|
||||
worksheet.Columns("H").Width = 12000
|
||||
|
||||
For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
|
||||
|
||||
@@ -532,8 +569,57 @@ Partial Class Bancos_RepComplementoPago
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub BtnCancelarComplemento_Click(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
Dim CveMotivoCancelacion As Integer = 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
|
||||
|
||||
|
||||
|
||||
Dim ErrorProceso As Boolean = True
|
||||
|
||||
If Can_FolioFiscalCancelar <> "" Then
|
||||
Dim ObjCancelacion As New Timbrado
|
||||
Dim ObjBanco As New ClsBancos
|
||||
|
||||
If EstatusSATCancelado(Can_FolioFiscalCancelar, UsuarioActual.Empresa.RFC, Can_RFCReceptorCancelar) Then
|
||||
|
||||
If ObjBanco.UpdateComplementoPago(Can_CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, Can_CvePACCancelacion, FechaCancelacion:=Date.Now, SelloCancelacion:="") Then
|
||||
Alert("El complemento se cancelo correctamente.")
|
||||
ErrorProceso = False
|
||||
End If
|
||||
|
||||
Else
|
||||
|
||||
If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, Can_FolioFiscalCancelar, 0, Can_RFCReceptorCancelar, UsuarioActual.Empresa.RFC, Can_CvePACCancelacion, CveSATMotivoCancelacion:=CveSATMotivoCancelacion) Then
|
||||
|
||||
If ObjBanco.UpdateComplementoPago(Can_CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, Can_CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse, CveSATMotivoCancelacion:=CveSATMotivoCancelacion) Then
|
||||
Alert("El complemento se cancelo correctamente.")
|
||||
ErrorProceso = False
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert("Se presento un error al cancelar el complemento.", TipoMensaje.MsgError)
|
||||
ErrorProceso = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
ObjBanco.Dispose()
|
||||
Else
|
||||
ErrorProceso = False
|
||||
End If
|
||||
|
||||
If Not ErrorProceso Then
|
||||
RegistraScript("$('#ModalCancelacion').modal('hide');")
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user