Add Document Handling to the Sales Invoice report - configuration
1. Select the sales invoice report, and click Setup > Document Handling.
If the document should be sent to the customer afterward, set the Restriction to External.
3. From the Document type dropdown, choose Original. This way, you only store the Original posted and no Proformas.
The document is now stored where required.
Here you can see the Description and the value in notes showing the invoiceId:
Add CustInvoiceJour table to CustCollectionJour Query wizard
The reference table in which the attachments are stored must be added to the CustCollectionJour report.
From the ribbon, click Query wizard and add the CustInvoiceJour table to CustCollectionJourTmp.
The relations are displayed as follows:
Attach the above Sales Invoice to the Collection letter
1. Navigate to Lasernet > Reports, find the Collection letter and click Attachments.
2. Click New to create a new line.
3. Add the Attachment reference table, in this case the CustInvoiceJour table, and only include the attachments with restriction External (should be the same restriction as set up in the Document Handling step).
The sales invoices will be attached to your CustCollectionLetter emails as follows:
In a Collection letter process, there are several interactions with the customer:
Collection letter 1
Collection letter 2
Collection letter 3
Consider whether you need to include the Sales Invoices on all interactions.
If you decide to only include them in a specific interaction, add a condition on attachments as follows:
1. Choose Query in Condition.
2. Click the Select button.
The Inquiry opens.
3. Choose table CustCollectionLetterJour and field CollectionLetterCode. Choose when you want the attachments to come. You can choose one or several.
In this example, we have chosen that we only want to include the attachments on the first Collection letter to the customer.
4. Click OK.
The above should be completed on FreeTextInvoice as well, to save that to DocuRef.
Keep in mind that, at the setup time, the system has not yet created the invoice PDFs to DocuRef for the reports that have already been printed in the past.
You can mark them in the Invoice journal and force rerun to make them go through Lasernet Connector with the new settings, then they will get to DocuRef.
Use a filter, mark all, or several in invoice journal and resend to save time.
Attachments with LACAddAttachments()
The above setup will add attachment details on the JobInfo section of the CustCollectionLetter XML. Our Lasernet Default Configuration is configured to process attachments from this section of the XML.
However, attachments can be added on the line level of the CustCollectionLetter report using context method LACAddAttachments().
Using this method for attachments will require modification of the Lasernet configuration to process the relevant sections of the XML.
1. Open the Query wizard for the CustCollectionLetter report.
2. Add Docuref to CustInvoiceJour.
Since we are on the line level for the Invoice numbers, several invoice attachments can be added to our CustCollectionLetter.
This field allows the docuref table to be added several times/per line.