use of de.metas.ui.web.handlingunits.HUEditorView in project metasfresh-webui-api by metasfresh.
the class WEBUI_PP_Order_HUEditor_ProcessBase method retrieveSelectedAndEligibleHUEditorRows.
protected final Stream<HUEditorRow> retrieveSelectedAndEligibleHUEditorRows() {
final HUEditorView huEditorView = HUEditorView.cast(super.getView());
final Stream<HUEditorRow> huEditorRows = huEditorView.streamByIds(getSelectedRowIds());
return retrieveEligibleHUEditorRows(huEditorRows);
}
use of de.metas.ui.web.handlingunits.HUEditorView in project metasfresh-webui-api by metasfresh.
the class HUsToPickViewBasedProcess method getPickingSlotRow.
protected PickingSlotRow getPickingSlotRow() {
final HUEditorView huView = getView();
final DocumentId pickingSlotRowId = huView.getParentRowId();
final PickingSlotView pickingSlotView = getPickingSlotView();
return pickingSlotView.getById(pickingSlotRowId);
}
use of de.metas.ui.web.handlingunits.HUEditorView in project metasfresh-webui-api by metasfresh.
the class HUReportProcessInstance method startProcess.
@Override
public synchronized ProcessInstanceResult startProcess(@NonNull final ProcessExecutionContext context) {
final int numberOfCopies = getCopies();
if (numberOfCopies <= 0) {
throw new AdempiereException("@" + PARAM_Copies + "@ > 0");
}
final IViewsRepository viewsRepo = context.getViewsRepo();
final DocumentCollection documentsCollection = context.getDocumentsCollection();
final ViewId viewId = viewRowIdsSelection.getViewId();
final HUEditorView view = HUEditorView.cast(viewsRepo.getView(viewId));
final HUReportExecutorResult reportExecutorResult = HUReportExecutor.newInstance(context.getCtx()).numberOfCopies(numberOfCopies).printPreview(true).executeNow(reportADProcessId, extractHUsToReport(view));
final ADProcessPostProcessService postProcessService = ADProcessPostProcessService.builder().viewsRepo(viewsRepo).documentsCollection(documentsCollection).build();
final ProcessInstanceResult result = postProcessService.postProcess(ADProcessPostProcessRequest.builder().viewId(viewId).processInfo(reportExecutorResult.getProcessInfo()).processExecutionResult(reportExecutorResult.getProcessExecutionResult()).instanceIdOverride(instanceId).build());
return lastExecutionResult = result;
}
use of de.metas.ui.web.handlingunits.HUEditorView in project metasfresh-webui-api by metasfresh.
the class WEBUI_M_HU_Transform method removeSelectedRowsIfHUDestoyed.
/**
* @return true if view was changed and needs invalidation
*/
private final boolean removeSelectedRowsIfHUDestoyed() {
final DocumentIdsSelection selectedRowIds = getSelectedRowIds();
if (selectedRowIds.isEmpty()) {
return false;
} else if (selectedRowIds.isAll()) {
return false;
}
final HUEditorView view = getView();
final ImmutableSet<Integer> selectedHUIds = view.streamByIds(selectedRowIds).map(row -> row.getM_HU_ID()).collect(ImmutableSet.toImmutableSet());
return removeHUsIfDestroyed(selectedHUIds);
}
use of de.metas.ui.web.handlingunits.HUEditorView in project metasfresh-webui-api by metasfresh.
the class WEBUI_M_HU_Transform method newParametersFiller.
protected WebuiHUTransformParametersFiller newParametersFiller() {
final HUEditorView view = getView();
final HUEditorRow selectedRow = getSingleSelectedRow();
return WebuiHUTransformParametersFiller.builder().view(view).selectedRow(selectedRow).actionType(p_Action == null ? null : ActionType.valueOf(p_Action)).checkExistingHUsInsideView(view.getParameterAsBoolean(PARAM_CheckExistingHUsInsideView, false)).build();
}
Aggregations