Search in sources :

Example 1 with InvoiceForLease_sendByPost

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);
}
Also used : PostalAddress(org.incode.module.communications.dom.impl.commchannel.PostalAddress) Blob(org.apache.isis.applib.value.Blob) Invoice(org.estatio.module.invoice.dom.Invoice) Document(org.incode.module.document.dom.impl.docs.Document) InvoiceForLease_sendByPost(org.estatio.module.lease.dom.invoicing.comms.InvoiceForLease_sendByPost) Action(org.apache.isis.applib.annotation.Action) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Aggregations

Action (org.apache.isis.applib.annotation.Action)1 ActionLayout (org.apache.isis.applib.annotation.ActionLayout)1 Blob (org.apache.isis.applib.value.Blob)1 Invoice (org.estatio.module.invoice.dom.Invoice)1 InvoiceForLease_sendByPost (org.estatio.module.lease.dom.invoicing.comms.InvoiceForLease_sendByPost)1 PostalAddress (org.incode.module.communications.dom.impl.commchannel.PostalAddress)1 Document (org.incode.module.document.dom.impl.docs.Document)1