Search in sources :

Example 56 with ProductId

use of de.metas.product.ProductId in project metasfresh-webui-api by metasfresh.

the class WEBUI_C_OrderLineSO_Make_HUReservation method checkPreconditionsApplicable.

@Override
public ProcessPreconditionsResolution checkPreconditionsApplicable() {
    final SalesOrderLine salesOrderLine = WEBUI_C_OrderLineSO_Util.retrieveSalesOrderLine(getView(), salesOrderLineRepository).orElse(null);
    if (salesOrderLine == null) {
        return ProcessPreconditionsResolution.rejectWithInternalReason("No sales order was set");
    }
    final ProductId productId = salesOrderLine.getProductId();
    final Quantity reservableQty = retrieveReservableQuantity(productId);
    if (reservableQty.signum() <= 0) {
        return ProcessPreconditionsResolution.rejectWithInternalReason("No reservable quantity for productId=" + productId);
    }
    return ProcessPreconditionsResolution.accept();
}
Also used : SalesOrderLine(de.metas.purchasecandidate.SalesOrderLine) Quantity(de.metas.quantity.Quantity) ProductId(de.metas.product.ProductId)

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