use of de.metas.handlingunits.storage.IHUProductStorage in project metasfresh-webui-api by metasfresh.
the class PickingSlotsClearingViewBasedProcess method prepareUnloadRequest.
protected IAllocationRequestBuilder prepareUnloadRequest(@NonNull final I_M_HU fromHU, @NonNull final BigDecimal qtyCU) {
Check.assume(qtyCU.signum() > 0, "qtyCU > 0");
final IHUContext huContext = huContextFactory.createMutableHUContext();
final IHUStorage fromHUStorage = huContext.getHUStorageFactory().getStorage(fromHU);
final I_M_Product product = fromHUStorage.getSingleProductOrNull();
if (product == null) {
throw new AdempiereException("Cannot determine the product to transfer from " + fromHU);
}
final IHUProductStorage productStorage = fromHUStorage.getProductStorage(product);
return AllocationUtils.createAllocationRequestBuilder().setHUContext(huContext).setProduct(product).setQuantity(qtyCU, productStorage.getC_UOM()).setDateAsToday().setFromReferencedModel(null).setForceQtyAllocation(false);
}
Aggregations