ClsBancos Editar IE
This commit is contained in:
@@ -1315,7 +1315,8 @@ Public Class ClsBancos
|
|||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
Public Function UpdateBancos_IE(FechaDocumento As DateTime, FechaAplicado As DateTime?, CveIE As Integer, Optional Folio As String = "-1") As Boolean
|
Public Function UpdateBancos_IE(FechaDocumento As DateTime, FechaAplicado As DateTime?, CveIE As Integer, Optional Folio As String = "-1", Optional CveCuentaDeposito As Integer = -1, Optional CveCuenta As Integer = -1,
|
||||||
|
Optional Observaciones As String = "-1") As Boolean
|
||||||
|
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Banc_IEUpdate")
|
DataAdapter("PA_Banc_IEUpdate")
|
||||||
@@ -1328,8 +1329,17 @@ Public Class ClsBancos
|
|||||||
Else
|
Else
|
||||||
.Add("@FechaAplicado", SqlDbType.DateTime).Value = FechaAplicado
|
.Add("@FechaAplicado", SqlDbType.DateTime).Value = FechaAplicado
|
||||||
End If
|
End If
|
||||||
|
|
||||||
.Add("@CveIE", SqlDbType.Int).Value = CveIE
|
.Add("@CveIE", SqlDbType.Int).Value = CveIE
|
||||||
.Add("@Folio", SqlDbType.VarChar).Value = Folio
|
.Add("@Folio", SqlDbType.VarChar).Value = Folio
|
||||||
|
|
||||||
|
.Add("@CveCuentaDeposito", SqlDbType.Int).Value = CveCuentaDeposito
|
||||||
|
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
|
||||||
|
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Try
|
Try
|
||||||
|
|||||||
@@ -11,17 +11,14 @@
|
|||||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||||
<asp:Literal ID="LtlTitulo" runat="server" Text="Registro de Ingresos y Egresos"></asp:Literal> <asp:Literal ID="LtlIE" runat="server"></asp:Literal>
|
<asp:Literal ID="LtlTitulo" runat="server" Text="Registro de Ingresos y Egresos"></asp:Literal> <asp:Literal ID="LtlIE" runat="server"></asp:Literal>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|
||||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||||
<li>
|
<li>
|
||||||
<asp:HyperLink ID="HplListaProveedores" runat="server" Style="color: #686868;"><i class="fa fa-list-ul" style="color: #686868;"></i> Listado Facturas Pagadas</asp:HyperLink>
|
<asp:HyperLink ID="HplListaProveedores" runat="server" Style="color: #686868;"><i class="fa fa-list-ul" style="color: #686868;"></i> Listado Facturas Pagadas</asp:HyperLink>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<asp:HyperLink ID="HLImprimir" Target="_blank" runat="server" Visible="false" Style="color: #686868;"> <i class="fa fa-print" style="color: #686868;"></i> Imprimir</asp:HyperLink>
|
<asp:HyperLink ID="HLImprimir" Target="_blank" runat="server" Visible="false" Style="color: #686868;"> <i class="fa fa-print" style="color: #686868;"></i> Imprimir</asp:HyperLink>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<asp:UpdatePanel runat="server" ID="UpAccionesComplementos">
|
<asp:UpdatePanel runat="server" ID="UpAccionesComplementos">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<li>
|
<li>
|
||||||
@@ -30,7 +27,6 @@
|
|||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<asp:HyperLink ID="HLModalActualizarTC" NavigateUrl="#" runat="server" Visible="false" data-toggle="modal" data-target="#ModalActualizarTC" Style="color: #686868;"><i class="fa fa-usd" style="color:#686868;"></i> Actualizar Tipo Cambio</asp:HyperLink>
|
<asp:HyperLink ID="HLModalActualizarTC" NavigateUrl="#" runat="server" Visible="false" data-toggle="modal" data-target="#ModalActualizarTC" Style="color: #686868;"><i class="fa fa-usd" style="color:#686868;"></i> Actualizar Tipo Cambio</asp:HyperLink>
|
||||||
</li>
|
</li>
|
||||||
@@ -54,7 +50,10 @@
|
|||||||
<asp:LinkButton ID="LnkCancelarComplemento" OnClick="LnkCancelarComplemento_Click" runat="server" Visible="false" Style="color: #686868;"><i class="fa fa-ban" style="color: #686868;"></i> Refacturar Complemento</asp:LinkButton>
|
<asp:LinkButton ID="LnkCancelarComplemento" OnClick="LnkCancelarComplemento_Click" runat="server" Visible="false" Style="color: #686868;"><i class="fa fa-ban" style="color: #686868;"></i> Refacturar Complemento</asp:LinkButton>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<asp:LinkButton ID="LnkCancelarComplementoImporte" OnClick="LnkCancelarComplementoImporte_Click" runat="server" Visible="false" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea cancelar el documento?" data-btn-ok-label="si" Style="color: #686868;"><i class="fa fa-pencil" style="color: #686868;"></i> Cancelar Complemento</asp:LinkButton>
|
<asp:LinkButton ID="LnkCancelarComplementoImporte" OnClick="LnkCancelarComplementoImporte_Click" runat="server" Visible="false" data-toggle="confirmation" data-popout="true" style="color: #686868;"></i> Cancelar Complemento</asp:LinkButton>
|
||||||
|
|
||||||
|
<%--data-original-title="¿Está seguro que desea cancelar el documento?" data-btn-ok-label="si" Style="color: #686868;"><i class="fa fa-pencil"--%>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
@@ -862,6 +861,7 @@
|
|||||||
<asp:Button ID="BtnCancelar" runat="server" Visible="false" Text="Volver" OnClientClick="javascript:window.location.href='/Bancos/CatBancosIE.aspx';return false;" class="btn btn-danger " />
|
<asp:Button ID="BtnCancelar" runat="server" Visible="false" Text="Volver" OnClientClick="javascript:window.location.href='/Bancos/CatBancosIE.aspx';return false;" class="btn btn-danger " />
|
||||||
<asp:Button ID="BtnImprimir" runat="server" Text="Imprimir" Visible="False" class="btn btn-primary " />
|
<asp:Button ID="BtnImprimir" runat="server" Text="Imprimir" Visible="False" class="btn btn-primary " />
|
||||||
<asp:Button ID="BtnActualizar" runat="server" Text="Actualizar" ValidationGroup="GrpGuardar" Visible="False" class="btn btn-info " />
|
<asp:Button ID="BtnActualizar" runat="server" Text="Actualizar" ValidationGroup="GrpGuardar" Visible="False" class="btn btn-info " />
|
||||||
|
<asp:Button Text="Editar" ID="BtnEditar" OnClick="BtnEditar_Click" CssClass="btn btn-primary" runat="server" Visible ="false" ValidationGroup="GrpGuardar" />
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</td>
|
</td>
|
||||||
@@ -1228,6 +1228,7 @@
|
|||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button id="CancelarActualizarTC" type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
|
<button id="CancelarActualizarTC" type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
|
||||||
<asp:Button Text="Actualizar" ID="BtnActualizarTC" OnClick="BtnActualizarTC_Click" CssClass="btn btn-primary" ValidationGroup="GrpModalActualizarTC" runat="server" />
|
<asp:Button Text="Actualizar" ID="BtnActualizarTC" OnClick="BtnActualizarTC_Click" CssClass="btn btn-primary" ValidationGroup="GrpModalActualizarTC" runat="server" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
@@ -1333,29 +1334,31 @@
|
|||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header ">
|
<div class="modal-header ">
|
||||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
<h4 class="modal-title">CancelarComplemetno</h4>
|
<h4 class="modal-title">Cancelar Movimiento y Complemetno</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
|
||||||
<asp:UpdatePanel ID="UpModalCancelarComplemetno" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="UpModalCancelarComplemetno" runat="server" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<p>¿Cual de las siguientes acciones es la que desea realizar?</p>
|
<%-- <p>¿Cual de las siguientes acciones es la que desea realizar?</p>
|
||||||
|
|
||||||
<asp:RadioButtonList runat="server" ID="RdlCancelarComplemento" OnSelectedIndexChanged="RdlCancelarComplemento_SelectedIndexChanged" AutoPostBack="true" RepeatDirection="Horizontal">
|
<asp:RadioButtonList runat="server" ID="RdlCancelarComplemento" OnSelectedIndexChanged="RdlCancelarComplemento_SelectedIndexChanged" AutoPostBack="true" RepeatDirection="Horizontal">
|
||||||
<asp:ListItem Value="1" Selected="True">Cancelar Complemento</asp:ListItem>
|
<asp:ListItem Value="1" Selected="True">Cancelar Complemento</asp:ListItem>
|
||||||
<asp:ListItem Value="2">Cancelar Pago y Complemento</asp:ListItem>
|
<asp:ListItem Value="2">Cancelar Pago y Complemento</asp:ListItem>
|
||||||
</asp:RadioButtonList>
|
</asp:RadioButtonList>--%>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="row" runat="server" id="DivFechaCancelación" visible="false">
|
<div class="row" runat="server" id="DivFechaCancelación" visible="true">
|
||||||
|
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
Fecha Cancelación:
|
Fecha Cancelación:
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="input-group date date-picker" data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
<div class="input-group date date-picker" data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||||
|
|
||||||
<asp:TextBox ID="TxtFechaCancelarComplemento" runat="server" CssClass="form-control input-sm" Width="80px" CausesValidation="true" MaxLength="10" ValidationGroup="GrpCancelarComplemento"></asp:TextBox>
|
<asp:TextBox ID="TxtFechaCancelarComplemento" runat="server" CssClass="form-control input-sm" Width="80px" CausesValidation="true" MaxLength="10" ValidationGroup="GrpCancelarComplemento"></asp:TextBox>
|
||||||
<span class="input-group-btn ">
|
<span class="input-group-btn ">
|
||||||
<asp:LinkButton ID="LnkTxtFechaCancelarComplemento" class="btn default input-sm" Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
<asp:LinkButton ID="LnkTxtFechaCancelarComplemento" class="btn default input-sm" Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||||
@@ -1374,11 +1377,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -630,7 +630,7 @@ Partial Class Bancos_IE
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
'08/05/2018 - Se deshabilita opcion Eliminar IE si tiene un complemento de pago relacionado
|
'08/05/2018 - Se deshabilita opcion Eliminar IE si tiene un complemento de pago relacionado
|
||||||
If CveIE = -1 Or (CveIE > 0 AndAlso VerificaComplementos()) Then
|
If CveIE = -1 Or (CveIE > 0 AndAlso VerificaComplementos(False)) Then
|
||||||
LnkEliminar.Visible = False
|
LnkEliminar.Visible = False
|
||||||
If CveIE > 0 Then
|
If CveIE > 0 Then
|
||||||
LnkCancelar.Visible = False
|
LnkCancelar.Visible = False
|
||||||
@@ -674,6 +674,17 @@ Partial Class Bancos_IE
|
|||||||
LnkAjustarMovimiento.Visible = True
|
LnkAjustarMovimiento.Visible = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If Not VerificaComplementos(True) Then
|
||||||
|
|
||||||
|
LnkCancelarComplemento.Visible = False
|
||||||
|
LnkCancelarComplementoImporte.Visible = False
|
||||||
|
|
||||||
|
|
||||||
|
UppEliminarIE.Update()
|
||||||
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -697,7 +708,7 @@ Partial Class Bancos_IE
|
|||||||
CveIEDeposito2 = ObjIE.DtResultados(0)("CveIEDeposito2").ToString.ToEntero
|
CveIEDeposito2 = ObjIE.DtResultados(0)("CveIEDeposito2").ToString.ToEntero
|
||||||
|
|
||||||
If UsuarioActual.TienePermisoProceso(99) Then
|
If UsuarioActual.TienePermisoProceso(99) Then
|
||||||
BtnActualizar.Visible = True
|
'BtnActualizar.Visible = True
|
||||||
TxtFechaDocumento.Enabled = True
|
TxtFechaDocumento.Enabled = True
|
||||||
Calendario.Enabled = True
|
Calendario.Enabled = True
|
||||||
End If
|
End If
|
||||||
@@ -749,6 +760,7 @@ Partial Class Bancos_IE
|
|||||||
'ChkAplicaImpuestos.Checked = ObjIE.AplicaImpuestos
|
'ChkAplicaImpuestos.Checked = ObjIE.AplicaImpuestos
|
||||||
'ChkImpreso.Checked = ObjIE.FueImpreso
|
'ChkImpreso.Checked = ObjIE.FueImpreso
|
||||||
ChkConciliado.Checked = ObjIE.FueConciliado
|
ChkConciliado.Checked = ObjIE.FueConciliado
|
||||||
|
|
||||||
DdlEstatusIE.SelectedValue = ObjIE.CveEstatusIE.ToString
|
DdlEstatusIE.SelectedValue = ObjIE.CveEstatusIE.ToString
|
||||||
DdlEstatusIE.Visible = False
|
DdlEstatusIE.Visible = False
|
||||||
LblEstatusIE.Visible = True
|
LblEstatusIE.Visible = True
|
||||||
@@ -1044,6 +1056,21 @@ Partial Class Bancos_IE
|
|||||||
Alert("El Documento solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
|
Alert("El Documento solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
|
||||||
BtnGuardar.Enabled = False
|
BtnGuardar.Enabled = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If Not ChkConciliado.Checked Then
|
||||||
|
|
||||||
|
|
||||||
|
If Not VerificaComplementos(True) Then
|
||||||
|
BtnEditar.Visible = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
UpGuardar.Update()
|
||||||
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'If CveIE > 0 Then
|
'If CveIE > 0 Then
|
||||||
@@ -3638,14 +3665,22 @@ Partial Class Bancos_IE
|
|||||||
'End If
|
'End If
|
||||||
|
|
||||||
Protected Sub BtnActualizar_Click(sender As Object, e As EventArgs) Handles BtnActualizar.Click
|
Protected Sub BtnActualizar_Click(sender As Object, e As EventArgs) Handles BtnActualizar.Click
|
||||||
|
|
||||||
Dim IE As New ClsBancos
|
Dim IE As New ClsBancos
|
||||||
Dim FechaAplicado As DateTime? = Nothing
|
Dim FechaAplicado As DateTime? = Nothing
|
||||||
|
|
||||||
If IE.UpdateBancos_IE(TxtFechaDocumento.Text.ToDate, FechaAplicado, CveIE, TxtFolio.Text) Then
|
|
||||||
Alert("La Actualización del documento se realizó correctamente", TipoMensaje.MsgInformacion)
|
Dim CveCuentaDepositoUpdate As Integer = If(DdlCuentaDeposito.SelectedValue.ToEntero.ToEntero = 0, -1, DdlCuentaDeposito.SelectedValue.ToEntero.ToEntero)
|
||||||
|
|
||||||
|
If IE.UpdateBancos_IE(TxtFechaDocumento.Text.ToDate, FechaAplicado, CveIE, TxtFolio.Text, CveCuentaDeposito:=CveCuentaDepositoUpdate, CveCuenta:=DdlCuenta.SelectedValue.ToEntero,
|
||||||
|
Observaciones:=TxtObservaciones.Text) Then
|
||||||
|
Alert("La Actualización del documento se realizó correctamente", TipoMensaje.MsgInformacion, $"document.location.href=""IE.aspx?CveIE={CveIE}""")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
IE.Dispose()
|
IE.Dispose()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub ImgUpdateCuentaDeposito_Click(sender As Object, e As ImageClickEventArgs)
|
Protected Sub ImgUpdateCuentaDeposito_Click(sender As Object, e As ImageClickEventArgs)
|
||||||
@@ -4524,6 +4559,8 @@ Partial Class Bancos_IE
|
|||||||
UpDatos.Update()
|
UpDatos.Update()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub RecargaCuentasDepositos()
|
Private Sub RecargaCuentasDepositos()
|
||||||
|
|
||||||
|
|
||||||
If CveProveedor > 0 Then
|
If CveProveedor > 0 Then
|
||||||
|
|
||||||
Dim dr As DataRow = GlobalDTTipoTransacciones.FiltroPrimero(String.Format("CveTipoTransaccion = {0}", DdlTipoTransaccion.SelectedValue)) 'Egs o Ing
|
Dim dr As DataRow = GlobalDTTipoTransacciones.FiltroPrimero(String.Format("CveTipoTransaccion = {0}", DdlTipoTransaccion.SelectedValue)) 'Egs o Ing
|
||||||
@@ -4534,6 +4571,12 @@ Partial Class Bancos_IE
|
|||||||
CargaCuentasDepositos()
|
CargaCuentasDepositos()
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If CveCliente > 0 Then
|
||||||
|
CargaCuentasDepositoClientes()
|
||||||
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
'Recaga CuentasBancarias de Proveedor
|
'Recaga CuentasBancarias de Proveedor
|
||||||
@@ -4730,9 +4773,11 @@ Partial Class Bancos_IE
|
|||||||
If ObjBancos.GetVincularPago(CveProveedor, CveCompra, 2, MinFecha, MaxFecha, UsuarioActual.CveEmpresa, CveIE) Then
|
If ObjBancos.GetVincularPago(CveProveedor, CveCompra, 2, MinFecha, MaxFecha, UsuarioActual.CveEmpresa, CveIE) Then
|
||||||
|
|
||||||
GvComplementoPagos.DataSource = ObjBancos.DtResultados
|
GvComplementoPagos.DataSource = ObjBancos.DtResultados
|
||||||
If ObjBancos.DtResultados.Rows.Count = 0 And Tipo.ToUpper = "CARGO" And CveCliente > 0 And UsuarioActual.CveRol = 1 Then
|
|
||||||
|
If ObjBancos.DtResultados.FiltraParametros(" Estatus IN (1,3) ").Rows.Count = 0 And Tipo.ToUpper = "CARGO" And CveCliente > 0 And UsuarioActual.CveRol = 1 Then
|
||||||
DVGenerarComplementoModal.Visible = True
|
DVGenerarComplementoModal.Visible = True
|
||||||
Else
|
Else
|
||||||
|
|
||||||
DVGenerarComplementoModal.Visible = False
|
DVGenerarComplementoModal.Visible = False
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
@@ -4808,14 +4853,25 @@ Partial Class Bancos_IE
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Private Function VerificaComplementos() As Boolean
|
Private Function VerificaComplementos(Validos As Boolean) As Boolean
|
||||||
Dim ObjBancos As New ClsBancos
|
Dim ObjBancos As New ClsBancos
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
If ObjBancos.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) And ObjBancos.DtResultados.Rows.Count > 0 Then
|
Dim Filtro As String = ""
|
||||||
|
|
||||||
|
|
||||||
|
If Validos Then
|
||||||
|
Filtro = " Estatus IN(1,3) "
|
||||||
|
Else
|
||||||
|
Filtro = ""
|
||||||
|
End If
|
||||||
|
|
||||||
|
If ObjBancos.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) And ObjBancos.DtResultados.FiltraParametros(Filtro).Rows.Count > 0 Then
|
||||||
Retorno = True
|
Retorno = True
|
||||||
Else
|
Else
|
||||||
Retorno = False
|
Retorno = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
ObjBancos.Dispose()
|
ObjBancos.Dispose()
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
@@ -4828,203 +4884,7 @@ Partial Class Bancos_IE
|
|||||||
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), "")
|
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 Sub
|
||||||
|
|
||||||
Protected Sub LnkCancelarComplementoImporte_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
|
|
||||||
|
|
||||||
Dim FechaCorteIE As Date = Now
|
|
||||||
Dim CveMoneda, CveMonedaFiltro, IDPoliza, IdPolizaNueva, FolioPolizaNueva As Integer
|
|
||||||
Dim FolioIECancelado = ""
|
|
||||||
Dim ErrorCancelar As Boolean
|
|
||||||
Dim ObjBancos As New ClsBancos
|
|
||||||
Dim MensajeError As String = ""
|
|
||||||
|
|
||||||
ObjBancos.IniciaTransacSQL()
|
|
||||||
Dim ObjAC As ClsContPAQi = Nothing
|
|
||||||
If UsuarioActual.Empresa.UsaAC Then
|
|
||||||
ObjAC = New ClsContPAQi(UsuarioActual.Empresa)
|
|
||||||
ObjAC.IniciaTransacSQL()
|
|
||||||
End If
|
|
||||||
|
|
||||||
If ObjBancos.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) Then
|
|
||||||
ComplementoSerieFolio = ObjBancos.DtResultados.FiltroPrimeroValor("FolioFiscal")
|
|
||||||
End If
|
|
||||||
|
|
||||||
' Dim FechaCancelacion As DateTime = now ' = ("2019/05/31 23:50").ToDateTime
|
|
||||||
|
|
||||||
If ObjBancos.GeneraTimbrePago(CveIE, -1, UsuarioActual, EsCancelacion:=True, CFDIRelacionado:=ComplementoSerieFolio) Then
|
|
||||||
If ObjBancos.GetBancosIE(CveIE, UsuarioActual.CveEmpresa) Then
|
|
||||||
If ObjBancos.DtResultados.Rows.Count > 0 Then
|
|
||||||
'FechaCorteIE = ObjBancos.FechaDocumento
|
|
||||||
CveMoneda = ObjBancos.CveMoneda
|
|
||||||
CveMonedaFiltro = CveMoneda
|
|
||||||
IDPoliza = ObjBancos.IDPoliza
|
|
||||||
FolioIECancelado = ObjBancos.Folio
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "GENERAR TIMBRE PAGO"
|
|
||||||
End If
|
|
||||||
|
|
||||||
'CANCELA IE CONTABILIZADO
|
|
||||||
If Not ErrorCancelar Then
|
|
||||||
|
|
||||||
If (IDPoliza > 0 AndAlso UsuarioActual.Empresa.UsaAC) Then
|
|
||||||
|
|
||||||
If ObjAC Is Nothing Then
|
|
||||||
ErrorCancelar = True
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Not ErrorCancelar Then
|
|
||||||
Dim dt As DataTable
|
|
||||||
If ObjAC.GetPoliza(IDPoliza, -1, -1, -1, -1) AndAlso ObjAC.DtResultados.Rows.Count > 0 Then
|
|
||||||
dt = ObjAC.DtResultados
|
|
||||||
|
|
||||||
' MES ANTERIOR, MOVIMIENTOS CONTRARIOS (NEGATIVOS)
|
|
||||||
If dt.Rows(0)("FechaPol").ToString.ToDate.Month < TxtFechaDocumento.Text.ToDate.Month Or dt.Rows(0)("FechaPol").ToString.ToDate.Year < TxtFechaDocumento.Text.ToDate.Year Then
|
|
||||||
IdPolizaNueva = ObjAC.AddPoliza(1, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), 0, 0, UsuarioActual.CveUsuario, TxtFechaDocumento.Text.ToDate)
|
|
||||||
|
|
||||||
If IdPolizaNueva > 0 Then
|
|
||||||
FolioPolizaNueva = ObjAC.Folio
|
|
||||||
|
|
||||||
'CREA POLIZA NEGATIVA
|
|
||||||
For Each dr As DataRow In dt.Rows
|
|
||||||
If Not ObjAC.AddMovimiento(IdPolizaNueva, dr("IdCuenta").ToString.ToEntero, dr("TipoMovto").ToString = "True", dr("Importe").ToString.ToDecimal * -1, dr("Referencia").ToString, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), dr("IdSegNeg").ToString.ToEntero, TxtFechaDocumento.Text.ToDate, "") Then
|
|
||||||
MensajeError = "Error CREA POLIZA NEGATIVA "
|
|
||||||
ErrorCancelar = True : Exit For
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
'AJUSTA POLIZA
|
|
||||||
If Not ErrorCancelar Then
|
|
||||||
If Not ObjAC.AjustaPoliza(IdPolizaNueva) Then
|
|
||||||
MensajeError = "Error AJUSTA POLIZA "
|
|
||||||
ErrorCancelar = True
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
'CANCELA IE
|
|
||||||
If Not ErrorCancelar Then
|
|
||||||
If Not ObjBancos.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, TxtFechaDocumento.Text.ToDate) Then
|
|
||||||
MensajeError = "CANCELA IE "
|
|
||||||
ErrorCancelar = True
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
Else
|
|
||||||
MensajeError = "Error IdPoliza 0 "
|
|
||||||
ErrorCancelar = True
|
|
||||||
End If
|
|
||||||
|
|
||||||
Else
|
|
||||||
|
|
||||||
'LIMPIA POLIZA PONIENDO IMPORTE EN CEROS
|
|
||||||
For Each dr As DataRow In dt.Rows
|
|
||||||
If Not ObjAC.UpdateMovimiento(dr("Id").ToString.ToEntero, dr("IdCuenta").ToString.ToEntero, dr("TipoMovto").ToString = "1", 0, dr("Referencia").ToString, dr("Concepto").ToString, dr("IdSegNeg").ToString.ToEntero, dr("Fecha").ToString.ToDate) Then
|
|
||||||
MensajeError = "Error LIMPIA POLIZA PONIENDO IMPORTE EN CEROS "
|
|
||||||
ErrorCancelar = True : Exit For
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
'AJUSTA POLIZA
|
|
||||||
If Not ErrorCancelar Then
|
|
||||||
If Not ObjAC.AjustaPoliza(IDPoliza) Then
|
|
||||||
MensajeError = "Error AJUSTA POLIZA "
|
|
||||||
ErrorCancelar = True
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
'CANCELA IE
|
|
||||||
If Not ErrorCancelar Then
|
|
||||||
If Not ObjBancos.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, TxtFechaDocumento.Text.ToDate) Then
|
|
||||||
MensajeError = "Error CANCELA IE "
|
|
||||||
ErrorCancelar = True
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
|
|
||||||
If FechaCorteIE.LastDayOfMonth > TxtFechaDocumento.Text.ToDate.LastDayOfMonth Then
|
|
||||||
'CANCELA IE MES ANTERIOR
|
|
||||||
If Not ObjBancos.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FechaCorteIE) Then
|
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "Cancelar IE MES ANTERIOR "
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
'CANCELA IE MES ACTUAL
|
|
||||||
If Not ObjBancos.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, TxtFechaDocumento.Text.ToDate) Then
|
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "Cancelar IE MES ACTUAL "
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Not ErrorCancelar Then
|
|
||||||
If ObjBancos.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) Then
|
|
||||||
|
|
||||||
Dim CveComplementoPago As Integer = -1
|
|
||||||
|
|
||||||
If ObjBancos.DtResultados.Rows.Count > 0 Then
|
|
||||||
'OBTENEMOS EL UUID DEL COMPLEMENTO A CANCELAR POR SUSTITUCION
|
|
||||||
CFDIRelacionadoSustitucion = ObjBancos.DtResultados.Rows(0)("FolioFiscal").ToString
|
|
||||||
CveComplementoPago = ObjBancos.DtResultados(0)("CveComplementoPago").ToString().ToEntero
|
|
||||||
End If
|
|
||||||
|
|
||||||
'ACTUALIZA FOLIOS CANCELADOS
|
|
||||||
If ObjBancos.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "SerieFolio", "Fecha", "CveIE"}).Rows.Count > 0 Then
|
|
||||||
If Not ObjBancos.GetFoliosCancelados(UsuarioActual.CveEmpresa) Then
|
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "ACTUALIZA FOLIOS CANCELADOS"
|
|
||||||
Else
|
|
||||||
Dim FolioCancelado = $"{FolioIECancelado}_C_{ObjBancos.DtResultados(0)("Cantidad").ToString().ToEntero + 1}"
|
|
||||||
|
|
||||||
If Not ObjBancos.UpdateFolioCancelado(CveIE.ToEntero, Folio:=FolioCancelado) Then
|
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "UPDATE FOLIOS CANCELADOS"
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
'ACTUALIZA ESTATUS DE COMPLEMENTO DE PAGO A CANCELADO = 2
|
|
||||||
If Not ErrorCancelar And CveComplementoPago > 0 Then
|
|
||||||
If Not ObjBancos.UpdateComplementoPagoCancelado(CveComplementoPago, 2, UsuarioActual.Empresa.CvePAC, UsuarioActual.CveEmpresa, DateTime.Now) Then
|
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "ACTUALIZA ESTATUS DE COMPLEMENTO DE PAGO A CANCELADO = 2"
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
If Not ErrorCancelar Then
|
|
||||||
If ObjAC IsNot Nothing Then ObjAC.Commit()
|
|
||||||
ObjBancos.Commit()
|
|
||||||
|
|
||||||
Dim Msg As New StringBuilder
|
|
||||||
Msg.Append("El movimiento bancario quedó cancelado exitosamente.")
|
|
||||||
|
|
||||||
If IdPolizaNueva > 0 Then Msg.AppendFormat("<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza de cancelación</a>", IdPolizaNueva)
|
|
||||||
Alert(Msg.ToString, TipoMensaje.MsgInformacion)
|
|
||||||
Else
|
|
||||||
If ObjAC IsNot Nothing Then ObjAC.RollBack()
|
|
||||||
ObjBancos.RollBack()
|
|
||||||
Alert("El movimiento bancario no se pudo cancelar. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
|
||||||
GuardaLog(MensajeError)
|
|
||||||
End If
|
|
||||||
|
|
||||||
If ObjAC IsNot Nothing Then ObjAC.Dispose()
|
|
||||||
ObjBancos.Dispose()
|
|
||||||
End Sub
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region " ACTUALIZAR TIPO CAMBIO PREPOLIZA "
|
#Region " ACTUALIZAR TIPO CAMBIO PREPOLIZA "
|
||||||
@@ -5581,6 +5441,10 @@ Partial Class Bancos_IE
|
|||||||
|
|
||||||
Protected Sub LnkCancelarComplemetno_Click(sender As Object, e As EventArgs)
|
Protected Sub LnkCancelarComplemetno_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
If ChkConciliado.Checked Then
|
||||||
|
Alert("El documento seleccionado no se puede eliminar porque se encuentra conciliado.", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).BindingContainer, GridViewRow)
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).BindingContainer, GridViewRow)
|
||||||
|
|
||||||
@@ -5629,44 +5493,123 @@ Partial Class Bancos_IE
|
|||||||
|
|
||||||
Protected Sub BtnModalCancelarComplemento_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnModalCancelarComplemento_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
If RdlCancelarComplemento.SelectedValue.ToEntero = 1 Then
|
|
||||||
|
|
||||||
Dim ObjCancelacion As New Timbrado
|
If ChkConciliado.Checked Then
|
||||||
Dim ObjBanco As New ClsBancos
|
Alert("El documento seleccionado no se puede eliminar porque se encuentra conciliado.", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion) Then
|
TxtFechaCancelacion.Text = TxtFechaCancelarComplemento.Text
|
||||||
|
CancelarIE(True)
|
||||||
|
|
||||||
If ObjBanco.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse) Then
|
End Sub
|
||||||
CargaComplementosPago()
|
|
||||||
|
Protected Sub LnkCancelarComplementoImporte_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
If ChkConciliado.Checked Then
|
||||||
|
Alert("El documento seleccionado no se puede eliminar porque se encuentra conciliado.", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
Dim ObjBancos As New ClsBancos
|
||||||
|
Dim Respuesta As Boolean = False
|
||||||
|
Dim DTComplementos As New DataTable
|
||||||
|
|
||||||
|
If ObjBancos.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) Then
|
||||||
|
DTComplementos = ObjBancos.DtResultados.FiltraParametros(" Estatus IN (1,3) ")
|
||||||
|
End If
|
||||||
|
|
||||||
|
ObjBancos.Dispose()
|
||||||
|
|
||||||
|
If DTComplementos.Rows.Count = 1 Then
|
||||||
|
|
||||||
|
CveComplementoPagoCancelar = DTComplementos.Rows(0)("CveComplementoPago").ToString.ToEntero
|
||||||
|
FolioFiscalCancelar = DTComplementos.Rows(0)("FolioFiscal").ToString
|
||||||
|
RFCReceptorCancelar = DTComplementos.Rows(0)("RFCReceptor").ToString
|
||||||
|
CvePACCancelacion = DTComplementos.Rows(0)("CvePAC").ToString.ToEntero
|
||||||
|
|
||||||
|
RegistraScript("$('#ModalCancelarComplemetno').modal('show');")
|
||||||
|
DivFechaCancelación.Visible = True
|
||||||
|
UpModalCancelarComplemetno.Update()
|
||||||
|
|
||||||
|
Else
|
||||||
|
If DTComplementos.Rows.Count = 0 Then
|
||||||
|
Alert("No hay complementos vigentes")
|
||||||
|
Else
|
||||||
|
Alert($"Existe mas de un complemento vigente, complementos vigentes: { DTComplementos.Rows.Count }")
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Protected Sub BtnEditar_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
|
||||||
|
BtnActualizar.Visible = True
|
||||||
|
BtnEditar.Visible = False
|
||||||
|
UpGuardar.Update()
|
||||||
|
|
||||||
|
ControlesEdicion(True)
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ControlesEdicion(mostrar As Boolean)
|
||||||
|
|
||||||
|
|
||||||
|
If mostrar Then
|
||||||
|
|
||||||
|
DdlTipoTransaccion.Enabled = True
|
||||||
|
LblCuenta.Visible = False
|
||||||
|
DdlCuenta.Enabled = True
|
||||||
|
DdlCuenta.Visible = True
|
||||||
|
TxtFolio.Enabled = True
|
||||||
|
TxtObservaciones.Enabled = True
|
||||||
|
UpDatos.Update()
|
||||||
|
|
||||||
|
CargaCuentasDepositoClientes()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CargaCuentasDepositoClientes()
|
||||||
|
|
||||||
|
If DdlTipoTransaccion.SelectedValue = "9" And CveCliente > 0 Then
|
||||||
|
|
||||||
|
trCuentaDeposito.Visible = True
|
||||||
|
DdlCuentaDeposito.Enabled = True
|
||||||
|
|
||||||
|
|
||||||
|
Dim Dep As New ClsGenerales
|
||||||
|
If Dep.GetCuentasDepositos(CveCliente:=CveCliente) Then
|
||||||
|
|
||||||
|
DdlCuentaDeposito.DataSource = Dep.DtResultados
|
||||||
|
If Dep.DtResultados.Rows.Count > 0 Then
|
||||||
|
|
||||||
|
trCuentaDeposito.Visible = True
|
||||||
|
DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1"))
|
||||||
|
|
||||||
RegistraScript("$('#ModalCancelarComplemetno').modal('hide');")
|
|
||||||
Alert("El complemento se cancelo correctamente.")
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Else
|
|
||||||
Alert("Se presento un error al cancelar el complemento.")
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
ObjBanco.Dispose()
|
Dep.Dispose()
|
||||||
|
DdlCuentaDeposito.DataBind()
|
||||||
|
UpCuentaDeposito.Update()
|
||||||
|
|
||||||
|
|
||||||
Else
|
|
||||||
|
|
||||||
TxtFechaCancelacion.Text = TxtFechaCancelarComplemento.Text
|
|
||||||
CancelarIE(True)
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub RdlCancelarComplemento_SelectedIndexChanged(sender As Object, e As EventArgs)
|
|
||||||
|
|
||||||
|
|
||||||
If RdlCancelarComplemento.SelectedValue.ToEntero = 1 Then
|
|
||||||
DivFechaCancelación.Visible = False
|
|
||||||
Else
|
|
||||||
DivFechaCancelación.Visible = True
|
|
||||||
End If
|
|
||||||
|
|
||||||
UpModalCancelarComplemetno.Update()
|
|
||||||
|
|
||||||
End Sub
|
|
||||||
End Class
|
End Class
|
||||||
Reference in New Issue
Block a user