Search in sources :

Example 1 with ProductAndAttributes

use of de.metas.ui.web.window.descriptor.sql.ProductLookupDescriptor.ProductAndAttributes 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;
}
Also used : PlainHUPackingAware(de.metas.adempiere.gui.search.impl.PlainHUPackingAware) I_M_Product(org.compiere.model.I_M_Product) I_M_HU_PI_Item_Product(de.metas.handlingunits.model.I_M_HU_PI_Item_Product) ProductAndAttributes(de.metas.ui.web.window.descriptor.sql.ProductLookupDescriptor.ProductAndAttributes)

Example 2 with ProductAndAttributes

use of de.metas.ui.web.window.descriptor.sql.ProductLookupDescriptor.ProductAndAttributes 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;
}
Also used : PlainHUPackingAware(de.metas.adempiere.gui.search.impl.PlainHUPackingAware) I_M_Product(org.compiere.model.I_M_Product) I_M_HU_PI_Item_Product(de.metas.handlingunits.model.I_M_HU_PI_Item_Product) ProductAndAttributes(de.metas.ui.web.window.descriptor.sql.ProductLookupDescriptor.ProductAndAttributes)

Example 3 with ProductAndAttributes

use of de.metas.ui.web.window.descriptor.sql.ProductLookupDescriptor.ProductAndAttributes in project metasfresh-webui-api by metasfresh.

the class ForecastLineQuickInputDescriptorFactory method onProductChangedCallout.

private static void onProductChangedCallout(final ICalloutField calloutField) {
    final QuickInput quickInput = QuickInput.getQuickInputOrNull(calloutField);
    if (quickInput == null) {
        return;
    }
    final IForecastLineQuickInput quickInputModel = quickInput.getQuickInputDocumentAs(IForecastLineQuickInput.class);
    final LookupValue productLookupValue = quickInputModel.getM_Product_ID();
    if (productLookupValue == null) {
        return;
    }
    final ProductAndAttributes productAndAttributes = ProductLookupDescriptor.toProductAndAttributes(productLookupValue);
    final I_M_Product quickInputProduct = load(productAndAttributes.getProductId(), I_M_Product.class);
    final I_M_Forecast forecast = quickInput.getRootDocumentAs(I_M_Forecast.class);
    Services.get(IHUOrderBL.class).findM_HU_PI_Item_ProductForForecast(forecast, quickInputProduct, quickInputModel::setM_HU_PI_Item_Product);
}
Also used : I_M_Product(org.compiere.model.I_M_Product) QuickInput(de.metas.ui.web.quickinput.QuickInput) IHUOrderBL(de.metas.handlingunits.order.api.IHUOrderBL) I_M_Forecast(org.compiere.model.I_M_Forecast) ProductAndAttributes(de.metas.ui.web.window.descriptor.sql.ProductLookupDescriptor.ProductAndAttributes) IntegerLookupValue(de.metas.ui.web.window.datatypes.LookupValue.IntegerLookupValue) LookupValue(de.metas.ui.web.window.datatypes.LookupValue)

Example 4 with ProductAndAttributes

use of de.metas.ui.web.window.descriptor.sql.ProductLookupDescriptor.ProductAndAttributes in project metasfresh-webui-api by metasfresh.

the class OrderLineQuickInputDescriptorFactory method onProductChangedCallout.

private static void onProductChangedCallout(final ICalloutField calloutField) {
    final QuickInput quickInput = QuickInput.getQuickInputOrNull(calloutField);
    if (quickInput == null) {
        return;
    }
    final IOrderLineQuickInput quickInputModel = quickInput.getQuickInputDocumentAs(IOrderLineQuickInput.class);
    final LookupValue productLookupValue = quickInputModel.getM_Product_ID();
    if (productLookupValue == null) {
        return;
    }
    final ProductAndAttributes productAndAttributes = ProductLookupDescriptor.toProductAndAttributes(productLookupValue);
    final I_M_Product quickInputProduct = load(productAndAttributes.getProductId(), I_M_Product.class);
    final I_C_Order order = quickInput.getRootDocumentAs(I_C_Order.class);
    Services.get(IHUOrderBL.class).findM_HU_PI_Item_Product(order, quickInputProduct, quickInputModel::setM_HU_PI_Item_Product);
}
Also used : I_C_Order(de.metas.adempiere.model.I_C_Order) I_M_Product(org.compiere.model.I_M_Product) QuickInput(de.metas.ui.web.quickinput.QuickInput) IHUOrderBL(de.metas.handlingunits.order.api.IHUOrderBL) ProductAndAttributes(de.metas.ui.web.window.descriptor.sql.ProductLookupDescriptor.ProductAndAttributes) IntegerLookupValue(de.metas.ui.web.window.datatypes.LookupValue.IntegerLookupValue) LookupValue(de.metas.ui.web.window.datatypes.LookupValue)

Aggregations

ProductAndAttributes (de.metas.ui.web.window.descriptor.sql.ProductLookupDescriptor.ProductAndAttributes)4 I_M_Product (org.compiere.model.I_M_Product)4 PlainHUPackingAware (de.metas.adempiere.gui.search.impl.PlainHUPackingAware)2 I_M_HU_PI_Item_Product (de.metas.handlingunits.model.I_M_HU_PI_Item_Product)2 IHUOrderBL (de.metas.handlingunits.order.api.IHUOrderBL)2 QuickInput (de.metas.ui.web.quickinput.QuickInput)2 LookupValue (de.metas.ui.web.window.datatypes.LookupValue)2 IntegerLookupValue (de.metas.ui.web.window.datatypes.LookupValue.IntegerLookupValue)2 I_C_Order (de.metas.adempiere.model.I_C_Order)1 I_M_Forecast (org.compiere.model.I_M_Forecast)1