Correcion en suma de importe de usados

This commit is contained in:
2020-11-06 16:28:45 -07:00
parent cd3b10931a
commit 0d6ef5fa1d

View File

@@ -394,6 +394,14 @@ Partial Class Inventarios_RecepcionAlmacen
ViewState("RealizarMovimientoVirtual") = Value
End Set
End Property
Private Property SumarImporteUsados As Boolean
Get
Return If(IsNothing(ViewState("SumarImporteUsados")), False, CBool(ViewState("SumarImporteUsados")))
End Get
Set
ViewState("SumarImporteUsados") = Value
End Set
End Property
#End Region
@@ -847,6 +855,7 @@ Partial Class Inventarios_RecepcionAlmacen
CveAlmacenDevolucionProveedor = -1
RealizarTraspasoAlmacenDevolucion = False
RealizarMovimientoVirtual = False
SumarImporteUsados = False
BtnGuardar.Enabled = True
CargaAlmacenes(-1)
@@ -900,6 +909,7 @@ Partial Class Inventarios_RecepcionAlmacen
RealizarTraspasoAlmacenDevolucion = False
RealizarMovimientoVirtual = False
SumarImporteUsados = False
CveAlmacenDevolucionProveedor = -1
Dim ObjCompras As New ClsCompras
@@ -956,9 +966,11 @@ Partial Class Inventarios_RecepcionAlmacen
'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
'SI LA COMPRA TIENE PUROS USADOS, MOSTRAR LOS USADOS Y CARGAR LOS ALMACENES
ElseIf NumProductos = 0 AndAlso NumUsados > 0 Then
CargaSoloUsados = True
SumarImporteUsados = True
DtRecepcion = ObjInventario.DtResultados.Copy()
If UsuarioActual.CveRol = 1 Then
CargaAlmacenes(-1, "22,24", CveTipoCompra)
@@ -966,6 +978,7 @@ Partial Class Inventarios_RecepcionAlmacen
CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero, "22", CveTipoCompra)
End If
Else
SumarImporteUsados = False
DtRecepcion = ObjInventario.DtResultados.Copy()
End If
@@ -2703,8 +2716,11 @@ Partial Class Inventarios_RecepcionAlmacen
Exit For
End If
Next
If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtual, UsuarioActual.CveEmpresa) Then
ImporteIngresoAdicional = ObjInventario.DtResultados.SUMD("TotalOriginal")
If SumarImporteUsados Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtual, UsuarioActual.CveEmpresa) Then
ImporteIngresoAdicional = ObjInventario.DtResultados.SUMD("TotalOriginal")
End If
End If
Else