use of org.estatio.module.lease.dom.invoicing.comms.InvoiceForLease_sendByPost in project estatio by estatio.
the class InvoiceSummaryForPropertyDueDateStatus_sendByPostAbstract method $$.
@Action(semantics = SemanticsOf.NON_IDEMPOTENT_ARE_YOU_SURE)
@ActionLayout(contributed = Contributed.AS_ACTION)
public Blob $$(final String fileName) throws IOException {
final List<byte[]> pdfBytes = Lists.newArrayList();
for (final InvoiceAndDocument invoiceAndDocument : invoiceAndDocumentsToSend()) {
final Invoice invoice = invoiceAndDocument.getInvoice();
final Document prelimLetterOrInvoiceNote = invoiceAndDocument.getDocument();
final InvoiceForLease_sendByPost invoice_sendByPost = invoice_sendByPost(invoice);
final PostalAddress postalAddress = invoice_sendByPost.default1$$(prelimLetterOrInvoiceNote);
invoice_sendByPost.createPostalCommunicationAsSent(prelimLetterOrInvoiceNote, postalAddress);
invoice_sendByPost.appendPdfBytes(prelimLetterOrInvoiceNote, pdfBytes);
}
final byte[] mergedBytes = pdfBoxService.merge(pdfBytes.toArray(new byte[][] {}));
return new Blob(fileName, DocumentConstants.MIME_TYPE_APPLICATION_PDF, mergedBytes);
}
Aggregations