FolioFechaCacnelacion Inicial, Bancos IE no eliminar movmientos con cancelaciones
This commit is contained in:
@@ -3608,40 +3608,8 @@ Public Class ClsGenerales
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "IDisposable Support"
|
||||
|
||||
|
||||
' IDisposable
|
||||
Protected Overridable Sub Dispose(disposing As Boolean)
|
||||
If Not Me.disposedValue Then
|
||||
If disposing Then
|
||||
' TODO: dispose managed state (managed objects).
|
||||
If Not Data Is Nothing Then Data.Dispose() : Data = Nothing
|
||||
If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing
|
||||
If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing
|
||||
If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing
|
||||
If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close()
|
||||
If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing
|
||||
|
||||
End If
|
||||
|
||||
' TODO: free unmanaged resources (unmanaged objects) and override Finalize() below.
|
||||
' TODO: set large fields to null.
|
||||
End If
|
||||
Me.disposedValue = True
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
' This code added by Visual Basic to correctly implement the disposable pattern.
|
||||
Public Sub Dispose() Implements IDisposable.Dispose
|
||||
' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above.
|
||||
ConexionClose()
|
||||
Dispose(True)
|
||||
GC.SuppressFinalize(Me)
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
#Region " P O L I Z A V I R T U A L "
|
||||
@@ -4138,6 +4106,63 @@ Public Class ClsGenerales
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
Public Function GetFolioFechaCancelacion(CveEmpresa As Integer, Tipo As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Gral_FolioFechaCancelacionGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@Tipo", SqlDbType.Int).Value = Tipo
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError($"Ocurrió un error al obtener los datos de fechas de cancelación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
#Region "IDisposable Support"
|
||||
|
||||
|
||||
' IDisposable
|
||||
Protected Overridable Sub Dispose(disposing As Boolean)
|
||||
If Not Me.disposedValue Then
|
||||
If disposing Then
|
||||
' TODO: dispose managed state (managed objects).
|
||||
If Not Data Is Nothing Then Data.Dispose() : Data = Nothing
|
||||
If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing
|
||||
If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing
|
||||
If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing
|
||||
If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close()
|
||||
If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing
|
||||
|
||||
End If
|
||||
|
||||
' TODO: free unmanaged resources (unmanaged objects) and override Finalize() below.
|
||||
' TODO: set large fields to null.
|
||||
End If
|
||||
Me.disposedValue = True
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
' This code added by Visual Basic to correctly implement the disposable pattern.
|
||||
Public Sub Dispose() Implements IDisposable.Dispose
|
||||
' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above.
|
||||
ConexionClose()
|
||||
Dispose(True)
|
||||
GC.SuppressFinalize(Me)
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
@@ -4344,6 +4344,11 @@ Public Class ClsPaginas
|
||||
PaginaDict.Add("/General/JAMComparativos.aspx".ToUpper(), 643)
|
||||
PaginaDict.Add("/General/CatMotivoRechazoGuias.aspx".ToUpper(), 729)
|
||||
|
||||
PaginaDict.Add("/General/FolioFechaCancelacion.aspx".ToUpper(), -1)
|
||||
|
||||
|
||||
|
||||
|
||||
'-------------------------------------------Q U I T A R----------------------------------
|
||||
#Region "Q U I T A R"
|
||||
|
||||
|
||||
@@ -964,8 +964,12 @@ Namespace Extensiones
|
||||
(Mid(entero, 3, 1) <> "0" And Len(entero) = 8) Or
|
||||
(Mid(entero, 8, 1) = "0" And Mid(entero, 8, 1) = "0" And Mid(entero, 7, 1) = "0" And Mid(entero, 6, 1) = "0" And Mid(entero, 5, 1) = "0" And Mid(entero, 4, 1) = "0" And Len(entero) = 9) Then
|
||||
|
||||
If entero.ToString.Length >= 7 And Not Mid(entero, 1, 7) = "0000000" Then
|
||||
|
||||
Dim tmp As String = Mid(entero, 2, 6)
|
||||
If entero.ToString.Length >= 7 And tmp = "000000" Then
|
||||
If entero.ToString.Length = 7 And tmp = "000000" Then
|
||||
palabras.Append("de ")
|
||||
End If
|
||||
Else
|
||||
palabras.Append("mil ")
|
||||
End If
|
||||
|
||||
@@ -1189,6 +1189,11 @@ Partial Class Bancos_IE
|
||||
If ObjIE.FechaIngCancelacion.ToShortDateString = "01/01/0001" Then TrFechaIngCancelacion.Visible = False
|
||||
|
||||
End If
|
||||
|
||||
If ObjIE.CveIECancelacion > 0 Then
|
||||
CveIECancelacion = ObjIE.CveIECancelacion
|
||||
End If
|
||||
|
||||
UpCancelacion.Update()
|
||||
|
||||
'OTROS DATOS - DATOS COMPLEMENTO SUSTITUCION
|
||||
@@ -4805,7 +4810,7 @@ Partial Class Bancos_IE
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkEliminar_Click(sender As Object, e As EventArgs) Handles LnkEliminar.Click
|
||||
If CveIECancelado > 0 Then
|
||||
If CveIECancelado > 0 Or CveIECancelacion > 0 Then
|
||||
Alert("El Movimiento no se puede eliminar porque tiene una cancelación relacionada, se tiene que eliminar primero la cancelación", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "divDescripcion"))
|
||||
|
||||
117
General/FolioFechaCancelacion.aspx
Normal file
117
General/FolioFechaCancelacion.aspx
Normal file
@@ -0,0 +1,117 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="FolioFechaCancelacion.aspx.vb" Inherits="Generales_FolioFechaCancelacion" EnableEventValidation="false" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
|
||||
<style>
|
||||
#DivAgregarUnidad > div.modal-dialog > div label input {
|
||||
padding: 0px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Folio Fecha Cancelación
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel runat="server" ID="UpAcciones" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="LnkExportarExcel" OnClick="LnkExportarExcel_Click" data-toggle="tooltip" data-placement="left" title="Exportar Excel" Text="Exportar Excel" Visible="false"></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkExportarExcel" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<asp:UpdatePanel ID="UpFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnBuscar" runat="server" Text="Consultar" ValidationGroup="GrpBuscar" class="btn btn-primary" OnClick="BtnBuscar_Click" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption ">
|
||||
<div class="row">
|
||||
<label class="col-md-1 truncate" style="text-align: right;">Empresa:</label>
|
||||
<div class="col-md-3">
|
||||
<asp:DropDownList ID="DdlEmpresa" runat="server" DataValueField="CveEmpresa" DataTextField="Empresa" CssClass="form-control input-sm select2me" Width="150px" ></asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 truncate" style="text-align: right;">Tipo:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlTipo" runat="server" CssClass="form-control input-sm select2me" Width="150px">
|
||||
<asp:ListItem Value="1">Tipo 1</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
<label class="col-md-1 truncate">Descripción:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:Label ID="lbDescripcion" runat="server"></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveEmpresa,CvePrePoliza,Fecha,CveVenta,ImporteMN,CveConceptoContable,TipoDocto,CveEstatusFactura,FechaVenta,CveSubProyecto,CveCliente,CveVendedor,CveUsuario,Origen,FolioFiscal,CvePACCancelacion,FechaCancelacion"
|
||||
EmptyDataText="" ToolTip="" CssClass="table table-striped table-advance table-hover mysmallbtn " data-sort="true" Style="width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="CveEmpresa" DataField="CveEmpresa" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="CvePrePoliza" DataField="CvePrePoliza" ItemStyle-HorizontalAlign="Left" />
|
||||
|
||||
<asp:BoundField HeaderText="Fecha" DataField="Fecha" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="CveVenta" DataField="CveVenta" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="ImporteMN" DataField="ImporteMN" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="CveConceptoContable" DataField="CveConceptoContable" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="TipoDocto" DataField="TipoDocto" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="CveEstatusFactura" DataField="CveEstatusFactura" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="FechaVenta" DataField="FechaVenta" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="CveSubProyecto" DataField="CveSubProyecto" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="CveCliente" DataField="CveCliente" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="CveVendedor" DataField="CveVendedor" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="CveUsuario" DataField="CveUsuario" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Origen" DataField="Origen" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="FolioFiscal" DataField="FolioFiscal" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="RFCEmisor" DataField="RFCEmisor" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="RFCReceptor" DataField="RFCReceptor" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="CvePACCancelacion" DataField="CvePACCancelacion" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="FechaCancelacion" DataField="FechaCancelacion" ItemStyle-HorizontalAlign="Left" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
151
General/FolioFechaCancelacion.aspx.vb
Normal file
151
General/FolioFechaCancelacion.aspx.vb
Normal file
@@ -0,0 +1,151 @@
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Partial Class Generales_FolioFechaCancelacion
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property CveCamion As Integer
|
||||
Get
|
||||
|
||||
If ViewState("CveCamion") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return ViewState("CveCamion").ToString().ToEntero()
|
||||
End If
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
ViewState("CveCamion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Sub Generales_FolioFechaCancelacion_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaCombos()
|
||||
'CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Public Sub CargaDatos()
|
||||
|
||||
LnkExportarExcel.Visible = False
|
||||
Dim DT_Temp As New DataTable
|
||||
|
||||
|
||||
Dim ObjGeenrales As New ClsGenerales
|
||||
|
||||
If ObjGeenrales.GetFolioFechaCancelacion(DdlEmpresa.SelectedValue.ToEntero, DdlTipo.SelectedValue.ToEntero) Then
|
||||
|
||||
DT_Temp = ObjGeenrales.DtResultados
|
||||
|
||||
If DT_Temp.Rows.Count > 0 Then
|
||||
LnkExportarExcel.Visible = True
|
||||
End If
|
||||
|
||||
Else
|
||||
DT_Temp = Nothing
|
||||
End If
|
||||
|
||||
|
||||
|
||||
ObjGeenrales.Dispose()
|
||||
|
||||
|
||||
|
||||
If DT_Temp IsNot Nothing Then
|
||||
|
||||
DT_Temp.Columns.Add("FechaCancelacion", GetType(Date))
|
||||
|
||||
|
||||
|
||||
'DT_Temp = DT_Temp.FiltraParametros("CvePACCancelacion = 4")
|
||||
DT_Temp.AcceptChanges()
|
||||
|
||||
For Each DRow As DataRow In DT_Temp.Rows
|
||||
|
||||
Dim CancelacionAcuse As String = ""
|
||||
Dim CancelacionState As Integer = 0
|
||||
Dim CancelacionFecha As Date = Now
|
||||
Dim Consula As Boolean = False
|
||||
|
||||
Dim solicitud As New WSGF.Service1SoapClient
|
||||
Dim resp As New WSGF.StructXml()
|
||||
|
||||
Try
|
||||
resp = solicitud.GetAcuse(DRow("RFCEmisor").ToString, "rene.molina@adsistemas.mx", "rene2018", DRow("FolioFiscal"))
|
||||
If (resp.Estado = 0) Then
|
||||
|
||||
Dim xmlDoc As New System.Xml.XmlDocument()
|
||||
xmlDoc.LoadXml(Encoding.UTF8.GetString(Convert.FromBase64String(resp.CfdiB64)))
|
||||
Dim xpath As String = "Acuse/Folios"
|
||||
Dim nodes = xmlDoc.SelectNodes(xpath)
|
||||
CancelacionState = xmlDoc.GetElementsByTagName("EstatusUUID")(0).InnerText.ToEntero
|
||||
|
||||
xpath = "Acuse/Signature"
|
||||
nodes = xmlDoc.SelectNodes(xpath)
|
||||
|
||||
CancelacionAcuse = xmlDoc.GetElementsByTagName("SignatureValue")(0).InnerText
|
||||
CancelacionFecha = xmlDoc.SelectSingleNode("Acuse").Attributes("Fecha").Value.ToDate
|
||||
|
||||
DRow("FechaCancelacion") = CancelacionFecha
|
||||
Consula = True
|
||||
Else
|
||||
CancelacionAcuse = resp.Descripcion
|
||||
Consula = False
|
||||
End If
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
|
||||
|
||||
solicitud = Nothing
|
||||
|
||||
Next
|
||||
|
||||
DT_Temp.AcceptChanges()
|
||||
|
||||
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
|
||||
If DT_Temp IsNot Nothing Then
|
||||
GvDatos.DataSource = DT_Temp
|
||||
End If
|
||||
|
||||
GvDatos.DataBind()
|
||||
|
||||
UpDatos.Update()
|
||||
UpAcciones.Update()
|
||||
|
||||
'ObtenerAcuse
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCombos()
|
||||
|
||||
|
||||
DdlEmpresa.DataSource = GlobalDTEmpresas
|
||||
DdlEmpresa.DataBind()
|
||||
DdlEmpresa.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub BtnBuscar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub LnkExportarExcel_Click(sender As Object, e As EventArgs)
|
||||
GvDatos.ExportToExcel2("ReporteCancelaciones.xlsx")
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user