Search in sources :

Example 1 with ProductsProposalRowsData

use of de.metas.ui.web.order.products_proposal.model.ProductsProposalRowsData in project metasfresh-webui-api by metasfresh.

the class BasePLVProductsProposalViewFactory method createView.

public final ProductsProposalView createView(@NonNull final ProductsProposalView parentView) {
    final PriceListVersionId basePriceListVersionId = parentView.getBasePriceListVersionIdOrFail();
    final ProductsProposalRowsData rowsData = ProductsProposalRowsLoader.builder().bpartnerProductStatsService(bpartnerProductStatsService).priceListVersionId(basePriceListVersionId).productIdsToExclude(parentView.getProductIds()).bpartnerId(parentView.getBpartnerId().orElse(null)).soTrx(parentView.getSoTrx()).build().load();
    logger.debug("loaded ProductsProposalRowsData with size={} for basePriceListVersionId={}", basePriceListVersionId, rowsData.size());
    final ProductsProposalView view = ProductsProposalView.builder().windowId(getWindowId()).rowsData(rowsData).processes(getRelatedProcessDescriptors()).initialViewId(parentView.getInitialViewId()).build();
    put(view);
    return view;
}
Also used : ProductsProposalRowsData(de.metas.ui.web.order.products_proposal.model.ProductsProposalRowsData) PriceListVersionId(de.metas.pricing.PriceListVersionId)

Example 2 with ProductsProposalRowsData

use of de.metas.ui.web.order.products_proposal.model.ProductsProposalRowsData in project metasfresh-webui-api by metasfresh.

the class OtherSalePricesProductsProposalViewFactory method createView.

public final ProductsProposalView createView(@NonNull final ProductsProposalView parentView, @NonNull final List<ProductsProposalRow> selectedRows) {
    final ImmutableSet<ProductId> productIds = selectedRows.stream().map(ProductsProposalRow::getProductId).collect(ImmutableSet.toImmutableSet());
    final ProductsProposalRowsData rowsData = RowsLoader.builder().bpartnerProductStatsService(bpartnerProductStatsService).moneyService(moneyService).excludeBPartnerId(parentView.getBpartnerId().orElse(null)).productIds(productIds).build().load();
    final ProductsProposalView view = ProductsProposalView.builder().windowId(getWindowId()).rowsData(rowsData).processes(getRelatedProcessDescriptors()).initialViewId(parentView.getInitialViewId()).build();
    put(view);
    return view;
}
Also used : ProductsProposalRowsData(de.metas.ui.web.order.products_proposal.model.ProductsProposalRowsData) ProductId(de.metas.product.ProductId)

Aggregations

ProductsProposalRowsData (de.metas.ui.web.order.products_proposal.model.ProductsProposalRowsData)2 PriceListVersionId (de.metas.pricing.PriceListVersionId)1 ProductId (de.metas.product.ProductId)1