AGREGAR AGRUPADOR POR SI ES DISTRIBUCION
This commit is contained in:
@@ -661,6 +661,16 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
|
|
||||||
Protected Sub BtnIEGuardar_Click(sender As Object, e As EventArgs) Handles BtnIEGuardar.Click
|
Protected Sub BtnIEGuardar_Click(sender As Object, e As EventArgs) Handles BtnIEGuardar.Click
|
||||||
|
|
||||||
|
If Not TxtImporte.Text.ToDecimal > 0 Then
|
||||||
|
Alert("Debe de llevar un Importe", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not (TxtFolio.Text.Trim <> "" Or RblTipoPago.SelectedValue = "2" Or RblTipoPago.SelectedValue = "3") Then
|
||||||
|
Alert("Debe de llevar un Folio", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
Dim Cuenta As String = ""
|
Dim Cuenta As String = ""
|
||||||
Dim CuentaDeposito As String = ""
|
Dim CuentaDeposito As String = ""
|
||||||
|
|
||||||
@@ -676,7 +686,6 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Dim CvePrePoliza As Integer = 0
|
Dim CvePrePoliza As Integer = 0
|
||||||
Dim IDPoliza As Integer = 0
|
Dim IDPoliza As Integer = 0
|
||||||
Dim FolioPoliza As String = ""
|
Dim FolioPoliza As String = ""
|
||||||
@@ -684,6 +693,29 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
Dim CveVentasPago As New List(Of Integer)
|
Dim CveVentasPago As New List(Of Integer)
|
||||||
Dim SeriesPago As New List(Of String)
|
Dim SeriesPago As New List(Of String)
|
||||||
|
|
||||||
|
Dim MsgError As String = ""
|
||||||
|
Dim NCGeneradas As New List(Of Modelos.Factura.MMensajeFactura)
|
||||||
|
Dim ListaFacturasGenerarNC As New List(Of Modelos.Factura)
|
||||||
|
|
||||||
|
Dim ImporteSeleccionado As Decimal = 0
|
||||||
|
|
||||||
|
'02-05-2018 MANDAMOS CANCELAR EL COMPLEMENTO A SUSTITUIR
|
||||||
|
Dim ErrorCancelarIE As Boolean = False
|
||||||
|
|
||||||
|
If CveIESustitucion > 0 Then
|
||||||
|
ErrorCancelarIE = CancelarIE()
|
||||||
|
If ErrorCancelarIE Then
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim ObjIE As New ClsBancos()
|
||||||
|
Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL)
|
||||||
|
Dim ObjVentasSaldos As New ClsVentas(ObjIE.IniciaTransacSQL)
|
||||||
|
Dim ObjEvento As New ClsOIEventos(ObjIE.IniciaTransacSQL)
|
||||||
|
Dim ObjConta As ClsContPAQi = Nothing
|
||||||
|
|
||||||
|
Try
|
||||||
Dim filesgral As List(Of Archivo) = Anexo.getfiles().Archivos
|
Dim filesgral As List(Of Archivo) = Anexo.getfiles().Archivos
|
||||||
Dim filemove As String = ""
|
Dim filemove As String = ""
|
||||||
Dim Comprobante As String = ""
|
Dim Comprobante As String = ""
|
||||||
@@ -694,87 +726,6 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
filemove = fileItem.filename
|
filemove = fileItem.filename
|
||||||
Next
|
Next
|
||||||
|
|
||||||
Dim MsgError As String = ""
|
|
||||||
Dim NCGeneradas As New List(Of Modelos.Factura.MMensajeFactura)
|
|
||||||
Dim ListaFacturasGenerarNC As New List(Of Modelos.Factura)
|
|
||||||
|
|
||||||
'comentada RMF 2018.09.28
|
|
||||||
'Dim Dep As New ClsGenerales
|
|
||||||
'If Dep.GetCuentasDepositos(CveCliente:=CveCliente) Then
|
|
||||||
' Dim Row = Dep.DtResultados.FiltroPrimero(String.Format("CveCuentaDeposito = {0}", DdlCuentaDeposito.SelectedValue.ToEntero))
|
|
||||||
' If Row IsNot Nothing AndAlso Row("Estatus").ToString = "False" Then
|
|
||||||
' Alert("La cuenta depósito del proveedor esta inactiva.", TipoMensaje.MsgAdvertencia)
|
|
||||||
' Dep.Dispose()
|
|
||||||
' Exit Sub
|
|
||||||
' End If
|
|
||||||
'End If
|
|
||||||
'Dep.Dispose()
|
|
||||||
|
|
||||||
Dim ImporteSeleccionado As Decimal = 0
|
|
||||||
'If Not UsuarioActual.Empresa.Funcionalidad(529) = "1" Then
|
|
||||||
' Dim Validada As Boolean = False
|
|
||||||
' Dim MsgValidadas As New StringBuilder
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'If Not UsuarioActual.Empresa.Funcionalidad(529) = "1" Then
|
|
||||||
|
|
||||||
|
|
||||||
' Dim Valida As New ClsValidaCFDi()
|
|
||||||
|
|
||||||
' 'veririco ante el SAT las ventas que voy a pagar
|
|
||||||
' For Each gvr As GridViewRow In GvCxC.Rows
|
|
||||||
' If gvr.FCCheckBox("Chk").Checked Then
|
|
||||||
' ImporteSeleccionado += gvr.FCTextBox("TxtAbonar").Text.ToDecimal
|
|
||||||
|
|
||||||
' If gvr.DataKey("UUID") <> "" Then
|
|
||||||
|
|
||||||
' Valida.Verificar(gvr.DataKey("UUID"), gvr.DataKey("RFC"), UsuarioActual.Empresa.RFC, gvr.DataKey("Original").ToDecimal)
|
|
||||||
|
|
||||||
' If Valida.EsValida > 0 Then
|
|
||||||
' If Valida.EsValida = 2 Then 'Cancelada
|
|
||||||
' MsgValidadas.AppendFormat("La factura está cancelada ante el SAT: {0}<br>", gvr.DataKey("SerieFolio"))
|
|
||||||
' Else
|
|
||||||
' Validada = True
|
|
||||||
' End If
|
|
||||||
' Else
|
|
||||||
' Validada = True
|
|
||||||
' End If
|
|
||||||
' End If
|
|
||||||
' End If
|
|
||||||
' Next
|
|
||||||
' Valida.Dispose()
|
|
||||||
|
|
||||||
'End If
|
|
||||||
|
|
||||||
' If MsgValidadas.Length > 0 Then
|
|
||||||
' Alert(String.Format("<br>Las Facturas presentan la siguiente situación ante el SAT. <br>{0}", MsgValidadas.ToString), TipoMensaje.MsgAdvertencia)
|
|
||||||
' Exit Sub
|
|
||||||
' End If
|
|
||||||
'End If
|
|
||||||
|
|
||||||
|
|
||||||
Dim ObjIE As New ClsBancos()
|
|
||||||
Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL)
|
|
||||||
Dim ObjVentasSaldos As New ClsVentas(ObjIE.IniciaTransacSQL)
|
|
||||||
Dim ObjConta As ClsContPAQi = Nothing
|
|
||||||
|
|
||||||
Dim ObjEvento As ClsOIEventos = New ClsOIEventos()
|
|
||||||
|
|
||||||
If TxtImporte.Text.ToDecimal > 0 Then
|
|
||||||
|
|
||||||
'02-05-2018 MANDAMOS CANCELAR EL COMPLEMENTO A SUSTITUIR
|
|
||||||
Dim ErrorCancelarIE As Boolean = False
|
|
||||||
|
|
||||||
If CveIESustitucion > 0 Then
|
|
||||||
ErrorCancelarIE = CancelarIE()
|
|
||||||
If ErrorCancelarIE Then
|
|
||||||
'Alert("Ocurrio un error al Cancelar el IE.", TipoMensaje.MsgError)
|
|
||||||
Exit Sub
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
If TxtFolio.Text.Trim <> "" Or RblTipoPago.SelectedValue = "2" Or RblTipoPago.SelectedValue = "3" Then
|
|
||||||
Dim ConceptoPoliza As String = String.Format("{0} {1}", TxtAboneA.Text, TxtObservaciones.Text)
|
Dim ConceptoPoliza As String = String.Format("{0} {1}", TxtAboneA.Text, TxtObservaciones.Text)
|
||||||
|
|
||||||
If DdlCuenta.SelectedValue > 0 Then
|
If DdlCuenta.SelectedValue > 0 Then
|
||||||
@@ -1599,11 +1550,11 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim ErrorAC As Boolean = False
|
||||||
|
|
||||||
If MsgError = "" Then
|
If MsgError = "" Then
|
||||||
'se agregan las pólizas de Armonización Contable
|
|
||||||
If UsuarioActual.Empresa.UsaAC Then
|
If UsuarioActual.Empresa.UsaAC Then
|
||||||
Dim Fecha As Date = TxtFechaDocumento.Text.Trim.ToDate
|
Dim Fecha As Date = TxtFechaDocumento.Text.Trim.ToDate
|
||||||
Dim ErrorAC As Boolean = False
|
|
||||||
ObjConta = New ClsContPAQi(UsuarioActual.Empresa)
|
ObjConta = New ClsContPAQi(UsuarioActual.Empresa)
|
||||||
ObjConta.IniciaTransacSQL()
|
ObjConta.IniciaTransacSQL()
|
||||||
Dim Facturas As New StringBuilder
|
Dim Facturas As New StringBuilder
|
||||||
@@ -1629,23 +1580,9 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
Total = drt("TotalPresupuesto").ToString.ToDecimal * PorcentajePago
|
Total = drt("TotalPresupuesto").ToString.ToDecimal * PorcentajePago
|
||||||
ConceptoRenglon = String.Format("{0} {1}", gvr.DataKey("SerieFolio"), drt("FuenteRecaudacionRubroIngreso").ToString)
|
ConceptoRenglon = String.Format("{0} {1}", gvr.DataKey("SerieFolio"), drt("FuenteRecaudacionRubroIngreso").ToString)
|
||||||
If Total > 0 Then
|
If Total > 0 Then
|
||||||
|
|
||||||
'' NO DEBERIA
|
|
||||||
'If gvr.DataKey("TipoDocto").Contiene("Com") Then
|
|
||||||
' If Not ObjConta.AddMovimiento(IDPoliza, drt("IdCuentaPorEjecutar").ToString.ToEntero, False, Total, "", ConceptoRenglon, 0, Fecha, "") Then ErrorAC = True : Exit For
|
|
||||||
' If Not ObjConta.AddMovimiento(IDPoliza, drt("IdCuentaDevengado").ToString.ToEntero, True, Total, "", ConceptoRenglon, 0, Fecha, "") Then ErrorAC = True : Exit For
|
|
||||||
' If Not ObjConta.AddMovimiento(IDPoliza, drt("IdCuentaMatriz").ToString.ToEntero, True, Total, "", ConceptoRenglon, 0, Fecha, "") Then ErrorAC = True : Exit For
|
|
||||||
'End If
|
|
||||||
'' NO DEBERIA
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If Not ObjConta.AddMovimiento(IDPoliza, drt("IdCuentaDevengado").ToString.ToEntero, False, Total, "", ConceptoRenglon, 0, Fecha, "") Then ErrorAC = True : Exit For : Exit For
|
If Not ObjConta.AddMovimiento(IDPoliza, drt("IdCuentaDevengado").ToString.ToEntero, False, Total, "", ConceptoRenglon, 0, Fecha, "") Then ErrorAC = True : Exit For : Exit For
|
||||||
|
|
||||||
If Not ObjConta.AddMovimiento(IDPoliza, drt("IdCuentaRecaudado").ToString.ToEntero, True, Total, "", ConceptoRenglon, 0, Fecha, "") Then ErrorAC = True : Exit For : Exit For
|
If Not ObjConta.AddMovimiento(IDPoliza, drt("IdCuentaRecaudado").ToString.ToEntero, True, Total, "", ConceptoRenglon, 0, Fecha, "") Then ErrorAC = True : Exit For : Exit For
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
@@ -1672,44 +1609,41 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
ErrorAC = True
|
ErrorAC = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not ErrorAC Then
|
ErrorAC = Not ObjConta.AjustaPoliza(IDPoliza)
|
||||||
ObjConta.AjustaPoliza(IDPoliza)
|
|
||||||
ObjIE.UpdateIEPrePoliza(Fecha, FolioPoliza.ToString, IDPoliza, CvePrePoliza, CveIE, 0)
|
|
||||||
ObjIE.Commit()
|
|
||||||
ObjConta.Commit()
|
|
||||||
UPVentas.Update()
|
|
||||||
|
|
||||||
|
ErrorAC = Not ObjIE.UpdateIEPrePoliza(Fecha, FolioPoliza.ToString, IDPoliza, CvePrePoliza, CveIE, 0)
|
||||||
Dim TextoComplementoPago = EmitirComplementoPago(CveIE, CveVentasPago, SeriesPago)
|
|
||||||
Dim SbMensaje As New StringBuilder
|
|
||||||
SbMensaje.Append(String.Format("Abono Registrado Correctamente.<br/><br/> Poliza: <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>{1}</a><br/><br/>{2}", IDPoliza, FolioPoliza, TextoComplementoPago))
|
|
||||||
|
|
||||||
For Each NC In NCGeneradas
|
|
||||||
For Each msg In NC.Mensajes
|
|
||||||
SbMensaje.Append(msg)
|
|
||||||
Next
|
|
||||||
SbMensaje.Append("</br>")
|
|
||||||
Next
|
|
||||||
|
|
||||||
Alert(SbMensaje.ToString())
|
|
||||||
Else
|
|
||||||
ObjIE.RollBack()
|
|
||||||
If ObjConta IsNot Nothing Then ObjConta.RollBack()
|
|
||||||
Alert("Error al Agregar la Póliza de Armonización Contable.", TipoMensaje.MsgError)
|
|
||||||
End If
|
End If
|
||||||
ObjConta.Dispose()
|
End If
|
||||||
Else
|
|
||||||
|
If ErrorAC Then
|
||||||
|
MsgError = "Error al Agregar la Póliza de Armonización Contable"
|
||||||
|
End If
|
||||||
|
|
||||||
|
'BITACORA
|
||||||
|
If MsgError = "" Then
|
||||||
|
If CveIESustitucion > 0 And ComplementoSustitucionGenerado Then
|
||||||
|
If Not ObjEvento.AddEventoBitacora($"Complemento de pago Cancelado por sustitución con Folio <a href='/Bancos/IE.aspx?CveIE={CveIE}' target='_blank' class='Texto'>{TxtFolio.Text}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=CveIESustitucion) Then
|
||||||
|
MsgError = "Ocurrió un error al agregar la bitacora"
|
||||||
|
End If
|
||||||
|
If Not ObjEvento.AddEventoBitacora($"Complemento de pago Generado por Sustitución de <a href='/Bancos/IE.aspx?CveIE={CveIESustitucion}' target='_blank' class='Texto'>{FolioIECancelado}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=CveIE) Then
|
||||||
|
MsgError = "Ocurrió un error al agregar la bitacora"
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
MsgError = "Ocurrió un error al guardar el movimiento"
|
||||||
|
OnError("Ocurrió un error al guardar el movimiento", ex)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
If MsgError = "" Then
|
||||||
ObjIE.Commit()
|
ObjIE.Commit()
|
||||||
If ObjConta IsNot Nothing Then ObjConta.Commit()
|
If ObjConta IsNot Nothing Then ObjConta.Commit()
|
||||||
UPVentas.Update()
|
|
||||||
|
|
||||||
Dim StrMsg As New StringBuilder
|
Dim StrMsg As New StringBuilder
|
||||||
StrMsg.Append("Abono Registrado Correctamente.<br/>")
|
StrMsg.Append("Abono Registrado Correctamente.<br/>")
|
||||||
|
|
||||||
|
|
||||||
StrMsg.AppendFormat("Folio <b><a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>{1}</a></b>", CveIE, ObjIE.Folio)
|
StrMsg.AppendFormat("Folio <b><a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>{1}</a></b>", CveIE, ObjIE.Folio)
|
||||||
|
|
||||||
|
|
||||||
If IDPoliza > 0 Then StrMsg.AppendFormat("<br/> Poliza: <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>{1}</a>", IDPoliza, FolioPoliza)
|
If IDPoliza > 0 Then StrMsg.AppendFormat("<br/> Poliza: <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>{1}</a>", IDPoliza, FolioPoliza)
|
||||||
|
|
||||||
Dim TextoComplementoPago = EmitirComplementoPago(CveIE, CveVentasPago, SeriesPago)
|
Dim TextoComplementoPago = EmitirComplementoPago(CveIE, CveVentasPago, SeriesPago)
|
||||||
@@ -1725,35 +1659,23 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
Next
|
Next
|
||||||
|
|
||||||
Alert($"{StrMsg.ToString}<br/><br/>{TextoComplementoPago}", TipoMensaje.MsgInformacion, If(ChkSeguirRegistrando.Checked, "location.href =""#""", "location.href =""/Bancos/RepCxCCliente.aspx"""))
|
Alert($"{StrMsg.ToString}<br/><br/>{TextoComplementoPago}", TipoMensaje.MsgInformacion, If(ChkSeguirRegistrando.Checked, "location.href =""#""", "location.href =""/Bancos/RepCxCCliente.aspx"""))
|
||||||
End If
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
|
If ObjConta IsNot Nothing Then ObjConta.RollBack()
|
||||||
ObjIE.RollBack()
|
ObjIE.RollBack()
|
||||||
Alert(MsgError, TipoMensaje.MsgAdvertencia)
|
Alert(MsgError, TipoMensaje.MsgAdvertencia)
|
||||||
End If
|
End If
|
||||||
Else
|
|
||||||
Alert("Debe de llevar un Folio", TipoMensaje.MsgAdvertencia)
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
Alert("Debe de llevar un Importe", TipoMensaje.MsgAdvertencia)
|
|
||||||
End If
|
|
||||||
|
|
||||||
ObjIE.Dispose()
|
ObjIE.Dispose()
|
||||||
ObjVentasSaldos.Dispose()
|
ObjVentasSaldos.Dispose()
|
||||||
ObjMov.Dispose()
|
ObjMov.Dispose()
|
||||||
|
If ObjConta IsNot Nothing Then ObjConta.Dispose()
|
||||||
'BITACORA
|
|
||||||
If CveIESustitucion > 0 And ComplementoSustitucionGenerado Then
|
|
||||||
If Not ObjEvento.AddEventoBitacora($"Complemento de pago Cancelado por sustitución con Folio <a href='/Bancos/IE.aspx?CveIE={CveIE}' target='_blank' class='Texto'>{TxtFolio.Text}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=CveIESustitucion) Then
|
|
||||||
|
|
||||||
End If
|
|
||||||
If Not ObjEvento.AddEventoBitacora($"Complemento de pago Generado por Sustitución de <a href='/Bancos/IE.aspx?CveIE={CveIESustitucion}' target='_blank' class='Texto'>{FolioIECancelado}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=CveIE) Then
|
|
||||||
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
ObjEvento.Dispose()
|
ObjEvento.Dispose()
|
||||||
|
|
||||||
LimpiaCampos()
|
LimpiaCampos()
|
||||||
|
|
||||||
|
UPVentas.Update()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#Region " N O T A - D E - C R E D I T O"
|
#Region " N O T A - D E - C R E D I T O"
|
||||||
@@ -1764,31 +1686,42 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
ObjFacturaDevolucion.CveUsuario = UsuarioActual.CveUsuario
|
ObjFacturaDevolucion.CveUsuario = UsuarioActual.CveUsuario
|
||||||
ObjFacturaDevolucion.UsuarioCreo = UsuarioActual.Usuario
|
ObjFacturaDevolucion.UsuarioCreo = UsuarioActual.Usuario
|
||||||
|
|
||||||
'If CveVentaPadre > 0 Then
|
Dim CveSubProyecto As Integer = Me.CveSubProyecto
|
||||||
' ObjFacturaDevolucion.CveVentaPadre = CveVentaPadre
|
Dim CveMoneda As Integer = Me.CveMoneda
|
||||||
' ObjFacturaDevolucion.CveVentaRelacion = CveVentaPadre
|
Dim CveCliente As Integer = Me.CveCliente
|
||||||
|
|
||||||
|
If CveSubProyecto <= 0 Then
|
||||||
|
CveSubProyecto = ListaVentasGenerarNC(0).CveSubProyecto
|
||||||
|
End If
|
||||||
|
|
||||||
|
If CveMoneda <= 0 Then
|
||||||
|
CveMoneda = ListaVentasGenerarNC(0).CveMoneda
|
||||||
|
End If
|
||||||
|
|
||||||
|
If CveCliente <= 0 Then
|
||||||
|
CveCliente = ListaVentasGenerarNC(0).CveCliente
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim Folio As Integer = -1
|
||||||
|
Dim Serie As String = "-1"
|
||||||
|
|
||||||
|
'Dim ObjFolios As New ClsGralFolios()
|
||||||
|
'If ObjFolios.GetFolios("Egs", UsuarioActual.CveEmpresa) Then
|
||||||
|
' Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" Estado = 'Activo' AND CveSubProyecto = {0}", Me.CveSubProyecto))
|
||||||
|
' If DT.Rows.Count > 0 Then
|
||||||
|
' Serie = DT.Rows(0)("Serie").ToString()
|
||||||
|
' Folio = DT.Rows(0)("FActual").ToString()
|
||||||
|
' End If
|
||||||
|
' DT.Dispose()
|
||||||
'End If
|
'End If
|
||||||
|
'ObjFolios.Dispose()
|
||||||
Dim Folio As String = ""
|
|
||||||
Dim Serie As String = ""
|
|
||||||
|
|
||||||
Dim ObjFolios As New ClsGralFolios()
|
|
||||||
If ObjFolios.GetFolios("Egs", UsuarioActual.CveEmpresa) Then
|
|
||||||
Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" Estado = 'Activo' AND CveSubProyecto = {0}", Me.CveSubProyecto))
|
|
||||||
If DT.Rows.Count > 0 Then
|
|
||||||
Serie = DT.Rows(0)("Serie").ToString()
|
|
||||||
Folio = DT.Rows(0)("FActual").ToString()
|
|
||||||
End If
|
|
||||||
DT.Dispose()
|
|
||||||
End If
|
|
||||||
ObjFolios.Dispose()
|
|
||||||
|
|
||||||
ObjFacturaDevolucion.CveEmpresa = UsuarioActual.CveEmpresa
|
ObjFacturaDevolucion.CveEmpresa = UsuarioActual.CveEmpresa
|
||||||
ObjFacturaDevolucion.TipoCambio = If(Me.CveMoneda = 1, 1, GlobalTipoCambio(Now).FormatoNumero(4).ToDecimal())
|
ObjFacturaDevolucion.TipoCambio = If(Me.CveMoneda = 1, 1, GlobalTipoCambio(Now).FormatoNumero(4).ToDecimal())
|
||||||
ObjFacturaDevolucion.ConvertirPesos = False
|
ObjFacturaDevolucion.ConvertirPesos = False
|
||||||
ObjFacturaDevolucion.CveMoneda = Me.CveMoneda
|
ObjFacturaDevolucion.CveMoneda = CveMoneda
|
||||||
ObjFacturaDevolucion.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {Me.CveMoneda}")
|
ObjFacturaDevolucion.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {CveMoneda}")
|
||||||
ObjFacturaDevolucion.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {Me.CveMoneda}")
|
ObjFacturaDevolucion.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {CveMoneda}")
|
||||||
ObjFacturaDevolucion.Serie = Serie
|
ObjFacturaDevolucion.Serie = Serie
|
||||||
ObjFacturaDevolucion.Folio = Folio
|
ObjFacturaDevolucion.Folio = Folio
|
||||||
ObjFacturaDevolucion.Fecha = Now
|
ObjFacturaDevolucion.Fecha = Now
|
||||||
@@ -1812,10 +1745,10 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
ObjFacturaDevolucion.MetodoPago = ""
|
ObjFacturaDevolucion.MetodoPago = ""
|
||||||
ObjFacturaDevolucion.ClaveMetodoPagoSAT = GlobalDTMetodosPago.FiltroPrimeroValor("ClaveSAT", $"CveMetodoPago = {ObjFacturaDevolucion.CveMetodoPago33}")
|
ObjFacturaDevolucion.ClaveMetodoPagoSAT = GlobalDTMetodosPago.FiltroPrimeroValor("ClaveSAT", $"CveMetodoPago = {ObjFacturaDevolucion.CveMetodoPago33}")
|
||||||
|
|
||||||
ObjFacturaDevolucion.CveSubProyecto = Me.CveSubProyecto
|
ObjFacturaDevolucion.CveSubProyecto = CveSubProyecto
|
||||||
ObjFacturaDevolucion.SetSubProyecto()
|
ObjFacturaDevolucion.SetSubProyecto()
|
||||||
|
|
||||||
ObjFacturaDevolucion.CveCliente = Me.CveCliente
|
ObjFacturaDevolucion.CveCliente = CveCliente
|
||||||
ObjFacturaDevolucion.SetCliente()
|
ObjFacturaDevolucion.SetCliente()
|
||||||
|
|
||||||
Dim ObjCliente As New ClsClientes
|
Dim ObjCliente As New ClsClientes
|
||||||
@@ -1866,10 +1799,6 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
ObjFacturaDevolucion.TipoDocumento = ""
|
ObjFacturaDevolucion.TipoDocumento = ""
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
If ObjFacturaDevolucion.TipoDocto IsNot Nothing Then
|
|
||||||
ViewState("TipoDoctoDevolucion") = ObjFacturaDevolucion.TipoDocto
|
|
||||||
End If
|
|
||||||
|
|
||||||
ObjFacturaDevolucion.FechaPago = Now
|
ObjFacturaDevolucion.FechaPago = Now
|
||||||
|
|
||||||
ObjFacturaDevolucion.CveCorte = -1
|
ObjFacturaDevolucion.CveCorte = -1
|
||||||
@@ -1915,8 +1844,12 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
DtVentasNC.AcceptChanges()
|
DtVentasNC.AcceptChanges()
|
||||||
|
|
||||||
ObjFacturaDevolucion.DtVentasNC = DtVentasNC
|
ObjFacturaDevolucion.DtVentasNC = DtVentasNC
|
||||||
ObjFacturaDevolucion.GenerarPDFFactura = True
|
'ObjFacturaDevolucion.GenerarPDFFactura = True
|
||||||
Dim Resp = ObjFacturaDevolucion.EmitirFactura(False, Transac:=Trasac, ObjContPaqTransac:=ObjConta)
|
Dim Resp = ObjFacturaDevolucion.EmitirFactura(False, Transac:=Trasac, ObjContPaqTransac:=ObjConta)
|
||||||
|
|
||||||
|
ObjFacturaDevolucion.Dispose()
|
||||||
|
|
||||||
|
|
||||||
Return Resp
|
Return Resp
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
@@ -2825,6 +2758,7 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
Dim IdPolizaNueva = -1
|
Dim IdPolizaNueva = -1
|
||||||
Dim FolioPolizaNueva = -1
|
Dim FolioPolizaNueva = -1
|
||||||
|
|
||||||
|
Try
|
||||||
'CANCELA IE CONTABILIZADO
|
'CANCELA IE CONTABILIZADO
|
||||||
If IDPoliza > 0 Then
|
If IDPoliza > 0 Then
|
||||||
If ObjAC Is Nothing Then
|
If ObjAC Is Nothing Then
|
||||||
@@ -2943,10 +2877,14 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
ErrorCancelar = True
|
||||||
|
OnError("Ocurrió un error al cancelar el IE", ex)
|
||||||
|
End Try
|
||||||
|
|
||||||
If Not ErrorCancelar Then
|
If Not ErrorCancelar Then
|
||||||
If ObjAC IsNot Nothing Then ObjAC.Commit()
|
|
||||||
Banc.Commit()
|
Banc.Commit()
|
||||||
|
If ObjAC IsNot Nothing Then ObjAC.Commit()
|
||||||
|
|
||||||
Dim Msg As New StringBuilder
|
Dim Msg As New StringBuilder
|
||||||
Msg.Append("El movimiento bancario quedó cancelado exitosamente.")
|
Msg.Append("El movimiento bancario quedó cancelado exitosamente.")
|
||||||
@@ -2954,8 +2892,8 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
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)
|
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)
|
Alert(Msg.ToString, TipoMensaje.MsgInformacion)
|
||||||
Else
|
Else
|
||||||
If ObjAC IsNot Nothing Then ObjAC.RollBack()
|
|
||||||
Banc.RollBack()
|
Banc.RollBack()
|
||||||
|
If ObjAC IsNot Nothing Then ObjAC.RollBack()
|
||||||
Alert("El movimiento bancario no se pudo cancelar. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
Alert("El movimiento bancario no se pudo cancelar. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user