use of com.roadtocubaandbeyond.ordermanagement.entity.Document in project rtcab-ordermanagement by mariodavid.
the class OrderEdit method generateInvoice.
public void generateInvoice() {
Report invoiceReport = reportLoadService.loadReportBySystemcode("order_invoice");
String fileName = "myFile";
Map<String, Object> params = new HashMap<>();
params.put("entity", getItem());
FileDescriptor invoiceFile = reportService.createAndSaveReport(invoiceReport, params, fileName);
Document invoiceDocument = metadata.create(Document.class);
invoiceDocument.setFile(invoiceFile);
invoiceDocument.setName(fileName);
invoiceDocument.setType(DocumentType.INVOICE);
invoiceDocument.setOrder(getItem());
documentsDs.addItem(invoiceDocument);
}
Aggregations