Search in sources :

Example 1 with PackageableRow

use of de.metas.ui.web.picking.packageable.PackageableRow in project metasfresh-webui-api by metasfresh.

the class WEBUI_HUsToPick_PickCU method getProductToPack.

private I_M_Product getProductToPack() {
    if (_productToPack == null) {
        final PackageableRow packageableRow = getSingleSelectedPackageableRow();
        final int productId = packageableRow.getProductId();
        _productToPack = loadOutOfTrx(productId, I_M_Product.class);
    }
    return _productToPack;
}
Also used : PackageableRow(de.metas.ui.web.picking.packageable.PackageableRow) I_M_Product(de.metas.adempiere.model.I_M_Product)

Example 2 with PackageableRow

use of de.metas.ui.web.picking.packageable.PackageableRow in project metasfresh-webui-api by metasfresh.

the class PickingSlotViewsIndexStorage method getOrCreatePickingSlotView.

private PickingSlotView getOrCreatePickingSlotView(@NonNull final ViewId pickingSlotViewId, final boolean create) {
    final PackageableView packageableView = getPackageableViewByPickingSlotViewId(pickingSlotViewId);
    final DocumentId packageableRowId = extractRowId(pickingSlotViewId);
    if (create) {
        return packageableView.computePickingSlotViewIfAbsent(packageableRowId, () -> {
            final PackageableRow packageableRow = packageableView.getById(packageableRowId);
            final CreateViewRequest createViewRequest = CreateViewRequest.builder(PickingConstants.WINDOWID_PickingSlotView, JSONViewDataType.includedView).setParentViewId(packageableView.getViewId()).setParentRowId(packageableRow.getId()).build();
            // provide all pickingView's M_ShipmentSchedule_IDs to the factory, because we want to show the same picking slots and picked HU-rows for all of them.
            final List<Integer> allShipmentScheduleIds = packageableView.streamByIds(DocumentIdsSelection.ALL).map(PackageableRow::cast).map(PackageableRow::getShipmentScheduleId).collect(Collectors.toList());
            return pickingSlotViewFactory.createView(createViewRequest, allShipmentScheduleIds);
        });
    } else {
        return packageableView.getPickingSlotViewOrNull(packageableRowId);
    }
}
Also used : PackageableRow(de.metas.ui.web.picking.packageable.PackageableRow) PackageableView(de.metas.ui.web.picking.packageable.PackageableView) DocumentId(de.metas.ui.web.window.datatypes.DocumentId) CreateViewRequest(de.metas.ui.web.view.CreateViewRequest)

Aggregations

PackageableRow (de.metas.ui.web.picking.packageable.PackageableRow)2 I_M_Product (de.metas.adempiere.model.I_M_Product)1 PackageableView (de.metas.ui.web.picking.packageable.PackageableView)1 CreateViewRequest (de.metas.ui.web.view.CreateViewRequest)1 DocumentId (de.metas.ui.web.window.datatypes.DocumentId)1