Using a different overlay for draft invoices

You can use a different overlay for draft invoices. The word DRAFT is added as a watermark to the document.

Use case:

  • Create a document type and report rule for the Invoice report, or use an existing document type.
  • Create an extra overlay PDF file, which is added to the Invoice report for draft invoices. Other invoice reports do not get this overlay. Based on a condition, the draft overlay is selected and merged with the document.

Complete these steps:

  1. Start the Document Types (ttrpi2510m000) session. Select the Invoice document type and open its details.
  2. On the Parts tab, add a new record for another overlay part with these properties:
    • Description : Overlay Draft
    • Destination Type : All
    • Part Type : Overlay
    • Overlay Type : All Pages
  3. Add this code to the Condition Expression field:
    if tolower$(#print.type#) = "draft" then
           return(true)
    endif
    return(false)
  4. Save this record.
  5. Create a PDF file with a draft watermark and upload this file to the new document type part.
  6. Click Validate to validate the document type.
    Note that a new variable is added to the document type, called print.type.
  7. Start the Report Rules (ttrpi2520m000) session.
  8. Select the report rule for report cisli12001000, which is linked to the Invoice document type.
    Open the details for this report rule.
  9. On the Variables tab, click Refresh Variables, to refresh the variables from the document type.
  10. For the new variable, specify this expression: r.print.type.
  11. Save this record, and click Validate to validate the report rule.
  12. Print a draft invoice to the Document Output Management device and view the results.