cambio en redondeo de devoluciones
This commit is contained in:
@@ -14235,11 +14235,20 @@ Partial Class Compras_Compras
|
|||||||
Else
|
Else
|
||||||
Dim Acumulado As Decimal = 0
|
Dim Acumulado As Decimal = 0
|
||||||
Dim PU As Decimal = 0
|
Dim PU As Decimal = 0
|
||||||
|
Dim CantidadRenglones As Integer = 0
|
||||||
|
Dim ii As Integer = 0
|
||||||
|
For Each Dr As GridViewRow In GVDevolucion.Rows
|
||||||
|
If Dr.FCTextBox("TxtCantidad").Text.ToDouble > 0 Then
|
||||||
|
CantidadRenglones += 1
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
For Each Dr As GridViewRow In GVDevolucion.Rows
|
For Each Dr As GridViewRow In GVDevolucion.Rows
|
||||||
If Dr.FCTextBox("TxtCantidad").Text.ToDouble > 0 Then
|
If Dr.FCTextBox("TxtCantidad").Text.ToDouble > 0 Then
|
||||||
Acumulado += (Dr.FCTextBox("TxtCantidad").Text.ToDecimal * Dr.DataKey("PU").ToString.ToDecimal)
|
Acumulado += (Dr.FCTextBox("TxtCantidad").Text.ToDecimal * Dr.DataKey("PU").ToString.ToDecimal)
|
||||||
PU = Dr.DataKey("PU").ToString.ToDecimal
|
PU = Dr.DataKey("PU").ToString.ToDecimal
|
||||||
If subtotal < Acumulado Then
|
ii += 1
|
||||||
|
If CantidadRenglones = ii Then
|
||||||
Dim dif As Decimal = subtotal - Acumulado
|
Dim dif As Decimal = subtotal - Acumulado
|
||||||
PU = (((Dr.FCTextBox("TxtCantidad").Text.ToDecimal * Dr.DataKey("PU").ToString.ToDecimal)) + dif) / Dr.FCTextBox("TxtCantidad").Text.ToDecimal
|
PU = (((Dr.FCTextBox("TxtCantidad").Text.ToDecimal * Dr.DataKey("PU").ToString.ToDecimal)) + dif) / Dr.FCTextBox("TxtCantidad").Text.ToDecimal
|
||||||
End If
|
End If
|
||||||
|
|||||||
Reference in New Issue
Block a user