--FIX Forzar ajuste en NC

This commit is contained in:
2024-08-16 09:16:36 -07:00
parent 171d2401c5
commit f0da970847

View File

@@ -12033,7 +12033,7 @@ Partial Class Ventas
Dim ForzarAjuste As Boolean = False
'EL IMPORTE DE NC NO PUEDE SER MAYOR AL DE LA FACTURA
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso (tTipoAmortizacion = 1) Then
If (tTipoAmortizacion = 1) Then
ForzarAjuste = True
End If
@@ -12103,7 +12103,7 @@ Partial Class Ventas
'**** IMPUESTOS LOCALES
factura.DtDetalle = tmpcon
Dim TotalSubTotal As Decimal = tmpcon.SUMD("TotalImporte").RoundSQL(2)
Dim TotalSubTotal As Decimal = tmpcon.SUMD("TotalImporte")
Dim TotalDescuentos As Decimal = tmpcon.SUMD("Descuento")
Dim TotalIVA As Decimal = tmpcon.SUMD("ImporteIVA")
@@ -30644,7 +30644,7 @@ Partial Class Ventas
Dim ImporteReferencia As Decimal = If(NivelTotal = 1, Total, SubTotal)
Dim Porcentaje As Decimal = ((Importe * 100) / ImporteReferencia) / 100
Dim Porcentaje As Decimal = ((Importe * 100D) / ImporteReferencia) / 100D
Dim FiltroStr As String = ""
Dim TotalImpuestosLocalesVentaOriginal As Decimal = 0
@@ -30652,7 +30652,7 @@ Partial Class Ventas
'CALCULA LO EQUIVALENTE EN IMPUSTOS LOCALES
If TmpDTImpuestos IsNot Nothing AndAlso TmpDTImpuestos.Rows.Count > 0 Then
TotalImpuestosLocalesVentaOriginal = TmpDTImpuestos.SUM("Importe")
TotalImpuestosLocalesVentaOriginal = TmpDTImpuestos.SUMD("Importe")
TotalImpuestosLocalesRecalculado = TotalImpuestosLocalesVentaOriginal * Porcentaje
End If
@@ -30666,7 +30666,7 @@ Partial Class Ventas
For Each Dr As DataRow In DtImpuestosLocal.Rows
FiltroStr = String.Format("ISNULL(PorcentajeIVA,0) = {0} AND ISNULL(PorcentajeRetIVA,0) = {1} AND ISNULL(PorcentajeRetISR,0) = {2} AND ISNULL(PorcentajeIEPS,0) = {3} AND ISNULL(CveSubProyecto,0) = {4} ", Dr("PorcentajeIVA").ToString().ToDecimal, Dr("PorcentajeRetIVA").ToString().ToDecimal, Dr("PorcentajeRetISR").ToString().ToDecimal, Dr("PorcentajeIEPS").ToString().ToDecimal, Dr("CveSubProyecto"))
Dim importePuTemp As Decimal = 0
importePuTemp = (Porcentaje * (TmpDT.SUM("TotalImporte", FiltroStr) - TmpDT.SUM("Descuento", FiltroStr)))
importePuTemp = (Porcentaje * (TmpDT.SUMD("TotalImporte", FiltroStr) - TmpDT.SUMD("Descuento", FiltroStr)))
Dim DescuentoAplicado As Decimal = 0
If AplicaDescuentos Then