Cambios en virtuales
This commit is contained in:
@@ -2377,7 +2377,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
Dim CveVendedorActual = -1
|
||||
Dim CveClienteActual = -1
|
||||
|
||||
Dim CveAlmacenDestino = CveAlmacen
|
||||
Dim CveAlmacenDestino = CveAlmacenDevolucionProveedor
|
||||
Dim CveSeccionDestino As Integer = -1
|
||||
|
||||
'For Each RowAlmacen As DataRow In DtAlmacenesDevolucion.FiltraParametros("", DistinctColumns:={"CveAlmacenOrignal"}).Rows
|
||||
@@ -2884,6 +2884,66 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If SumarImporteUsados Then
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtual, UsuarioActual.CveEmpresa) Then
|
||||
ImporteIngresoAdicional = ObjInventario.DtResultados.SUMD("TotalOriginal")
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
If RealizarMovimientoVirtual Then
|
||||
|
||||
Dim DtPSVirtual As New DataTable("DtTamanios")
|
||||
|
||||
Dim CveMovimientoRef As Integer = -1
|
||||
If RealizarTraspasoAlmacenDevolucion Then
|
||||
CveMovimientoRef = CveMovimientoSalidaTraspaso
|
||||
Else
|
||||
CveMovimientoRef = CveMovimiento
|
||||
End If
|
||||
|
||||
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoRef, UsuarioActual.CveEmpresa) Then
|
||||
DtPSVirtual = ObjInventario.DtResultados
|
||||
End If
|
||||
|
||||
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 Then
|
||||
|
||||
Dim CveTipoAlmacenFiltro As Integer = 24
|
||||
|
||||
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero()).FiltroPrimeroValor("CveAlmacenVirtual").ToEntero()
|
||||
|
||||
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, 13, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, CveMovimientoRelacionado:=CveMovimientoRef, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/VD")
|
||||
|
||||
If CveMovimientoVirtual > 0 Then
|
||||
FolioVirtual = ObjInventario.Folio
|
||||
|
||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
|
||||
Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal()
|
||||
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
If SumarImporteUsados Then
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtual, UsuarioActual.CveEmpresa) Then
|
||||
ImporteIngresoAdicional = ObjInventario.DtResultados.SUMD("TotalOriginal")
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user