use of de.metas.ui.web.quickinput.QuickInput 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.quickinput.QuickInput 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