use of de.metas.adempiere.gui.search.impl.PlainHUPackingAware in project metasfresh-webui-api by metasfresh.
the class OrderLineQuickInputProcessor method createQuickInputPackingAware.
private IHUPackingAware createQuickInputPackingAware(@NonNull final I_C_Order order, @NonNull final IOrderLineQuickInput quickInput) {
final PlainHUPackingAware huPackingAware = createAndInitHuPackingAware(order, quickInput);
// Get quickInput's Qty
final BigDecimal quickInputQty = quickInput.getQty();
if (quickInputQty == null || quickInputQty.signum() <= 0) {
logger.warn("Invalid Qty={} for {}", quickInputQty, quickInput);
// TODO trl
throw new AdempiereException("Qty shall be greather than zero");
}
huPackingAwareBL.computeAndSetQtysForNewHuPackingAware(huPackingAware, quickInputQty);
return validateNewHuPackingAware(huPackingAware);
}
use of de.metas.adempiere.gui.search.impl.PlainHUPackingAware in project metasfresh-webui-api by metasfresh.
the class OrderLineQuickInputProcessor method createAndInitHuPackingAware.
private PlainHUPackingAware createAndInitHuPackingAware(@NonNull final I_C_Order order, @NonNull final IOrderLineQuickInput quickInput) {
final PlainHUPackingAware huPackingAware = new PlainHUPackingAware();
huPackingAware.setC_BPartner(order.getC_BPartner());
huPackingAware.setDateOrdered(order.getDateOrdered());
huPackingAware.setInDispute(false);
final ProductAndAttributes productAndAttributes = ProductLookupDescriptor.toProductAndAttributes(quickInput.getM_Product_ID());
final I_M_Product product = load(productAndAttributes.getProductId(), I_M_Product.class);
huPackingAware.setM_Product_ID(product.getM_Product_ID());
huPackingAware.setC_UOM(product.getC_UOM());
huPackingAware.setM_AttributeSetInstance_ID(createASI(productAndAttributes));
final I_M_HU_PI_Item_Product piItemProduct = quickInput.getM_HU_PI_Item_Product();
huPackingAware.setM_HU_PI_Item_Product(piItemProduct);
return huPackingAware;
}
use of de.metas.adempiere.gui.search.impl.PlainHUPackingAware in project metasfresh-webui-api by metasfresh.
the class ForecastLineQuickInputProcessor method createQuickInputPackingAware.
private IHUPackingAware createQuickInputPackingAware(@NonNull final I_M_Forecast forecast, @NonNull final IForecastLineQuickInput quickInput) {
final PlainHUPackingAware huPackingAware = createAndInitHuPackingAware(forecast, quickInput);
final BigDecimal quickInputQty = quickInput.getQty();
if (quickInputQty == null || quickInputQty.signum() <= 0) {
throw new AdempiereException("Qty shall be greather than zero");
}
huPackingAwareBL.computeAndSetQtysForNewHuPackingAware(huPackingAware, quickInputQty);
return validateNewHuPackingAware(huPackingAware);
}
use of de.metas.adempiere.gui.search.impl.PlainHUPackingAware in project metasfresh-webui-api by metasfresh.
the class ForecastLineQuickInputProcessor method createAndInitHuPackingAware.
private PlainHUPackingAware createAndInitHuPackingAware(@NonNull final I_M_Forecast forecast, @NonNull final IForecastLineQuickInput quickInput) {
final PlainHUPackingAware huPackingAware = new PlainHUPackingAware();
huPackingAware.setC_BPartner(forecast.getC_BPartner());
huPackingAware.setDateOrdered(forecast.getDatePromised());
huPackingAware.setInDispute(false);
final ProductAndAttributes productAndAttributes = ProductLookupDescriptor.toProductAndAttributes(quickInput.getM_Product_ID());
final I_M_Product product = load(productAndAttributes.getProductId(), I_M_Product.class);
huPackingAware.setM_Product_ID(product.getM_Product_ID());
huPackingAware.setC_UOM(product.getC_UOM());
huPackingAware.setM_AttributeSetInstance_ID(createASI(productAndAttributes));
final I_M_HU_PI_Item_Product piItemProduct = quickInput.getM_HU_PI_Item_Product();
huPackingAware.setM_HU_PI_Item_Product(piItemProduct);
return huPackingAware;
}
Aggregations