Search in sources :

Example 1 with HUEditorView

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);
}
Also used : HUEditorView(de.metas.ui.web.handlingunits.HUEditorView) HUEditorRow(de.metas.ui.web.handlingunits.HUEditorRow)

Example 2 with HUEditorView

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);
}
Also used : PickingSlotView(de.metas.ui.web.picking.pickingslot.PickingSlotView) DocumentId(de.metas.ui.web.window.datatypes.DocumentId) HUEditorView(de.metas.ui.web.handlingunits.HUEditorView)

Example 3 with HUEditorView

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;
}
Also used : ADProcessPostProcessService(de.metas.ui.web.process.adprocess.ADProcessPostProcessService) AdempiereException(org.adempiere.exceptions.AdempiereException) ProcessInstanceResult(de.metas.ui.web.process.ProcessInstanceResult) ViewId(de.metas.ui.web.view.ViewId) HUReportExecutorResult(de.metas.handlingunits.report.HUReportExecutorResult) HUEditorView(de.metas.ui.web.handlingunits.HUEditorView) DocumentCollection(de.metas.ui.web.window.model.DocumentCollection) IViewsRepository(de.metas.ui.web.view.IViewsRepository)

Example 4 with HUEditorView

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);
}
Also used : IHandlingUnitsBL(de.metas.handlingunits.IHandlingUnitsBL) GuavaCollectors(org.adempiere.util.GuavaCollectors) Autowired(org.springframework.beans.factory.annotation.Autowired) DocumentCollection(de.metas.ui.web.window.model.DocumentCollection) BigDecimal(java.math.BigDecimal) LookupValuesList(de.metas.ui.web.window.datatypes.LookupValuesList) I_M_HU_PI_Item(de.metas.handlingunits.model.I_M_HU_PI_Item) I_M_HU(de.metas.handlingunits.model.I_M_HU) TableRecordReference(org.adempiere.util.lang.impl.TableRecordReference) IProcessDefaultParameter(de.metas.process.IProcessDefaultParameter) IProcessPrecondition(de.metas.process.IProcessPrecondition) DocumentIdsSelection(de.metas.ui.web.window.datatypes.DocumentIdsSelection) HUEditorRow(de.metas.ui.web.handlingunits.HUEditorRow) ImmutableSet(com.google.common.collect.ImmutableSet) LookupSource(de.metas.ui.web.window.descriptor.DocumentLayoutElementFieldDescriptor.LookupSource) LookupDataSourceContext(de.metas.ui.web.window.model.lookup.LookupDataSourceContext) Collection(java.util.Collection) HUEditorProcessTemplate(de.metas.ui.web.handlingunits.HUEditorProcessTemplate) I_M_HU_PI_Item_Product(de.metas.handlingunits.model.I_M_HU_PI_Item_Product) Profile(org.springframework.context.annotation.Profile) ProcessPreconditionsResolution(de.metas.process.ProcessPreconditionsResolution) Services(org.adempiere.util.Services) List(java.util.List) Param(de.metas.process.Param) Profiles(de.metas.Profiles) IProcessDefaultParametersProvider(de.metas.process.IProcessDefaultParametersProvider) RunOutOfTrx(de.metas.process.RunOutOfTrx) InterfaceWrapperHelper.load(org.adempiere.model.InterfaceWrapperHelper.load) ActionType(de.metas.ui.web.handlingunits.process.WebuiHUTransformCommand.ActionType) ProcessParamLookupValuesProvider(de.metas.ui.web.process.descriptor.ProcessParamLookupValuesProvider) HUEditorView(de.metas.ui.web.handlingunits.HUEditorView) DocumentIdsSelection(de.metas.ui.web.window.datatypes.DocumentIdsSelection) HUEditorView(de.metas.ui.web.handlingunits.HUEditorView)

Example 5 with HUEditorView

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();
}
Also used : HUEditorView(de.metas.ui.web.handlingunits.HUEditorView) HUEditorRow(de.metas.ui.web.handlingunits.HUEditorRow)

Aggregations

HUEditorView (de.metas.ui.web.handlingunits.HUEditorView)13 HUEditorRow (de.metas.ui.web.handlingunits.HUEditorRow)8 DocumentIdsSelection (de.metas.ui.web.window.datatypes.DocumentIdsSelection)6 I_M_HU (de.metas.handlingunits.model.I_M_HU)5 IProcessPrecondition (de.metas.process.IProcessPrecondition)5 ProcessPreconditionsResolution (de.metas.process.ProcessPreconditionsResolution)5 DocumentCollection (de.metas.ui.web.window.model.DocumentCollection)5 ImmutableSet (com.google.common.collect.ImmutableSet)4 IHandlingUnitsBL (de.metas.handlingunits.IHandlingUnitsBL)4 Param (de.metas.process.Param)4 HUEditorProcessTemplate (de.metas.ui.web.handlingunits.HUEditorProcessTemplate)4 Collection (java.util.Collection)4 List (java.util.List)4 InterfaceWrapperHelper.load (org.adempiere.model.InterfaceWrapperHelper.load)4 Services (org.adempiere.util.Services)4 Autowired (org.springframework.beans.factory.annotation.Autowired)4 Splitter (com.google.common.base.Splitter)2 ImmutableList (com.google.common.collect.ImmutableList)2 Profiles (de.metas.Profiles)2 I_M_HU_PI_Item (de.metas.handlingunits.model.I_M_HU_PI_Item)2