use of de.metas.product.ProductId in project metasfresh-webui-api by metasfresh.
the class HUEditorRowId method ofHU.
public static HUEditorRowId ofHU(final HuId huId, final HuId topLevelHUId) {
final ProductId storageProductId = null;
// to be computed when needed
final String json = null;
// to be computed when needed
final DocumentId documentId = null;
return new HUEditorRowId(huId, storageProductId, topLevelHUId, json, documentId);
}
use of de.metas.product.ProductId in project metasfresh-webui-api by metasfresh.
the class HUEditorRowId method toTopLevelRowId.
public HUEditorRowId toTopLevelRowId() {
if (isTopLevel()) {
return this;
}
final HuId huId = getTopLevelHUId();
final ProductId storageProductId = null;
final HuId topLevelHUId = null;
final String json = null;
final DocumentId documentId = null;
return new HUEditorRowId(huId, storageProductId, topLevelHUId, json, documentId);
}
use of de.metas.product.ProductId in project metasfresh-webui-api by metasfresh.
the class WEBUI_PickingSlotsClearingView_TakeOutHUAndAddToNewHU method createHUProducer.
private IHUProducerAllocationDestination createHUProducer(@NonNull final I_M_HU fromHU) {
final PickingSlotRow pickingRow = getRootRowForSelectedPickingSlotRows();
final IHUStorageFactory storageFactory = Services.get(IHandlingUnitsBL.class).getStorageFactory();
final IHUStorage storage = storageFactory.getStorage(fromHU);
final ProductId singleProductId = storage.getSingleProductIdOrNull();
final I_C_UOM uom = Services.get(IProductBL.class).getStockUOM(singleProductId);
final LUTUProducerDestination lutuProducerDestination = createNewHUProducer(pickingRow, targetHUPI);
lutuProducerDestination.addCUPerTU(singleProductId, qtyCU, uom);
return lutuProducerDestination;
}
use of de.metas.product.ProductId 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 ProductId productId = fromHUStorage.getSingleProductIdOrNull();
if (productId == null) {
throw new AdempiereException("Cannot determine the product to transfer from " + fromHU);
}
final IHUProductStorage productStorage = fromHUStorage.getProductStorage(productId);
return AllocationUtils.createAllocationRequestBuilder().setHUContext(huContext).setProduct(productId).setQuantity(qtyCU, productStorage.getC_UOM()).setDateAsToday().setFromReferencedModel(null).setForceQtyAllocation(false);
}
use of de.metas.product.ProductId in project metasfresh-webui-api by metasfresh.
the class CableSalesOrderLineQuickInputProcessor method updateOrderLine_RegularProduct.
private final void updateOrderLine_RegularProduct(final I_C_OrderLine newOrderLine, final ICablesOrderLineQuickInput fromQuickInputModel) {
if (fromQuickInputModel.getPlug1_Product_ID() <= 0) {
throw new FillMandatoryException(ICablesOrderLineQuickInput.COLUMNNAME_Plug1_Product_ID);
}
final ProductId productId = ProductId.ofRepoId(fromQuickInputModel.getPlug1_Product_ID());
final BigDecimal qty = fromQuickInputModel.getQty();
if (qty.signum() <= 0) {
throw new FillMandatoryException(ICablesOrderLineQuickInput.COLUMNNAME_Qty);
}
newOrderLine.setM_Product_ID(productId.getRepoId());
newOrderLine.setQtyEntered(qty);
}
Aggregations