-- mejora, en el constructor para cargar la info de la venta, sino se pudo cargar que genere un msg de error,
This commit is contained in:
@@ -446,7 +446,6 @@ Namespace Modelos
|
||||
Me.ErrorList = New List(Of String)
|
||||
Me.RemisionesLista = New List(Of Integer)
|
||||
Me.ListaMensajes = New List(Of String)
|
||||
Me.FolioFiscal = ""
|
||||
Me.GenerarPDFFactura = False
|
||||
IniciaValores()
|
||||
|
||||
@@ -454,7 +453,6 @@ Namespace Modelos
|
||||
If ObjVentas.GetVenta(CveVenta, CveEmpresa, VerificaAlmacen:=VerificaAlmacen) Then
|
||||
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
setValues(ObjVentas.DtResultados.Rows(0))
|
||||
|
||||
SetMetodoPago()
|
||||
SetMoneda()
|
||||
|
||||
@@ -469,28 +467,23 @@ Namespace Modelos
|
||||
Me.VentaDesglosaIEPS = True
|
||||
End If
|
||||
SetTotales(ObjVentas.DtResultados, ObjVentas)
|
||||
If CargaDTDetalle Then
|
||||
If ObjVentas.GetVentaDetalle(CveVenta) Then
|
||||
Me.DtDetalle = ObjVentas.DtResultados.Copy()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
ErrorList.Add("No se pudo cargar la información de la factura.")
|
||||
End If
|
||||
|
||||
If CargaDTDetalle Then
|
||||
If ObjVentas.GetVentaDetalle(CveVenta) Then
|
||||
Me.DtDetalle = ObjVentas.DtResultados.Copy()
|
||||
End If
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
|
||||
If CargaDatosCliente Then
|
||||
SetCliente()
|
||||
End If
|
||||
If CargaDatosCliente Then SetCliente()
|
||||
|
||||
If CargaDatosRelacionados Then
|
||||
IniciaValoresVentas(EsCancelacion)
|
||||
End If
|
||||
If CargaDatosRelacionados Then IniciaValoresVentas(EsCancelacion)
|
||||
|
||||
If String.IsNullOrEmpty(DirectorioServidor) Then DirectorioServidor = ModExtensiones.DirectorioBaseEmpresas
|
||||
|
||||
If String.IsNullOrEmpty(DirectorioServidor) Then
|
||||
DirectorioServidor = ModExtensiones.DirectorioBaseEmpresas
|
||||
End If
|
||||
Me.DirectorioServidor = DirectorioServidor
|
||||
Timbre = New CFDITimbre
|
||||
End Sub
|
||||
@@ -625,7 +618,6 @@ Namespace Modelos
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If ObjVentas.GetVentaOtrosConceptos(UsuarioActual.CveEmpresa, CveVenta) Then
|
||||
@@ -644,7 +636,6 @@ Namespace Modelos
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
ObjVentas.Dispose()
|
||||
|
||||
If Me.RealizarDevolucionAlmacen Then
|
||||
@@ -1278,7 +1269,6 @@ Namespace Modelos
|
||||
ObjFactura.FechaPago = DateTime.Today
|
||||
ObjFactura.FechaEjecucion = DateTime.Today
|
||||
ObjFactura.UsuarioCreo = UsuarioActual.Usuario
|
||||
ObjFactura.CondicionesPago = 0
|
||||
ObjFactura.TipoDocumento = ObjFactura.TipodeComprobante
|
||||
|
||||
'Totales, Y se llena TmpDTImpuestos
|
||||
@@ -4251,8 +4241,6 @@ Namespace Modelos
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -4263,7 +4251,6 @@ Namespace Modelos
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
'REGRESA SALDO A LAS REMISIONES QUE SE FACTURARON EN EL INGRESO QUE SE ESTA CANCELANDO
|
||||
'SE DEBE DE EXCLUIR CUANDO ES REFACTURACIÓN
|
||||
If ObjFactura.TipoDocto = "Ing" And ValorMultiplicador = -1 AndAlso CveEstatusRefacturacion = 0 AndAlso Not SeCancelaRemisionProceso AndAlso DtRemisionesRelacionadas IsNot Nothing Then ' se debe de excluir cuando es refacturación
|
||||
@@ -5278,6 +5265,20 @@ Namespace Modelos
|
||||
|
||||
Return ErrorPrepoliza
|
||||
End Function
|
||||
|
||||
Private Function GeneraIxC(factura As Modelos.Factura, ObjBanco As ClsBancos, ObjConta As ClsContabilidad, ImporteIxC As Decimal, CveIE As Integer) As Boolean
|
||||
Dim ErrorPrepoliza As Boolean = False
|
||||
|
||||
If factura.CvePrePoliza > 0 Then
|
||||
|
||||
Dim CveSubProyectoContabilizar As Integer = factura.CveSubProyecto
|
||||
|
||||
ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteIxC, ImporteIxC, 66, "", "", CveIE:=CveIE, CveCliente:=CveCliente)
|
||||
|
||||
End If
|
||||
|
||||
Return ErrorPrepoliza
|
||||
End Function
|
||||
Private Function GeneraNC(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjContr As ClsContratos, ByVal factura As Modelos.Factura, ByRef ObjBancos As ClsBancos, ByRef ObjEventos As ClsOIEventos) As List(Of Object)
|
||||
Dim Obj As New List(Of Object)
|
||||
Dim CveVentaNueva As Integer = ObjVentas.CveVenta
|
||||
@@ -5514,16 +5515,16 @@ Namespace Modelos
|
||||
''' <param name="RealizarDevolucionAlmacen"></param>
|
||||
''' <param name="ListaRemisionesCancelar"></param>
|
||||
''' <returns></returns>
|
||||
Public Function CancelarFactura(RealizarDevolucionAlmacen As Boolean, Optional ListaRemisionesCancelar As List(Of Integer) = Nothing, Optional CveMotivoCancelacion As Integer = -1, Optional Motivo As String = "", Optional ValidarSAT As Boolean = True, Optional CveEstadoCancelacion As Integer = 0, Optional CancelarBoletos As Boolean = False, Optional AplicaCancelacionConPagos As Boolean = False) As MCancelacionVentaMensaje
|
||||
Public Function CancelarFactura(RealizarDevolucionAlmacen As Boolean, Optional ListaRemisionesCancelar As List(Of Integer) = Nothing, Optional CveMotivoCancelacion As Integer = -1, Optional Motivo As String = "", Optional ValidarSAT As Boolean = True, Optional CveEstadoCancelacion As Integer = 0, Optional CancelarBoletos As Boolean = False, Optional AplicaCancelacionConPagos As Boolean = False, Optional GeneraIxCconPago As Boolean = False) As MCancelacionVentaMensaje
|
||||
'Comprobante emitido con errores sin relación
|
||||
Return CancelarVenta(Me, Me.UsuarioActual, RealizarDevolucionAlmacen:=RealizarDevolucionAlmacen, ListaRemisionesCancelar:=ListaRemisionesCancelar, CveMotivoCancelacion:=CveMotivoCancelacion, MotivoCancelacion:=Motivo, CveEstadoCancelacion:=CveEstadoCancelacion, CancelarBoletos:=CancelarBoletos, AplicaCancelacionConPagos:=AplicaCancelacionConPagos)
|
||||
Return CancelarVenta(Me, Me.UsuarioActual, RealizarDevolucionAlmacen:=RealizarDevolucionAlmacen, ListaRemisionesCancelar:=ListaRemisionesCancelar, CveMotivoCancelacion:=CveMotivoCancelacion, MotivoCancelacion:=Motivo, CveEstadoCancelacion:=CveEstadoCancelacion, CancelarBoletos:=CancelarBoletos, AplicaCancelacionConPagos:=AplicaCancelacionConPagos, GeneraIxCconPago:=GeneraIxCconPago)
|
||||
End Function
|
||||
|
||||
Private Function CancelarVenta(ObjFactura As Modelos.Factura, UsuarioActual As Usuario, Optional EsRefacturacion As Boolean = False, Optional RealizarDevolucionAlmacen As Boolean = False,
|
||||
Optional ListaRemisionesCancelar As List(Of Integer) = Nothing, Optional CveEstatusFacturaAsignado As Integer = -1, Optional FechaCancelacion As String = "-1",
|
||||
Optional AcuseCancelacion As String = "", Optional CveMotivoCancelacion As Integer = -1, Optional MotivoCancelacion As String = "",
|
||||
Optional FolioSustitucion As String = "", Optional ValidarSAT As Boolean = True, Optional CveEstadoCancelacion As Integer = 0,
|
||||
Optional CancelarBoletos As Boolean = False, Optional AplicaCancelacionConPagos As Boolean = False) As MCancelacionVentaMensaje
|
||||
Optional CancelarBoletos As Boolean = False, Optional AplicaCancelacionConPagos As Boolean = False, Optional GeneraIxCconPago As Boolean = False) As MCancelacionVentaMensaje
|
||||
Dim Retorno As New MCancelacionVentaMensaje()
|
||||
Dim ErrorList As New List(Of String)
|
||||
|
||||
@@ -6207,14 +6208,14 @@ Namespace Modelos
|
||||
Multiplicador = 1D
|
||||
End If
|
||||
|
||||
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
Dim Fecha As Date = ClsPaginas.NowADS()
|
||||
Dim CveCliente As Integer = ObjVentas.DtResultados(0)("CveCliente").ToString.ToEntero
|
||||
Dim ClienteNombre As String = ObjVentas.DtResultados(0)("ClienteNombre").ToString
|
||||
Dim SerieFolio As String = ObjVentas.DtResultados(0)("SerieFolio").ToString
|
||||
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD()
|
||||
Dim TotalCostoAcumulado As Decimal = 0
|
||||
Dim cont As Integer = 1
|
||||
'If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
Dim Fecha As Date = ClsPaginas.NowADS()
|
||||
Dim CveCliente As Integer = ObjFactura.CveCliente 'ObjVentas.DtResultados(0)("CveCliente").ToString.ToEntero
|
||||
Dim ClienteNombre As String = ObjFactura.Cliente.Nombre 'ObjVentas.DtResultados(0)("ClienteNombre").ToString
|
||||
Dim SerieFolio As String = ObjFactura.SerieFolio ' ObjVentas.DtResultados(0)("SerieFolio").ToString
|
||||
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD()
|
||||
Dim TotalCostoAcumulado As Decimal = 0
|
||||
Dim cont As Integer = 1
|
||||
|
||||
Dim CvePrePolizaDev As Integer = ObjConta.AddPrePolizas("Modelos/RecepcionEntrega", 4, TotalCosto, TotalCosto, 1, Fecha, ClienteNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
'SE AGREGA MOVIMIENTO SEPARADO POR LA CUENTA DE VENTAS (ER)
|
||||
@@ -6260,10 +6261,10 @@ Namespace Modelos
|
||||
MensajeError = "Ocurrió un error al contabilizar la prepoliza."
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Ocurrió un Error al ingresar las prepolizas"
|
||||
End If
|
||||
' Else
|
||||
'ErrorCancelar = True
|
||||
'MensajeError = "Ocurrió un Error al ingresar las prepolizas"
|
||||
'End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user