Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -3482,13 +3482,50 @@ Partial Class PV
|
|||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim CantidadUsados As Decimal = 0
|
|
||||||
|
'Validacion de Recepción de Usados
|
||||||
|
Dim Vendido As Decimal = 0
|
||||||
|
Dim Entregado As Decimal = 0
|
||||||
|
Dim UltimoEntregado As Decimal = 0
|
||||||
|
|
||||||
For Each Gvr As GridViewRow In GvRecepcionUsados.Rows
|
For Each Gvr As GridViewRow In GvRecepcionUsados.Rows
|
||||||
If Gvr.RowType = DataControlRowType.DataRow Then
|
If Gvr.RowType = DataControlRowType.DataRow Then
|
||||||
CantidadUsados = CantidadUsados + Gvr.FCTextBox("TxtCantidad").Text.ToEntero()
|
If Gvr.FCTextBox("TxtCantidad").Text.ToEntero() > 0 Then
|
||||||
|
Entregado += (Gvr.FCTextBox("TxtCantidad").Text.ToEntero * Gvr.DataKey("Cargo").ToDecimal)
|
||||||
|
UltimoEntregado = Gvr.DataKey("Cargo").ToDecimal
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
If Entregado > 0 Then
|
||||||
|
'Calcular Vendido
|
||||||
|
Dim DTTamanios As New DataTable
|
||||||
|
Dim ObjAcum As New ClsAcumuladores
|
||||||
|
If ObjAcum.TamañoGet(-1, UsuarioActual.CveEmpresa) Then
|
||||||
|
DTTamanios = ObjAcum.DtResultados
|
||||||
|
End If
|
||||||
|
ObjAcum.Dispose()
|
||||||
|
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
||||||
|
|
||||||
|
If DTTamanios.Rows.Count > 0 And DTTamanios IsNot Nothing And DrPS("CveTamaño").ToString.ToEntero > 0 Then
|
||||||
|
Vendido = DTTamanios.FiltroPrimeroValor("Cargo", $" CveTamaño = { DrPS("CveTamaño") }").ToDecimal
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Entregado > Vendido Then
|
||||||
|
If (Entregado - Vendido) >= UltimoEntregado Then
|
||||||
|
Alert("No puede entregar un cargo mayor a lo Vendido", TipoMensaje.MsgAdvertencia)
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
'Dim CantidadUsados As Decimal = 0
|
||||||
|
'For Each Gvr As GridViewRow In GvRecepcionUsados.Rows
|
||||||
|
' If Gvr.RowType = DataControlRowType.DataRow Then
|
||||||
|
' CantidadUsados = CantidadUsados + Gvr.FCTextBox("TxtCantidad").Text.ToEntero()
|
||||||
|
' End If
|
||||||
|
'Next
|
||||||
|
|
||||||
'If CantidadUsados > TxtCantidad.Text.ToEntero() Then
|
'If CantidadUsados > TxtCantidad.Text.ToEntero() Then
|
||||||
' Alert("No puede tener una cantidad mayor a la de los cargos", TipoMensaje.MsgAdvertencia)
|
' Alert("No puede tener una cantidad mayor a la de los cargos", TipoMensaje.MsgAdvertencia)
|
||||||
' Return False
|
' Return False
|
||||||
|
|||||||
Reference in New Issue
Block a user