From de28b4507e3e031e806f492e7e9cb7bc597361b1 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 31 Oct 2024 16:51:30 -0700 Subject: [PATCH] =?UTF-8?q?--=20correcci=C3=B3n=20de=20aplicaci=C3=B3n=20d?= =?UTF-8?q?e=20Anticipo=20--=20y=20simplificaci=C3=B3ne=20n=20la=20NC=20ge?= =?UTF-8?q?nerada?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/Ventas.aspx.vb | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 4f24501ba..1fda30a4f 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -3621,8 +3621,6 @@ Partial Class Ventas End If - End If - End Sub #Region "Bloqueo Pantalla" @@ -10765,6 +10763,13 @@ Partial Class Ventas If RegistrarNCAmortizacion(ObjVentas, ObjConta, ObjInventario, ObjAcum, ObjContr, ObjFacturaDevolucion, ObjBancos, Nothing, Nothing, NCDescuento:=NCDescuento, ListaNCDescuento:=ListaNCDesc, IndexNC:=(If(DtVentasNC IsNot Nothing, DtVentasNC.Rows.Count - 1, 0))) Then ListaNotasCreditoGeneradas.Add(ObjFacturaDevolucion) + If ObjFacturaDevolucion.CvePrePoliza > 0 Then + If ObjConta.ValidacionesPrePoliza(ObjFacturaDevolucion.CvePrePoliza, UsuarioActual, Opcion:=5, AutoConta:=False) Then + If ObjConta.ValorPolizaDescuadre > 0 Then + GuardaLogAD($"Ventas/Ventas-NCGeneradas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + End If + End If + End If End If End If @@ -10778,10 +10783,16 @@ Partial Class Ventas If RegistrarNCAmortizacion(ObjVentas, ObjConta, ObjInventario, ObjAcum, ObjContr, ObjFacturaBonificacion, ObjBancos, Nothing, Nothing, NCDescuento:=NCDescuento, ListaNCDescuento:=ListaNCBonificacion, IndexNC:=(DtVentasNC.Rows.Count - 1)) Then ListaNotasCreditoGeneradas.Add(ObjFacturaBonificacion) + If ObjFacturaBonificacion.CvePrePoliza > 0 Then + If ObjConta.ValidacionesPrePoliza(ObjFacturaBonificacion.CvePrePoliza, UsuarioActual, Opcion:=5, AutoConta:=False) Then + If ObjConta.ValorPolizaDescuadre > 0 Then + GuardaLogAD($"Ventas/Ventas-NCGeneradas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + End If + End If + End If End If End If - Catch ex As Exception OnError("Ocurrió un error al generar nota de crédito de amortización", ex) ErrorList.Add("No se pudo generar la nota de crédito de amortización") @@ -15276,7 +15287,7 @@ Partial Class Ventas If ObjFactura.CveMoneda = 2 AndAlso CveMonedaAnticipo = 1 Then Importe11MX = Importe11MX * tipoCambio End If - Dim ConPrePAnt As ConceptosTipoSaldo = ObtenerCveConceptoPrePoliza(12, VentaActual.CveMoneda, True, 1) + Dim ConPrePAnt As ConceptosTipoSaldo = ObtenerCveConceptoPrePoliza(12, CveMonedaAnticipo, True, 1) If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, Importe11MX, Importe11MX, ConPrePAnt.CveConcepto, Referencia, Concepto, CveVenta:=row2.DataKey("CveVenta").ToEntero(), CveVentaAmortizacion:=ObjFactura.CveVenta, ImporteME:=If(tipoCambioAnticipo = 1, 0, importeMovimiento), CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza, TipoCambio:=tipoCambioAnticipo) Then ErrorPrepoliza = True Exit For