diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 3a75dc1df..e0d5d3f62 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -449,7 +449,6 @@ Namespace Modelos Private Sub IniciaValoresVentas(Optional EsCancelacion As Boolean = False) If CveVenta > 0 AndAlso CveEmpresa > 0 Then Me.DtAnticipos = New DataTable() - Me.DtAntNCVinculadas = New DataTable() Me.DtPagos = New DataTable() Me.DtRemisiones = New DataTable() Me.DtInventario = New DataTable() @@ -483,7 +482,7 @@ Namespace Modelos If TipoDocto.Contiene("Ing", "Ant", "Rem") Then 'carga as notas de credito vinculadas If ObjVentas.GetVentasAntNC(CveVenta, -1) Then - Me.DtAntNCVinculadas = ObjVentas.DtResultados.Copy() + Me.DtAnticipos = ObjVentas.DtResultados.Copy() End If End If @@ -493,7 +492,7 @@ Namespace Modelos End If If TipoDocto.Contiene("Ant") AndAlso EsCancelacion Then - EsNCAmortizacion = True + Me.EsNCAmortizacion = True End If If ObjVentas.GetVentasAntNC(-1, CveVenta, AplicaAmortizacion:=EsNCAmortizacion) Then @@ -2418,9 +2417,18 @@ Namespace Modelos CveCuenta = ObjFactura.Cliente.CveCuentaAnticipos CveSubProyectoContabilizar = CveSubProyectoVenta + Dim CveVenta As Integer = ObjFactura.CveVenta + Dim CveVentaAmortizacion As Integer = row2("CveVenta").ToString().ToEntero + + 'SI ES FACTURA EN 0 Y TIENE ANTICIPOS + If (ObjFactura.Total = 0 AndAlso UsuarioActual.CveEmpresa.Contiene(72) AndAlso ObjFactura.TipoDocto.Contiene("Ing")) AndAlso row2("TipoDocto").ToString() = "Ant" Then + CveVenta = row2("CveVenta").ToString().ToEntero + CveVentaAmortizacion = ObjFactura.CveVenta + End If + If importeMovimiento <> 0 Then If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, - CveVenta:=ObjFactura.CveVenta, CveVentaAmortizacion:=row2("CveVenta").ToString().ToEntero, CveCliente:=ObjFactura.CveCliente, + CveVenta:=CveVenta, CveVentaAmortizacion:=CveVentaAmortizacion, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True @@ -5213,8 +5221,7 @@ Namespace Modelos Public Property DtDeduccion As Data.DataTable Public Property DtFirmas As Data.DataTable Public Property DtDesgloseImpuestos As Data.DataTable - Public Property DtDocumentosRelacionados As Data.DataTable - Public Property DtAntNCVinculadas As Data.DataTable + Public Property DtDocumentosRelacionados As Data.DataTable Public Property DtNCVinculadas As Data.DataTable Public Property DtAnticipos As Data.DataTable