Cancelacion del traspaso por cantidad especificada
This commit is contained in:
@@ -1647,9 +1647,9 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
'DEBE CONSIDERAR SOLO LAS FILAS QUE TENGA PRODUCTOS, NO EL TOTALIZADOR
|
'DEBE CONSIDERAR SOLO LAS FILAS QUE TENGA PRODUCTOS, NO EL TOTALIZADOR
|
||||||
If CvePS > 0 Then
|
If CvePS > 0 Then
|
||||||
CveMovimientoDetalleSalida = GvRow.DataKey("CveMovimientoDetalle").ToEntero
|
CveMovimientoDetalleSalida = GvRow.DataKey("CveMovimientoDetalle").ToEntero
|
||||||
Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal
|
Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidad").Text.ToString.ToDecimal
|
||||||
|
|
||||||
If ChkRealizarDevolucion.Checked Then Cantidad = GvRow.FCTextBox("TxtCantidad").Text.ToDecimal
|
'If ChkRealizarDevolucion.Checked Then Cantidad = GvRow.FCTextBox("TxtCantidad").Text.ToDecimal
|
||||||
|
|
||||||
Dim PrecioUnitario As Decimal = GvRow.DataKey("PU").ToDecimal
|
Dim PrecioUnitario As Decimal = GvRow.DataKey("PU").ToDecimal
|
||||||
If CveMovimientoDetalleSalida <= 0 Then
|
If CveMovimientoDetalleSalida <= 0 Then
|
||||||
@@ -1657,7 +1657,16 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
If Cantidad <> 0 Then
|
|
||||||
|
Dim cantidadDisponibleValidacion As Decimal = GvRow.DataKey("Cantidad").ToDecimal - GvRow.FCTextBox("TxtCantidad").Text.ToString.ToDecimal
|
||||||
|
|
||||||
|
If cantidadDisponibleValidacion < 0 Then
|
||||||
|
ErrorMovInv = True
|
||||||
|
TextoError = $"La cantidad a cancelar del producto '{GvRow.DataKey("Codigo")}-{GvRow.DataKey("PS")}' excede la del traspaso"
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Cantidad > 0 Then
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, GvRow.DataKey("CveUM").ToEntero, CvePS, PrecioUnitario, -1, -1, Serie:=GvRow.DataKey("Serie"), Lote:=GvRow.DataKey("Lote"), FechaCaducidad:=GvRow.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=CveMovimientoDetalleSalida) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, GvRow.DataKey("CveUM").ToEntero, CvePS, PrecioUnitario, -1, -1, Serie:=GvRow.DataKey("Serie"), Lote:=GvRow.DataKey("Lote"), FechaCaducidad:=GvRow.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=CveMovimientoDetalleSalida) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||||
|
|||||||
Reference in New Issue
Block a user