use of de.metas.pricing.IEditablePricingContext 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;
}
Aggregations