This commit is contained in:
2019-08-21 12:52:35 -07:00
9 changed files with 558 additions and 501 deletions

View File

@@ -1315,7 +1315,8 @@ Public Class ClsBancos
Return Retorno
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
DataAdapter("PA_Banc_IEUpdate")
@@ -1328,8 +1329,17 @@ Public Class ClsBancos
Else
.Add("@FechaAplicado", SqlDbType.DateTime).Value = FechaAplicado
End If
.Add("@CveIE", SqlDbType.Int).Value = CveIE
.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
Try

View File

@@ -154,7 +154,7 @@ Public Class ClsContabilidad
Retorno = SqlAdapter.SelectCommand.Parameters("@CvePrePoliza").Value.ToString.ToEntero
Catch ex As Exception
If ex.Message.Contains("50005;") Then
If ex.Message.Contains("50015;") Then
OnError("No se puede registrar una póliza en un ejercicio Cerrado", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
Else
OnError("Ocurrió un error al Guardar", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
@@ -500,7 +500,12 @@ Public Class ClsContabilidad
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al eliminar el movimiento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
If ex.Message.Contains("50015;") Then
OnError("No se puede eliminar una póliza en un ejercicio Cerrado", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
Else
OnError("Ocurrió un error al Guardar", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End If
End Try
Return Retorno
@@ -5662,12 +5667,13 @@ Public Class ClsContabilidad
#End Region
#Region "VALIDACION POLIZA DESCUADRADA"
Public Function ValidacionPrePolizaCuadre(CvePrePoliza As Integer, Opcion As Integer) As Boolean
Public Function ValidacionPrePolizaCuadre(CvePrePoliza As Integer, Opcion As Integer, Optional CveVenta As Integer = -1) As Boolean
Dim Retorno = False
DataAdapter("PA_Conta_PrePoliza_Validacion")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@Opcion", SqlDbType.Int).Value = Opcion
.Add("@Valor", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@MsgSalida", SqlDbType.VarChar, 100).Direction = ParameterDirection.Output

View File

@@ -11,17 +11,14 @@
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
<asp:Literal ID="LtlTitulo" runat="server" Text="Registro de Ingresos y Egresos"></asp:Literal>&nbsp;<asp:Literal ID="LtlIE" runat="server"></asp:Literal>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<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>
</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>
</li>
<asp:UpdatePanel runat="server" ID="UpAccionesComplementos">
<ContentTemplate>
<li>
@@ -30,7 +27,6 @@
</ContentTemplate>
</asp:UpdatePanel>
<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>
</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>
</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" data-original-title="¿Está seguro que desea cancelar el movimiento y complemento?" data-btn-ok-label="si" Style="color: #686868;"> <i class="fa fa-pencil"></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>
</ContentTemplate>
</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="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 Text="Editar" ID="BtnEditar" OnClick="BtnEditar_Click" CssClass="btn btn-primary" runat="server" Visible ="false" ValidationGroup="GrpGuardar" />
</ContentTemplate>
</asp:UpdatePanel>
</td>
@@ -1228,6 +1228,7 @@
<div class="modal-footer">
<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" />
</div>
</div>
</ContentTemplate>
@@ -1333,29 +1334,31 @@
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">CancelarComplemetno</h4>
<h4 class="modal-title">Cancelar Movimiento y Complemetno</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel ID="UpModalCancelarComplemetno" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<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:ListItem Value="1" Selected="True">Cancelar Complemento</asp:ListItem>
<asp:ListItem Value="2">Cancelar Pago y Complemento</asp:ListItem>
</asp:RadioButtonList>
</asp:RadioButtonList>--%>
</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">
Fecha Cancelación:
</div>
<div class="col-md-3">
<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>
<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>
@@ -1374,11 +1377,7 @@
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>

View File

@@ -410,6 +410,21 @@ Partial Class Bancos_IE
End Set
End Property
Private Property CveEstatusIE As Integer
Get
If ViewState("CveEstatusIE") Is Nothing Then
Return -1
Else
Return ViewState("CveEstatusIE").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("CveEstatusIE") = value
End Set
End Property
#Region "CANCELACIÓN COMPLEMENTO MODAL V2"
@@ -630,7 +645,7 @@ Partial Class Bancos_IE
End If
'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
If CveIE > 0 Then
LnkCancelar.Visible = False
@@ -674,6 +689,17 @@ Partial Class Bancos_IE
LnkAjustarMovimiento.Visible = True
End If
If Not VerificaComplementos(True) Then
LnkCancelarComplemento.Visible = False
LnkCancelarComplementoImporte.Visible = False
UppEliminarIE.Update()
End If
End If
End Sub
@@ -697,7 +723,7 @@ Partial Class Bancos_IE
CveIEDeposito2 = ObjIE.DtResultados(0)("CveIEDeposito2").ToString.ToEntero
If UsuarioActual.TienePermisoProceso(99) Then
BtnActualizar.Visible = True
'BtnActualizar.Visible = True
TxtFechaDocumento.Enabled = True
Calendario.Enabled = True
End If
@@ -749,6 +775,7 @@ Partial Class Bancos_IE
'ChkAplicaImpuestos.Checked = ObjIE.AplicaImpuestos
'ChkImpreso.Checked = ObjIE.FueImpreso
ChkConciliado.Checked = ObjIE.FueConciliado
DdlEstatusIE.SelectedValue = ObjIE.CveEstatusIE.ToString
DdlEstatusIE.Visible = False
LblEstatusIE.Visible = True
@@ -843,6 +870,8 @@ Partial Class Bancos_IE
LblRegistroFecha.Text = ObjIE.FechaIng.ToShortDateString
LblRegistroUsuario.Text = ObjIE.Usuario
CveEstatusIE = ObjIE.CveEstatusIE
Select Case ObjIE.CveEstatusIE
Case 1
If Not ObjIE.FueConciliado Then
@@ -942,6 +971,7 @@ Partial Class Bancos_IE
LnkComplementoPago.Visible = True
If ObjIE.CveEstatusIE = 1 AndAlso ObjIE.CveIECancelado > 0 Then
'cuando es cheque devuelto
TabCancelacion.Visible = True
@@ -1044,6 +1074,19 @@ Partial Class Bancos_IE
Alert("El Documento solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
BtnGuardar.Enabled = False
End If
If Not ChkConciliado.Checked Then
If (Not VerificaComplementos(True)) And UsuarioActual.TienePermisoProceso(99) And ObjIE.CveEstatusIE <> 2 Then
BtnEditar.Visible = True
End If
UpGuardar.Update()
End If
End If
'If CveIE > 0 Then
@@ -3638,14 +3681,22 @@ Partial Class Bancos_IE
'End If
Protected Sub BtnActualizar_Click(sender As Object, e As EventArgs) Handles BtnActualizar.Click
Dim IE As New ClsBancos
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
IE.Dispose()
End Sub
Protected Sub ImgUpdateCuentaDeposito_Click(sender As Object, e As ImageClickEventArgs)
@@ -4524,6 +4575,8 @@ Partial Class Bancos_IE
UpDatos.Update()
End Sub
Private Sub RecargaCuentasDepositos()
If CveProveedor > 0 Then
Dim dr As DataRow = GlobalDTTipoTransacciones.FiltroPrimero(String.Format("CveTipoTransaccion = {0}", DdlTipoTransaccion.SelectedValue)) 'Egs o Ing
@@ -4534,6 +4587,12 @@ Partial Class Bancos_IE
CargaCuentasDepositos()
End If
If CveCliente > 0 Then
CargaCuentasDepositoClientes()
End If
End Sub
'Recaga CuentasBancarias de Proveedor
@@ -4720,23 +4779,25 @@ Partial Class Bancos_IE
#Region " COMPLEMENTOS PAGO "
Private Sub CargaComplementosPago()
Dim ObjBancos As New ClsBancos
If UsuarioActual.CveRol = 1 Then
GvComplementoPagos.Columns(7).Visible = True
End If
DVGenerarComplementoModal.Visible = False
If ObjBancos.GetVincularPago(CveProveedor, CveCompra, 2, MinFecha, MaxFecha, UsuarioActual.CveEmpresa, CveIE) Then
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 And CveEstatusIE <> 2 Then
DVGenerarComplementoModal.Visible = True
Else
DVGenerarComplementoModal.Visible = False
End If
Else
DVGenerarComplementoModal.Visible = False
GvComplementoPagos.DataSource = Nothing
End If
@@ -4808,14 +4869,25 @@ Partial Class Bancos_IE
Private Function VerificaComplementos() As Boolean
Private Function VerificaComplementos(Validos As Boolean) As Boolean
Dim ObjBancos As New ClsBancos
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
Else
Retorno = False
End If
ObjBancos.Dispose()
Return Retorno
End Function
@@ -4828,203 +4900,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), "")
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
#Region " ACTUALIZAR TIPO CAMBIO PREPOLIZA "
@@ -5581,6 +5457,10 @@ Partial Class Bancos_IE
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)
@@ -5629,44 +5509,123 @@ Partial Class Bancos_IE
Protected Sub BtnModalCancelarComplemento_Click(sender As Object, e As EventArgs)
If RdlCancelarComplemento.SelectedValue.ToEntero = 1 Then
Dim ObjCancelacion As New Timbrado
Dim ObjBanco As New ClsBancos
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
CargaComplementosPago()
RegistraScript("$('#ModalCancelarComplemetno').modal('hide');")
Alert("El complemento se cancelo correctamente.")
If ChkConciliado.Checked Then
Alert("El documento seleccionado no se puede eliminar porque se encuentra conciliado.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Else
Alert("Se presento un error al cancelar el complemento.")
End If
ObjBanco.Dispose()
Else
TxtFechaCancelacion.Text = TxtFechaCancelarComplemento.Text
CancelarIE(True)
End If
End Sub
Protected Sub RdlCancelarComplemento_SelectedIndexChanged(sender As Object, e As EventArgs)
Protected Sub LnkCancelarComplementoImporte_Click(sender As Object, e As EventArgs)
If RdlCancelarComplemento.SelectedValue.ToEntero = 1 Then
DivFechaCancelación.Visible = False
Else
DivFechaCancelación.Visible = True
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"))
End If
End If
Dep.Dispose()
DdlCuentaDeposito.DataBind()
UpCuentaDeposito.Update()
End If
End Sub
End Class

View File

@@ -121,6 +121,12 @@ Partial Class General_SaldosIniciales
Alert("El nombre de la treceava columna debe ser 'Plazo Cobranza'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If RblFormato.SelectedValue = "1" Then
If Not dt.Columns(14).ColumnName = "Es distribuidor" Then
Alert("El nombre de la catorceava columna debe ser 'Es distribuidor'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
End If
ElseIf RblFormato.SelectedValue = "3" Or RblFormato.SelectedValue = "4" Then
If Not dt.Columns(0).ColumnName = "Sucursal" Then
@@ -489,16 +495,17 @@ Partial Class General_SaldosIniciales
Dim Codigo As String = Row("Codigo").ToString
Dim Descripcion As String = Row("Descripcion").ToString
Dim TipoPS As String = Row("Tipo").ToString.Trim.ToUpper
Dim CodigoBarras As String = Row("Codigo Barras").ToString
Dim CodigoBarras As String = Row("Código Barras").ToString
Dim UnidadMedida As String = Row("Unidad Medida").ToString.Trim
Dim Clasificacion As String = Row("Clasificacion").ToString.Trim
Dim Marca As String = Row("Marca").ToString.Trim
Dim RinTamaño As String = Row("Tamaño de Rin").ToString.Trim
Dim Medida As String = Row("Medida").ToString.Trim
Dim SATClavePS As String = Row("Codigo SAT").ToString.Trim
Dim SATClaveUnidadMedida As String = Row("Clave Unidad").ToString.Trim
Dim Linea As String = Row("Linea").ToString.Trim
Dim Modelo As String = Row("Modelo").ToString.Trim
Dim RinTamaño As String = If(Row.Table.Columns.Contains("Tamaño de Rin"), Row("Tamaño de Rin").ToString.Trim, "")
Dim Medida As String = If(Row.Table.Columns.Contains("Medida"), Row("Medida").ToString.Trim, "")
Dim SATClavePS As String = Row("Código SAT").ToString.Trim
Dim SATClaveUnidadMedida As String = If(Row.Table.Columns.Contains("Clave Unidad"), Row("Clave Unidad").ToString.Trim, "")
Dim Linea As String = If(Row.Table.Columns.Contains("Linea"), Row("Linea").ToString.Trim, "")
Dim Modelo As String = If(Row.Table.Columns.Contains("Modelo"), Row("Modelo").ToString.Trim, "")
Dim Tamaño As String = Row("Tamaño").ToString.Trim
Dim CvePS As Integer = DTPS.FiltroPrimeroValor("CvePS", $"Codigo = '{Codigo}'").ToString.ToEntero
@@ -506,6 +513,7 @@ Partial Class General_SaldosIniciales
Dim CveClasificacion As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion}'").ToString.ToEntero
Dim CveUnidadMedida As Integer = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"UnidadMedida = '{UnidadMedida}'").ToString.ToEntero
Dim CveSATPS As Integer = GlobalDTPSATPS.FiltroPrimeroValor("CveSATPS", $"SATClavePS = '{SATClavePS}'").ToString.ToEntero
Dim CveTamaño As Integer = GlobalDTAcumTamaños.FiltroPrimeroValor("CveTamaño", $"Tamaño = '{Tamaño}'").ToString.ToEntero
If Not CveClasificacion > 0 AndAlso Clasificacion <> "" Then
If ObjClas.AddClasificaciones(Clasificacion, "", -1, "-1", -1, "-1", -1, "-1",
@@ -587,6 +595,8 @@ Partial Class General_SaldosIniciales
If Not ObjPS.UpdatePS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, 0, 1, 1, False, 0, True, True, True, UsuarioActual.CveUsuario, CvePS, -1, -1, CveSATPS,
CveTipoPS:=CveTipoPS, CveMarca:=CveMarca, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño,
CveModelo:=CveModelo) Then
'If Not ObjPS.UpdatePS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, 0, 1, 1, False, 0, True, True, True, UsuarioActual.CveUsuario, CvePS, -1, -1, CveSATPS,
' CveTipoPS:=CveTipoPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida) Then
ErrorPS = True
Codigo.GuardaLog
Exit For
@@ -595,8 +605,10 @@ Partial Class General_SaldosIniciales
End If
Else
If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", "", Descripcion, 0, 0, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1,
CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño,
CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño,
CveModelo:=CveModelo) <= 0 Then
'If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", "", Descripcion, 0, 0, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1,
' CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida) <= 0 Then
ErrorPS = True
Codigo.GuardaLog
Exit For
@@ -712,6 +724,7 @@ Partial Class General_SaldosIniciales
Dim Contacto As String = Row("Contacto").ToString
Dim CelularContacto As String = Row("Celular Contacto").ToString
Dim CveCliente As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString.ToEntero
Dim EsDistribuidor As Boolean = If(Row("Es distribuidor").ToString = "si", True, False)
If CveCliente > 0 Then
ExisteCliente = True
@@ -724,7 +737,7 @@ Partial Class General_SaldosIniciales
'End If
Else
If Not ObjClientes.AddCliente(RazonSocial, RazonSocial, Calle, "", "", Colonia, "", "", Estado, Pais, RFC, CodigoPostal, "", "", Contacto, "", "", "", "", -1, False, 0, 0, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", -1, -1, -1,
"-1", "-1", -1, "-1", -1, "0", -1, "0", 0, "", 0, "", 0, "", 0, "", "", "", Codigo, 0, "", 1, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False, 0, -1) Then
"-1", "-1", -1, "-1", -1, "0", -1, "0", 0, "", 0, "", 0, "", 0, "", "", "", Codigo, 0, "", 1, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False, 0, -1, EsDistribuidor:=EsDistribuidor) Then
ErrorClientes = True
RFC.GuardaLog
Exit For

45
SIGGIT.sln Normal file
View File

@@ -0,0 +1,45 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "http://localhost", "http://localhost", "{82D0C8D1-3CF5-471D-92AF-71A9AE4B4335}"
ProjectSection(WebsiteProperties) = preProject
SccProjectName = ""$/localhost", CAAAAAAA"
SccAuxPath = ""
SccLocalPath = "."
SccProvider = "MSSCCI:Microsoft Visual SourceSafe"
UseIISExpress = "false"
TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0"
Debug.AspNetCompiler.VirtualPath = "/localhost"
Debug.AspNetCompiler.PhysicalPath = "..\wwwSIG\"
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost\"
Debug.AspNetCompiler.Updateable = "true"
Debug.AspNetCompiler.ForceOverwrite = "true"
Debug.AspNetCompiler.FixedNames = "false"
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.VirtualPath = "/localhost"
Release.AspNetCompiler.PhysicalPath = "..\wwwSIG\"
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost\"
Release.AspNetCompiler.Updateable = "true"
Release.AspNetCompiler.ForceOverwrite = "true"
Release.AspNetCompiler.FixedNames = "false"
Release.AspNetCompiler.Debug = "False"
SlnRelativePath = "..\wwwSIG\"
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{82D0C8D1-3CF5-471D-92AF-71A9AE4B4335}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{82D0C8D1-3CF5-471D-92AF-71A9AE4B4335}.Debug|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {332C883B-3BAC-495B-9E95-82357599CF89}
EndGlobalSection
EndGlobal

View File

@@ -10215,6 +10215,10 @@ Partial Class Ventas
If ObjConta.ValidacionPrePolizaCuadre(ObjFactura.CvePrePoliza, 2) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
If ObjConta.ValorPolizaDescuadre = 2 Then
ErrorPrepoliza = True
Alert(ObjConta.MensajePolizaDescuadre, TipoMensaje.MsgError)
End If
'ErrorPrepoliza = True
GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{ObjFactura.CvePrePoliza}", "LogPrePolizas")
@@ -15669,6 +15673,15 @@ Partial Class Ventas
End If
End If
If ObjConta.ValidacionPrePolizaCuadre(-1, 2, CveVenta) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
If ObjConta.ValorPolizaDescuadre = 2 Then
OcurrioError = True
ErrorList.Add(ObjConta.MensajePolizaDescuadre)
End If
End If
End If
If Not OcurrioError Then
If RegeneracionPolizas(ObjVentas, ObjAC) Then
OcurrioError = True
@@ -21650,6 +21663,7 @@ Partial Class Ventas
Dim ObjVentas As New ClsVentas
Dim ObjCGame As New ClsCGame(ObjVentas.IniciaTransacSQL())
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
Dim OcurrioError = False
Dim MensajeError = ""
@@ -21703,6 +21717,15 @@ Partial Class Ventas
End If
End If
If ObjConta.ValidacionPrePolizaCuadre(-1, 2, CveVenta) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
If ObjConta.ValorPolizaDescuadre = 2 Then
OcurrioError = True
MensajeError = ObjConta.MensajePolizaDescuadre
End If
End If
End If
If OcurrioError Then
ObjVentas.RollBack()
Alert($"{MensajeError}. Por favor vuelva a intentar.", TipoMensaje.MsgError)
@@ -21721,6 +21744,8 @@ Partial Class Ventas
End If
ObjVentas.Dispose()
ObjConta.Dispose()
ObjCGame.Dispose()
End Sub
#End Region