Search in sources :

Example 31 with ProductId

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);
}
Also used : DocumentId(de.metas.ui.web.window.datatypes.DocumentId) ProductId(de.metas.product.ProductId)

Example 32 with ProductId

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);
}
Also used : DocumentId(de.metas.ui.web.window.datatypes.DocumentId) HuId(de.metas.handlingunits.HuId) ProductId(de.metas.product.ProductId)

Example 33 with ProductId

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;
}
Also used : IProductBL(de.metas.product.IProductBL) PickingSlotRow(de.metas.ui.web.picking.pickingslot.PickingSlotRow) IHandlingUnitsBL(de.metas.handlingunits.IHandlingUnitsBL) IHUStorageFactory(de.metas.handlingunits.storage.IHUStorageFactory) IHUStorage(de.metas.handlingunits.storage.IHUStorage) ProductId(de.metas.product.ProductId) LUTUProducerDestination(de.metas.handlingunits.allocation.transfer.impl.LUTUProducerDestination) I_C_UOM(org.compiere.model.I_C_UOM)

Example 34 with ProductId

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);
}
Also used : AdempiereException(org.adempiere.exceptions.AdempiereException) IHUStorage(de.metas.handlingunits.storage.IHUStorage) ProductId(de.metas.product.ProductId) IHUProductStorage(de.metas.handlingunits.storage.IHUProductStorage) IHUContext(de.metas.handlingunits.IHUContext)

Example 35 with ProductId

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);
}
Also used : ProductId(de.metas.product.ProductId) FillMandatoryException(org.adempiere.exceptions.FillMandatoryException) BigDecimal(java.math.BigDecimal)

Aggregations

ProductId (de.metas.product.ProductId)56 HUPIItemProductId (de.metas.handlingunits.HUPIItemProductId)8 BPartnerId (de.metas.bpartner.BPartnerId)7 HuId (de.metas.handlingunits.HuId)7 Quantity (de.metas.quantity.Quantity)7 AdempiereException (org.adempiere.exceptions.AdempiereException)7 I_M_HU (de.metas.handlingunits.model.I_M_HU)6 IHUProductStorage (de.metas.handlingunits.storage.IHUProductStorage)5 IHUStorage (de.metas.handlingunits.storage.IHUStorage)5 ITranslatableString (de.metas.i18n.ITranslatableString)5 BigDecimal (java.math.BigDecimal)5 I_C_UOM (org.compiere.model.I_C_UOM)5 LookupValue (de.metas.ui.web.window.datatypes.LookupValue)4 ArrayList (java.util.ArrayList)4 ImmutableAttributeSet (org.adempiere.mm.attributes.api.ImmutableAttributeSet)4 VisibleForTesting (com.google.common.annotations.VisibleForTesting)3 ImmutableList (com.google.common.collect.ImmutableList)3 IHandlingUnitsBL (de.metas.handlingunits.IHandlingUnitsBL)3 I_M_HU_PI_Item_Product (de.metas.handlingunits.model.I_M_HU_PI_Item_Product)3 IProductBL (de.metas.product.IProductBL)3