use of com.axelor.apps.base.service.ProductCategoryService in project axelor-open-suite by axelor.
the class ProductCategoryController method showExistingDiscounts.
/**
* Called from product category view on maxDiscount change. Call {@link
* ProductCategoryService#computeDiscountMessage(ProductCategory)}.
*
* @param request
* @param response
*/
public void showExistingDiscounts(ActionRequest request, ActionResponse response) {
try {
ProductCategory productCategory = request.getContext().asType(ProductCategory.class);
String discountsMessage = Beans.get(ProductCategoryService.class).computeDiscountMessage(productCategory);
if (!"".equals(discountsMessage)) {
response.setFlash(discountsMessage);
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
Aggregations