-- corrección de aplicación de Anticipo

-- y simplificacióne n la NC generada
This commit is contained in:
2024-10-31 16:51:30 -07:00
parent 956bfe0a4d
commit de28b4507e

View File

@@ -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,9 +10783,15 @@ 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)
@@ -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