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