Search in sources :

Example 1 with IPricingBL

use of de.metas.pricing.service.IPricingBL in project metasfresh-webui-api by metasfresh.

the class ProductPricingConditionsViewFactory method createPricingContext.

private IPricingContext createPricingContext(final BasePricingSystemPriceCalculatorRequest request) {
    final IPricingBL pricingBL = Services.get(IPricingBL.class);
    final PricingConditionsBreak pricingConditionsBreak = request.getPricingConditionsBreak();
    final IEditablePricingContext pricingCtx = pricingBL.createPricingContext();
    final ProductId productId = pricingConditionsBreak.getMatchCriteria().getProductId();
    pricingCtx.setProductId(productId);
    pricingCtx.setQty(BigDecimal.ONE);
    pricingCtx.setBPartnerId(request.getBpartnerId());
    pricingCtx.setSOTrx(SOTrx.ofBoolean(request.isSOTrx()));
    return pricingCtx;
}
Also used : PricingConditionsBreak(de.metas.pricing.conditions.PricingConditionsBreak) IPricingBL(de.metas.pricing.service.IPricingBL) IEditablePricingContext(de.metas.pricing.IEditablePricingContext) ProductId(de.metas.product.ProductId)

Aggregations

IEditablePricingContext (de.metas.pricing.IEditablePricingContext)1 PricingConditionsBreak (de.metas.pricing.conditions.PricingConditionsBreak)1 IPricingBL (de.metas.pricing.service.IPricingBL)1 ProductId (de.metas.product.ProductId)1