Search in sources :

Example 1 with BillOfMaterialService

use of com.axelor.apps.production.service.BillOfMaterialService in project axelor-open-suite by axelor.

the class BillOfMaterialController method print.

public void print(ActionRequest request, ActionResponse response) throws AxelorException {
    BillOfMaterial billOfMaterial = request.getContext().asType(BillOfMaterial.class);
    BillOfMaterialService billOfMaterialService = Beans.get(BillOfMaterialService.class);
    String language = ReportSettings.getPrintingLocale(null);
    String name = billOfMaterialService.getFileName(billOfMaterial);
    String fileLink = billOfMaterialService.getReportLink(billOfMaterial, name, language, ReportSettings.FORMAT_PDF);
    LOG.debug("Printing " + name);
    response.setView(ActionView.define(name).add("html", fileLink).map());
}
Also used : BillOfMaterial(com.axelor.apps.production.db.BillOfMaterial) BillOfMaterialService(com.axelor.apps.production.service.BillOfMaterialService)

Aggregations

BillOfMaterial (com.axelor.apps.production.db.BillOfMaterial)1 BillOfMaterialService (com.axelor.apps.production.service.BillOfMaterialService)1