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