--Validaciones en devoluciones
This commit is contained in:
@@ -78,6 +78,7 @@ Public Class ClsInventarios
|
|||||||
Public Property CveVenta As Integer
|
Public Property CveVenta As Integer
|
||||||
Public Property TipoEstatus As Integer
|
Public Property TipoEstatus As Integer
|
||||||
Public Property EsDevolucionVenta As Integer
|
Public Property EsDevolucionVenta As Integer
|
||||||
|
Public Property CantidadVenta As Decimal
|
||||||
Public Property CvePersonal As Integer
|
Public Property CvePersonal As Integer
|
||||||
Public Property NombreCompleto As String
|
Public Property NombreCompleto As String
|
||||||
Public Property NombreCapturo As String
|
Public Property NombreCapturo As String
|
||||||
@@ -3576,8 +3577,9 @@ Public Class ClsInventarios
|
|||||||
|
|
||||||
If Data IsNot Nothing AndAlso Data.Rows.Count = 1 Then
|
If Data IsNot Nothing AndAlso Data.Rows.Count = 1 Then
|
||||||
Dim dr As DataRow = Data.Rows(0)
|
Dim dr As DataRow = Data.Rows(0)
|
||||||
TipoEstatus = dr("TipoEstatus").ToString.ToEntero
|
TipoEstatus = dr("TipoEstatus").ToString().ToEntero
|
||||||
EsDevolucionVenta = dr("EsVentaDevolucion").ToString.ToEntero
|
EsDevolucionVenta = dr("EsVentaDevolucion").ToString().ToEntero
|
||||||
|
CantidadVenta = dr("CantidadVenta").ToString().ToDecimal()
|
||||||
Retorno = True
|
Retorno = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
@@ -1967,7 +1967,7 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
ValidaUsaConsola()
|
ValidaUsaConsola()
|
||||||
|
|
||||||
|
|
||||||
|
Dim CantidadVenta As Decimal = 0
|
||||||
'' INICIA: VALIDACIONES
|
'' INICIA: VALIDACIONES
|
||||||
|
|
||||||
'Valida el estatus de la Venta, si es = 5 O DevolucionVenta = 2, NO SE SURTE!
|
'Valida el estatus de la Venta, si es = 5 O DevolucionVenta = 2, NO SE SURTE!
|
||||||
@@ -1975,6 +1975,7 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
If ObjVentaInv.GetEstatusVentaPorSurtir(CveVentaSurtir) Then
|
If ObjVentaInv.GetEstatusVentaPorSurtir(CveVentaSurtir) Then
|
||||||
TipoEstatus = ObjVentaInv.TipoEstatus
|
TipoEstatus = ObjVentaInv.TipoEstatus
|
||||||
EsDevolucionVenta = ObjVentaInv.EsDevolucionVenta
|
EsDevolucionVenta = ObjVentaInv.EsDevolucionVenta
|
||||||
|
CantidadVenta = ObjVentaInv.CantidadVenta
|
||||||
End If
|
End If
|
||||||
ObjVentaInv.Dispose()
|
ObjVentaInv.Dispose()
|
||||||
|
|
||||||
@@ -2166,7 +2167,9 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
DtDatosVenta = ObjInventario.DtResultados
|
DtDatosVenta = ObjInventario.DtResultados
|
||||||
End If
|
End If
|
||||||
Dim CantidadGV As Decimal = GvDatos.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDecimal)
|
Dim CantidadGV As Decimal = GvDatos.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDecimal)
|
||||||
If CantidadGV > DtDatosVenta.SUMD("CantidadF") Then
|
|
||||||
|
'VERIFICA SI LA CANTIDADES NOT SON MAYORES A LO ESTABLECIDO EN LA VENTA O LO QUE FALTA POR RECIBIR
|
||||||
|
If CantidadGV > DtDatosVenta.SUMD("CantidadF") OrElse Cantidad > CantidadVenta Then
|
||||||
ObjInventario.RollBack()
|
ObjInventario.RollBack()
|
||||||
ObjInventario.Dispose()
|
ObjInventario.Dispose()
|
||||||
ObjConta.Dispose()
|
ObjConta.Dispose()
|
||||||
@@ -2175,7 +2178,13 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
'' identificar que productos no están completos.
|
'' identificar que productos no están completos.
|
||||||
CargaVentaPorSurtir(CveVentaSurtir)
|
CargaVentaPorSurtir(CveVentaSurtir)
|
||||||
CargaPendientes()
|
CargaPendientes()
|
||||||
Alert("Ha sido cambiada la informacion de existencias de la venta actual, se han recargado la información.", TipoMensaje.MsgAdvertencia)
|
|
||||||
|
If Cantidad > CantidadVenta Then
|
||||||
|
Alert("No se puede procesar una cantidad mayor a la que esta definida en la venta.", TipoMensaje.MsgAdvertencia)
|
||||||
|
Else
|
||||||
|
Alert("Ha sido cambiada la informacion de existencias de la venta actual, se han recargado la información.", TipoMensaje.MsgAdvertencia)
|
||||||
|
End If
|
||||||
|
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -3290,6 +3299,14 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'SI YA FUE DEVUELTO LA CANTIDAD COMPLETA DE LA DEVOLUCION,MARCAR PARA QUE NO APAREZCA
|
||||||
|
If Not ErrorMovInv AndAlso Cantidad.RoundSQL(6) = CantidadVenta.RoundSQL(6) AndAlso TipoDocto = "Dev" Then
|
||||||
|
If Not ObjVentas.UpdateVentasDevolucionAlmacen(2, CveVentaSurtir) Then
|
||||||
|
TextoError.AppendFormat("Ocurrió un error al actualizar la devolucion.")
|
||||||
|
ErrorMovInv = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
If Not ErrorMovInv Then
|
If Not ErrorMovInv Then
|
||||||
|
|
||||||
ObjInventario.Commit()
|
ObjInventario.Commit()
|
||||||
|
|||||||
Reference in New Issue
Block a user