Calcular impuestos locales en base al porcentaje de nota de credito
This commit is contained in:
@@ -22698,7 +22698,6 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function CargaDtImpuestosNC(CveVentaNC As Integer, Importe As Decimal, Optional NCDescuento As Boolean = False, Optional AplicaImpuestosLocales As Boolean = True, Optional NivelTotal As Integer = 1) As DataTable
|
||||
Dim Total As Decimal = 0, SubTotal As Decimal = 0, Saldo As Decimal = 0
|
||||
|
||||
@@ -22745,9 +22744,13 @@ Partial Class Ventas
|
||||
Dim Porcentaje As Decimal = ((Importe * 100) / ImporteReferencia) / 100
|
||||
Dim FiltroStr As String = ""
|
||||
Dim importePuTemp As Decimal = 0
|
||||
Dim TotalImpuestosLocales As Decimal = 0
|
||||
Dim TotalImpuestosLocalesVentaOriginal As Decimal = 0
|
||||
Dim TotalImpuestosLocalesRecalculado As Decimal = 0
|
||||
|
||||
'CALCULA LO EQUIVALENTE EN IMPUSTOS LOCALES
|
||||
If TmpDTImpuestos IsNot Nothing AndAlso TmpDTImpuestos.Rows.Count > 0 Then
|
||||
TotalImpuestosLocales = TmpDTImpuestos.SUM("Importe").ToDecimal()
|
||||
TotalImpuestosLocalesVentaOriginal = TmpDTImpuestos.SUM("Importe").ToDecimal()
|
||||
TotalImpuestosLocalesRecalculado = TotalImpuestosLocalesVentaOriginal * Porcentaje
|
||||
End If
|
||||
|
||||
For Each Dr As DataRow In DtImpuestosLocal.Rows
|
||||
@@ -22755,7 +22758,7 @@ Partial Class Ventas
|
||||
importePuTemp = (Porcentaje * (TmpDT.SUM("TotalImporte", FiltroStr).ToDecimal() - TmpDT.SUM("Descuento", FiltroStr).ToDecimal()))
|
||||
|
||||
If Not AplicaImpuestosLocales Then
|
||||
importePuTemp = importePuTemp - TotalImpuestosLocales
|
||||
importePuTemp = importePuTemp - TotalImpuestosLocalesVentaOriginal
|
||||
End If
|
||||
|
||||
Dr("ImporteTotal") = importePuTemp.RoundSQL(2)
|
||||
@@ -22775,9 +22778,11 @@ Partial Class Ventas
|
||||
Next
|
||||
|
||||
Dim importeNC = (DtImpuestosLocal.SUMD("ImporteTotal") + DtImpuestosLocal.SUMD("ImporteIVA") + DtImpuestosLocal.SUMD("ImporteIEPS") - DtImpuestosLocal.SUMD("ImporteRetIVA") - DtImpuestosLocal.SUMD("ImporteRetISR"))
|
||||
|
||||
If AplicaImpuestosLocales Then
|
||||
Importe = Importe + TotalImpuestosLocales
|
||||
Importe = Importe + TotalImpuestosLocalesRecalculado
|
||||
End If
|
||||
|
||||
'codigo para ajuste de centavo, si el importe total no cuadra con los totales
|
||||
Dim difTmp As Decimal = Importe - importeNC
|
||||
|
||||
@@ -22795,7 +22800,6 @@ Partial Class Ventas
|
||||
'CargaNCDT(CveVentaNC, Importe.ToDecimal)
|
||||
Return DtImpuestosLocal
|
||||
End Function
|
||||
|
||||
Private Sub AgregaTempDT(ByRef TmpDT As DataTable, CvePS As Integer, PS As String, Codigo As String, CodigoPS As String, CveTipoPS As Integer, CveTipoInvPS As Integer, CveUM As Integer, UM As String,
|
||||
CveClasificacion As Integer, Clasificacion As String, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String,
|
||||
Obs As String, Cantidad As Double, PU As Double, PorcentajeIVA As Double, ImporteIVA As Double, PorcentajeRetIVA As Double, ImporteRetIVA As Double,
|
||||
|
||||
Reference in New Issue
Block a user