Calculo de Ret IVA en OC
This commit is contained in:
@@ -6980,21 +6980,23 @@ Partial Class OC
|
|||||||
TxtRetIVA.Text = TxtRetIVA.Text.FormatoNumero
|
TxtRetIVA.Text = TxtRetIVA.Text.FormatoNumero
|
||||||
HdnRetIVA.Value = TxtRetIVA.Text
|
HdnRetIVA.Value = TxtRetIVA.Text
|
||||||
|
|
||||||
Dim Porcentaje = TxtRetIVA.Text.ToDecimal / DtDetalle.SUM("Total")
|
Dim Porcentaje As Decimal = TxtRetIVA.Text.ToDecimal / DtDetalle.SUM("Total")
|
||||||
Dim LastDr As DataRow = Nothing
|
Dim LastDr As DataRow = Nothing
|
||||||
For Each Dr As DataRow In DtDetalle.Rows
|
For Each Dr As DataRow In DtDetalle.Rows
|
||||||
Dr("RetIVA") = (Math.Truncate((Dr("Total").ToString.ToDecimal * Porcentaje) * 100)) / 100
|
'Dr("RetIVA") = (Math.Truncate((Dr("Total").ToString.ToDecimal * Porcentaje) * 100)) / 100
|
||||||
|
Dr("RetIVA") = Math.Round((Dr("Total").ToString.ToDecimal * Porcentaje), 2)
|
||||||
|
'Dr("RetIVA") = Math.Round((Dr("Cantidad").ToString.ToDecimal * Dr("Importe").ToString.ToDecimal * Porcentaje), 2)
|
||||||
Dr("RetIVAPorcentaje") = Porcentaje
|
Dr("RetIVAPorcentaje") = Porcentaje
|
||||||
' Tipo Dato '0' es Cuando es Nuevo, '1' para editar y '2' viene de la BD
|
' Tipo Dato '0' es Cuando es Nuevo, '1' para editar y '2' viene de la BD
|
||||||
Dr("TipoDato") = If(Dr("TipoDato").ToString.ToEntero = 0, 0, 1)
|
Dr("TipoDato") = If(Dr("TipoDato").ToString.ToEntero = 0, 0, 1)
|
||||||
LastDr = Dr
|
LastDr = Dr
|
||||||
Next
|
Next
|
||||||
If Not IsNothing(LastDr) Then
|
'If Not IsNothing(LastDr) Then
|
||||||
Dim Fdes As Decimal = TxtRetIVA.Text.ToDecimal - DtDetalle.SUM("RetIVA").ToString.ToDecimal
|
' Dim Fdes As Decimal = TxtRetIVA.Text.ToDecimal - DtDetalle.SUM("RetIVA").ToString.ToDecimal
|
||||||
If Fdes > 0 Then
|
' If Fdes > 0 Then
|
||||||
LastDr("RetIVA") = LastDr("RetIVA").ToString.ToDecimal + Fdes
|
' LastDr("RetIVA") = LastDr("RetIVA").ToString.ToDecimal + Fdes
|
||||||
End If
|
' End If
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
'Alert(String.Format("Descuento:{0}", DtDetalle.SUM("Descuento")))
|
'Alert(String.Format("Descuento:{0}", DtDetalle.SUM("Descuento")))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user