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;
}
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;
}
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);
}
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);
}
Aggregations