Generating Invoices

Case: You need to generate invoices for your consulting activities (could as well be products with only minor differences)
Solution: Use InfoQube and the built-in Template Merge feature

In this tutorial, you'll lean how to:
  1. Use a grid and the Doc pane to enter the invoice data
  2. Create a template file to merge the invoice data
  3. Use the template file to generate the print-ready / email-ready personalized invoice
     

Step 1: Entering Data

The sample IQBase has a built-in grid to do this. It is quite easy to recreate if it was deleted or a blank IQBase was used:
 

Alternatively, the Invoice form can be used to enter the details for each invoice:
 
 
Enter an ID, Date, worked start and end dates, the nb of hours worked and HrsRate.
 
The description of the work done is entered in the Doc pane to ease formatting (bold, bullets, etc):
 

The rest is automatically calculated by the field equations (sub total, taxes and total):
  • SubTotal = [Duration] * [HrsRate]
  • Taxes = 0.08 * [SubTotal]
  • InvoiceTotal =[SubTotal] + [Taxes]

As seen in 7. Example : Time Tracking, the pivot table could be used to compute totals per client or per year.
 

Step 2: Creating the Template File

The template file can be created using text editors or simple HTML editors.
More complex editors, such as Microsoft Word tend to add styles, classes and a lot of extra HTML content which is not compatible with the mail merge engine. If you use MS Word, ensure you save as "Web page, filtered"
 
One suitable HTML editor is IQ's built-in Doc pane of course !
  1. Create a new item, name it Invoice template
  2. In the Doc pane (or Item Editor window), set the document type to HTML file (Menu > File > New > New HTML File)
  3. Enter the invoice content. Copy / Paste content from other apps if needed
  4. Enter merge codes as needed, enclosed in { }. Details here: HTML Export Merge Fields and Codes
  5. Enter merge field as needed, enclosed in { }. To refer to the parent item field value, precede the field with "Parent.", i.e. {Parent.Item} refers to the parent item text
  6. Save
  7. The standard IQ installation package includes a sample template file named InvoiceEx.htm (AppFiles folder)
     

Step 3: Generating the Invoice

To generate invoices:
  1. Select one or more "invoice" items in the Invoices grid
  2. File > Print Preview
  3. Select 5- Merge the selected items with a template file
  4. Select the Template file
  5. Click Save and Preview

Alternatively, you can email-merge the invoice using the same dialog.