This commit is contained in:
rakcsle
2021-01-15 12:33:24 -07:00
3 changed files with 34 additions and 6 deletions

View File

@@ -14243,11 +14243,20 @@ Partial Class Compras_Compras
Else
Dim Acumulado 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
If Dr.FCTextBox("TxtCantidad").Text.ToDouble > 0 Then
Acumulado += (Dr.FCTextBox("TxtCantidad").Text.ToDecimal * 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
PU = (((Dr.FCTextBox("TxtCantidad").Text.ToDecimal * Dr.DataKey("PU").ToString.ToDecimal)) + dif) / Dr.FCTextBox("TxtCantidad").Text.ToDecimal
End If