Generate the Invoice Document for an Invoice

Use this activity to generate the invoice document for an invoice, so that it can be distributed to the default or selected recipient, or printed.

This activity can be performed only on an invoice with an Invoice Status of Draft or Edited.

Note: Ensure that WIP and estimate amounts are up to date prior to generating a work-in-progress invoice for an invoice. WIP and estimate amounts can also be updated in the CCFNRP—Financial Report application.

When generating the invoice document for an invoice, then the invoice line items are extracted for the report in the invoice's Locale, and the LANGUAGE variable for the report, available in the DSC, is set to the invoice’s Locale.

Activity Steps

  1. Proceed to update the invoice, and during this action, include the following steps.
  2. Click Generate Invoice.

    The Send Invoice dialog box displays.

    Where the AUTO_DISTRIBUTE_INVOICES application preference is checked, then the Email and Print check boxes default to checked.

  3. To email the invoice documents, check Email, enter Email To and an optional Email CC.

    Email To defaults to the email address of the contact code on the invoice.

  4. To print the invoice documents, check Print, enter Printer and Number Of Copies.

    If the INVOICE_DEFAULT_DEVICE application preference is defined and contains a Device Code, and no default device is attached to the report template in use, when entering distribution details for an invoice or credit note, then the printer defaults to this device.

    If the INVOICE_COPIES application preference is defined, when entering distribution details for an invoice, then the number of copies for printing defaults to this number.

    Click OK.The invoice document is generated using the invoice's Invoice Template. The invoice document's filename is generated from the invoice template's Filename Syntax Code. The invoice's File is updated with the invoice document's filename.

    For each job associated with the invoice:

    • If the job's First Invoiced Date is empty, then the job's First Invoiced Date is set to the current system date-time and the job's First Invoiced By is set to the current user.

    An invoice document generated in this way is displayed on the Invoice Documents tab, and can be downloaded and re-printed at any time.

The Process used to Generate Invoice Reports

Invoice reports are created for client invoices and for job costings, for both work-in-progress (WIP) and estimate type of pricing.

  1. The template must be a ZIP file that contains a DSC (direct source connection) file, such that, the DSC locates the data source/s and creates the required result sets from there.
  2. The DSC-based result sets are populated using the invoice number, invoice type and invoice status as criteria.
  3. The DSC-based result sets are packaged up and sent to the report engine along with the template, and the format required for the output.
  4. The report engine returns the output file.
  5. A default suffix is only applied to those invoice document where no extension is specified by the invoice, report template, or script. The default output format specifies (to the reporting engine) the format for the invoice document. For example, the output could be a PDF, DOC, XLS, XLS_DATA, RFT, TXT, CSV or RPT file.
  6. Report distribution takes place, if specified.

During this report generation process, if the template is linked to a report script code then at each hook point in the report generation process, the related event in the script is run.

The system batch queue is used to perform the processing of WIP and estimate client invoices only, including the distribution, but is not used for WIP nor estimate job costings as these are processed interactively. The result of the batch job execution can be seen on the History tab of the CCRPTR—Report Request application.

Conditions for Distributing Invoices

The invoice document is distributed, as required. However, where the Email is selected but there is no Email To or Email CC supplied and the EMAIL_BCC application preference is not defined or does not contain a valid email address, then no error is raised and no batch queue email job is created, and where the Print is selected but there is no Printer or Number of Copies specified, then no error is raised and no batch queue print job is created.

If a syntax exists that is in scope and has a Syntax Type of Report Request and a Syntax Code of EMAIL_SUBJECT_TEXT preference, when entering distribution details for a report, then the email subject body contains the text generated by the syntax. Note that this syntax should evaluate only to a single-line subject.

If a syntax exists that is in scope and has a Syntax Type of Report Request and a Syntax Code of EMAIL_MESSAGE_TEXT preference, when entering distribution details for a report, then the email message body contains the text generated by the syntax.

If the EMAIL_BCC application preference is defined and contains a valid email address, when the generated reports are emailed, then the BCC email address is set to this email address.

If the EMAIL_ZIP_ATTACHMENTS application preference is defined and selected, when the generated reports are emailed, then one zip file containing all of the generated reports is emailed as an attachment to the email. If the EMAIL_ZIP_ATTACHMENTS application preference is not defined, or is defined and cleared, when the generated reports are emailed, then multiple attachments are added to the email/s.