Search in sources :

Example 1 with I_M_Forecast

use of org.compiere.model.I_M_Forecast in project metasfresh-webui-api by metasfresh.

the class ForecastLineQuickInputProcessor method updateForecastLine.

private final void updateForecastLine(final I_M_ForecastLine forecastLine, final QuickInput fromQuickInput) {
    final I_M_Forecast forecast = fromQuickInput.getRootDocumentAs(I_M_Forecast.class);
    final IForecastLineQuickInput fromForecastLineQuickInput = fromQuickInput.getQuickInputDocumentAs(IForecastLineQuickInput.class);
    final IHUPackingAware quickInputPackingAware = createQuickInputPackingAware(forecast, fromForecastLineQuickInput);
    final IHUPackingAware orderLinePackingAware = ForecastLineHUPackingAware.of(forecastLine);
    huPackingAwareBL.prepareCopyFrom(quickInputPackingAware).overridePartner(false).asiCopyMode(// because we just created the ASI
    ASICopyMode.CopyID).copyTo(orderLinePackingAware);
}
Also used : IHUPackingAware(de.metas.adempiere.gui.search.IHUPackingAware) I_M_Forecast(org.compiere.model.I_M_Forecast)

Example 2 with I_M_Forecast

use of org.compiere.model.I_M_Forecast in project metasfresh-webui-api by metasfresh.

the class ForecastLineQuickInputProcessor method process.

@Override
public DocumentId process(final QuickInput quickInput) {
    final I_M_Forecast forecast = quickInput.getRootDocumentAs(I_M_Forecast.class);
    final I_M_ForecastLine forecastLine = InterfaceWrapperHelper.newInstance(I_M_ForecastLine.class, forecast);
    forecastLine.setM_Forecast(forecast);
    updateForecastLine(forecastLine, quickInput);
    save(forecastLine);
    return DocumentId.of(forecastLine.getM_ForecastLine_ID());
}
Also used : I_M_ForecastLine(org.compiere.model.I_M_ForecastLine) I_M_Forecast(org.compiere.model.I_M_Forecast)

Example 3 with I_M_Forecast

use of org.compiere.model.I_M_Forecast 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)

Aggregations

I_M_Forecast (org.compiere.model.I_M_Forecast)3 IHUPackingAware (de.metas.adempiere.gui.search.IHUPackingAware)1 IHUOrderBL (de.metas.handlingunits.order.api.IHUOrderBL)1 QuickInput (de.metas.ui.web.quickinput.QuickInput)1 LookupValue (de.metas.ui.web.window.datatypes.LookupValue)1 IntegerLookupValue (de.metas.ui.web.window.datatypes.LookupValue.IntegerLookupValue)1 ProductAndAttributes (de.metas.ui.web.window.descriptor.sql.ProductLookupDescriptor.ProductAndAttributes)1 I_M_ForecastLine (org.compiere.model.I_M_ForecastLine)1 I_M_Product (org.compiere.model.I_M_Product)1