public ModelAndView taxDetails(final HttpServletRequest request, final Model model) throws Exception {
ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), BoUrls.TAX_DETAILS.getVelocityPage());
final RequestData requestData = requestUtil.getRequestData(request);
final String taxCode = request.getParameter(RequestConstants.REQUEST_PARAMETER_TAX_CODE);
final Tax tax = taxService.getTaxByCode(taxCode);
// SANITY CHECK
if(tax != null){
modelAndView.addObject(ModelConstants.TAX_VIEW_BEAN, backofficeViewBeanFactory.buildViewBeanTax(requestData, tax));
} else {
final String url = requestUtil.getLastRequestUrl(request);
return new ModelAndView(new RedirectView(url));
}
model.addAttribute(ModelConstants.URL_BACK, backofficeUrlService.generateUrl(BoUrls.TAX_LIST, requestData));
Object[] params = {tax.getName() + " (" + tax.getCode() + ")"};
overrideDefaultSeoPageTitleAndMainContentTitle(request, modelAndView, BoUrls.TAX_DETAILS.getKey(), params);
return modelAndView;
}