-- 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.ErrorList = New List(Of String)
|
||||||
Me.RemisionesLista = New List(Of Integer)
|
Me.RemisionesLista = New List(Of Integer)
|
||||||
Me.ListaMensajes = New List(Of String)
|
Me.ListaMensajes = New List(Of String)
|
||||||
Me.FolioFiscal = ""
|
|
||||||
Me.GenerarPDFFactura = False
|
Me.GenerarPDFFactura = False
|
||||||
IniciaValores()
|
IniciaValores()
|
||||||
|
|
||||||
@@ -454,7 +453,6 @@ Namespace Modelos
|
|||||||
If ObjVentas.GetVenta(CveVenta, CveEmpresa, VerificaAlmacen:=VerificaAlmacen) Then
|
If ObjVentas.GetVenta(CveVenta, CveEmpresa, VerificaAlmacen:=VerificaAlmacen) Then
|
||||||
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
|
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||||
setValues(ObjVentas.DtResultados.Rows(0))
|
setValues(ObjVentas.DtResultados.Rows(0))
|
||||||
|
|
||||||
SetMetodoPago()
|
SetMetodoPago()
|
||||||
SetMoneda()
|
SetMoneda()
|
||||||
|
|
||||||
@@ -469,28 +467,23 @@ Namespace Modelos
|
|||||||
Me.VentaDesglosaIEPS = True
|
Me.VentaDesglosaIEPS = True
|
||||||
End If
|
End If
|
||||||
SetTotales(ObjVentas.DtResultados, ObjVentas)
|
SetTotales(ObjVentas.DtResultados, ObjVentas)
|
||||||
|
If CargaDTDetalle Then
|
||||||
|
If ObjVentas.GetVentaDetalle(CveVenta) Then
|
||||||
|
Me.DtDetalle = ObjVentas.DtResultados.Copy()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
Else
|
||||||
|
ErrorList.Add("No se pudo cargar la información de la factura.")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If CargaDTDetalle Then
|
|
||||||
If ObjVentas.GetVentaDetalle(CveVenta) Then
|
|
||||||
Me.DtDetalle = ObjVentas.DtResultados.Copy()
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
ObjVentas.Dispose()
|
ObjVentas.Dispose()
|
||||||
|
|
||||||
If CargaDatosCliente Then
|
If CargaDatosCliente Then SetCliente()
|
||||||
SetCliente()
|
|
||||||
End If
|
|
||||||
|
|
||||||
If CargaDatosRelacionados Then
|
If CargaDatosRelacionados Then IniciaValoresVentas(EsCancelacion)
|
||||||
IniciaValoresVentas(EsCancelacion)
|
|
||||||
End If
|
If String.IsNullOrEmpty(DirectorioServidor) Then DirectorioServidor = ModExtensiones.DirectorioBaseEmpresas
|
||||||
|
|
||||||
If String.IsNullOrEmpty(DirectorioServidor) Then
|
|
||||||
DirectorioServidor = ModExtensiones.DirectorioBaseEmpresas
|
|
||||||
End If
|
|
||||||
Me.DirectorioServidor = DirectorioServidor
|
Me.DirectorioServidor = DirectorioServidor
|
||||||
Timbre = New CFDITimbre
|
Timbre = New CFDITimbre
|
||||||
End Sub
|
End Sub
|
||||||
@@ -625,7 +618,6 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ObjVentas.GetVentaOtrosConceptos(UsuarioActual.CveEmpresa, CveVenta) Then
|
If ObjVentas.GetVentaOtrosConceptos(UsuarioActual.CveEmpresa, CveVenta) Then
|
||||||
@@ -644,7 +636,6 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
ObjVentas.Dispose()
|
ObjVentas.Dispose()
|
||||||
|
|
||||||
If Me.RealizarDevolucionAlmacen Then
|
If Me.RealizarDevolucionAlmacen Then
|
||||||
@@ -1278,7 +1269,6 @@ Namespace Modelos
|
|||||||
ObjFactura.FechaPago = DateTime.Today
|
ObjFactura.FechaPago = DateTime.Today
|
||||||
ObjFactura.FechaEjecucion = DateTime.Today
|
ObjFactura.FechaEjecucion = DateTime.Today
|
||||||
ObjFactura.UsuarioCreo = UsuarioActual.Usuario
|
ObjFactura.UsuarioCreo = UsuarioActual.Usuario
|
||||||
ObjFactura.CondicionesPago = 0
|
|
||||||
ObjFactura.TipoDocumento = ObjFactura.TipodeComprobante
|
ObjFactura.TipoDocumento = ObjFactura.TipodeComprobante
|
||||||
|
|
||||||
'Totales, Y se llena TmpDTImpuestos
|
'Totales, Y se llena TmpDTImpuestos
|
||||||
@@ -4251,8 +4241,6 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -4263,7 +4251,6 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
'REGRESA SALDO A LAS REMISIONES QUE SE FACTURARON EN EL INGRESO QUE SE ESTA CANCELANDO
|
'REGRESA SALDO A LAS REMISIONES QUE SE FACTURARON EN EL INGRESO QUE SE ESTA CANCELANDO
|
||||||
'SE DEBE DE EXCLUIR CUANDO ES REFACTURACIÓN
|
'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
|
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
|
Return ErrorPrepoliza
|
||||||
End Function
|
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)
|
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 Obj As New List(Of Object)
|
||||||
Dim CveVentaNueva As Integer = ObjVentas.CveVenta
|
Dim CveVentaNueva As Integer = ObjVentas.CveVenta
|
||||||
@@ -5514,16 +5515,16 @@ Namespace Modelos
|
|||||||
''' <param name="RealizarDevolucionAlmacen"></param>
|
''' <param name="RealizarDevolucionAlmacen"></param>
|
||||||
''' <param name="ListaRemisionesCancelar"></param>
|
''' <param name="ListaRemisionesCancelar"></param>
|
||||||
''' <returns></returns>
|
''' <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
|
'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
|
End Function
|
||||||
|
|
||||||
Private Function CancelarVenta(ObjFactura As Modelos.Factura, UsuarioActual As Usuario, Optional EsRefacturacion As Boolean = False, Optional RealizarDevolucionAlmacen As Boolean = False,
|
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 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 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 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 Retorno As New MCancelacionVentaMensaje()
|
||||||
Dim ErrorList As New List(Of String)
|
Dim ErrorList As New List(Of String)
|
||||||
|
|
||||||
@@ -6207,14 +6208,14 @@ Namespace Modelos
|
|||||||
Multiplicador = 1D
|
Multiplicador = 1D
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
|
'If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||||
Dim Fecha As Date = ClsPaginas.NowADS()
|
Dim Fecha As Date = ClsPaginas.NowADS()
|
||||||
Dim CveCliente As Integer = ObjVentas.DtResultados(0)("CveCliente").ToString.ToEntero
|
Dim CveCliente As Integer = ObjFactura.CveCliente 'ObjVentas.DtResultados(0)("CveCliente").ToString.ToEntero
|
||||||
Dim ClienteNombre As String = ObjVentas.DtResultados(0)("ClienteNombre").ToString
|
Dim ClienteNombre As String = ObjFactura.Cliente.Nombre 'ObjVentas.DtResultados(0)("ClienteNombre").ToString
|
||||||
Dim SerieFolio As String = ObjVentas.DtResultados(0)("SerieFolio").ToString
|
Dim SerieFolio As String = ObjFactura.SerieFolio ' ObjVentas.DtResultados(0)("SerieFolio").ToString
|
||||||
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD()
|
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD()
|
||||||
Dim TotalCostoAcumulado As Decimal = 0
|
Dim TotalCostoAcumulado As Decimal = 0
|
||||||
Dim cont As Integer = 1
|
Dim cont As Integer = 1
|
||||||
|
|
||||||
Dim CvePrePolizaDev As Integer = ObjConta.AddPrePolizas("Modelos/RecepcionEntrega", 4, TotalCosto, TotalCosto, 1, Fecha, ClienteNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
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)
|
'SE AGREGA MOVIMIENTO SEPARADO POR LA CUENTA DE VENTAS (ER)
|
||||||
@@ -6260,10 +6261,10 @@ Namespace Modelos
|
|||||||
MensajeError = "Ocurrió un error al contabilizar la prepoliza."
|
MensajeError = "Ocurrió un error al contabilizar la prepoliza."
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Else
|
' Else
|
||||||
ErrorCancelar = True
|
'ErrorCancelar = True
|
||||||
MensajeError = "Ocurrió un Error al ingresar las prepolizas"
|
'MensajeError = "Ocurrió un Error al ingresar las prepolizas"
|
||||||
End If
|
'End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|||||||
Reference in New Issue
Block a user