correcion para devoluciones
This commit is contained in:
@@ -992,40 +992,41 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
Dim CargaSoloUsados As Boolean = False
|
||||
|
||||
If ObjInventario.RecepcionAlmacenGet(pCveCompra, BuscaEntregaDirecta, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||
Dim DtRecepcion As DataTable = Nothing
|
||||
Dim DtRecepcion As DataTable = ObjInventario.DtResultados.Copy()
|
||||
Dim NumUsados = ObjInventario.DtResultados.COUNT("EsUsado", "EsUsado = True").ToEntero()
|
||||
Dim NumProductos = ObjInventario.DtResultados.COUNT("EsUsado", "EsUsado = False").ToEntero()
|
||||
Dim CveSubProyecto As Integer
|
||||
|
||||
'SI LA COMPRA TIENE PRODUCTOS Y USADOS SOLO MOSTRAR LOS PRODUCTOS
|
||||
If NumProductos > 0 AndAlso NumUsados > 0 Then
|
||||
DtRecepcion = ObjInventario.DtResultados.FiltraParametros("EsUsado = False")
|
||||
SumarImporteUsados = True
|
||||
ValidarRecepcionUsados = True
|
||||
'SI LA COMPRA TIENE PUROS USADOS, MOSTRAR LOS USADOS Y CARGAR LOS ALMACENES
|
||||
ElseIf NumProductos = 0 AndAlso NumUsados > 0 Then
|
||||
CargaSoloUsados = True
|
||||
SumarImporteUsados = True
|
||||
ValidarRecepcionUsados = True
|
||||
DtRecepcion = ObjInventario.DtResultados.Copy()
|
||||
If TipoMovimiento <> 3 Then 'sino es devolucion/NC
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
'SI LA COMPRA TIENE PRODUCTOS Y USADOS SOLO MOSTRAR LOS PRODUCTOS
|
||||
If NumProductos > 0 AndAlso NumUsados > 0 Then
|
||||
DtRecepcion = ObjInventario.DtResultados.FiltraParametros("EsUsado = False")
|
||||
SumarImporteUsados = True
|
||||
ValidarRecepcionUsados = True
|
||||
'SI LA COMPRA TIENE PUROS USADOS, MOSTRAR LOS USADOS Y CARGAR LOS ALMACENES
|
||||
ElseIf NumProductos = 0 AndAlso NumUsados > 0 Then
|
||||
CargaSoloUsados = True
|
||||
SumarImporteUsados = True
|
||||
ValidarRecepcionUsados = True
|
||||
DtRecepcion = ObjInventario.DtResultados.Copy()
|
||||
|
||||
CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero, "22", CveTipoCompra)
|
||||
End If
|
||||
|
||||
Else
|
||||
DtRecepcion = ObjInventario.DtResultados.Copy()
|
||||
Else
|
||||
DtRecepcion = ObjInventario.DtResultados.Copy()
|
||||
|
||||
'VERIFICA LOS QUE TENGAN LAS CLASIFICACION DE USADOS
|
||||
If ObjCompras.GetCompraDetalle(pCveCompra) Then
|
||||
If ObjCompras.DtResultados.COUNT("Cantidad", "CveClasificacion=20519") > 0 Then
|
||||
SumarImporteUsados = True
|
||||
ValidarRecepcionUsados = True
|
||||
Else
|
||||
SumarImporteUsados = False
|
||||
ValidarRecepcionUsados = False
|
||||
'VERIFICA LOS QUE TENGAN LAS CLASIFICACION DE USADOS
|
||||
If ObjCompras.GetCompraDetalle(pCveCompra) Then
|
||||
If ObjCompras.DtResultados.COUNT("Cantidad", "CveClasificacion=20519") > 0 Then
|
||||
SumarImporteUsados = True
|
||||
ValidarRecepcionUsados = True
|
||||
Else
|
||||
SumarImporteUsados = False
|
||||
ValidarRecepcionUsados = False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
CveSubProyecto = DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero
|
||||
@@ -1129,7 +1130,9 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
If CargaSoloUsados Then
|
||||
CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero, "22", CveTipoCompra)
|
||||
Else
|
||||
CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero, CveTipoCompra:=CveTipoCompra)
|
||||
If TipoMovimiento <> 3 Then 'cuando no es devolución
|
||||
CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero, CveTipoCompra:=CveTipoCompra)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user