Use Case

Invoice

Generating dynamic invoices

General Use Case

Tag can be used for content automation in all industries, to create many different kinds of documents. This use case describes how to automate a simple invoice document.

Data-driven invoice

Background
Creating an invoice is a very common task. Invoices vary, in part, according to complexity (one detail item vs. many) and frequency (how often they are created).

Tag is well suited for simple invoices that are sent periodically for item purchases, consulting and other professional services.

This use case demonstrates how to automate a single invoice item which is subject to tax. All files are available as a reusable sample in Tag (Scribe sample: "invoice"). This sample runs in the Scribe app and can easily be adapted to meet other requirements.

  • -> Reduce copy/paste errors
    -> Ensure customer and order information is accurate
    -> Use standard company header/footer and branding
    -> Gather summary invoice data for year-end accounting

  • -> import customer and order data to eliminate copy/paste and other data entry errors
    -> Calculate predictable data fields like tax collected and invoice total
    -> Create easy to update company header/footer and branding that can be shared with other documents
    -> Gather summary invoice data for year-end accounting

How does it work?

The starting point for generating invoices is usually a static copy of the desired layout. This can be imported into Tag from existing *.docx (Microsoft Word) and other document formats.

There are many different layouts for invoices that can be found on the internet and then replicated in the template editor in Tag.

Dynamic invoice data can include the following:

  • Customer information

  • Order information

  • Order number

  • Order date

  • Total including tax

Customer information often comes from a Customer Relationship Management (CRM) system like Salesforce, Zoho or Pipedrive. If you don’t have a CRM, then a simple CSV file (like an Excel spreadsheet) will work as well. In this example, customer information is obtained from a CSV file that has 5 columns (Account, City, Country, Phone and Email).

Order information includes things like order number, date, item description, price, tax and total. The specific data fields required can vary considerably for different industries.

Calculated fields are defined when writing templates. In the invoice sample, Order number, Order date, Tax collected and Invoice total fields are automatically calculated: a unique Order number is generated using the current date (assumes monthly billing); Order date is captured when the invoice is created; Tax collected and invoice total are calculated using price and tax rate. These calculations are shown below.

Data validation is based on form control types. This helps to prevent data-entry errors. For example, the itemPrice, taxCollected and invoiceTotal fields use a decimal box, while the tax field uses an integer box (to store the tax % value). The form (see below) will check that entered data matches these settings.

Layout is specified in the template editor using tables to align labels and values. Static labels and dynamic values (logic bubbles) are intermixed as shown below.

As invoices often share headers and footer with other office documents, it can be useful to store company branding, letterheads, and common fragments in a common file that can be reused by other invoice or document types. This use case supports that approach by creating two template files: branding and invoice.

The branding.xsl template file stores templates for header and footer. It is also a handy place for shared bits of content or logic. In this example, the header displays contact information and a logo.

The invoice.xsl template file is very simple. It has one start template that generates the invoice. It imports the branding template file and the invoice data setup file (which makes invoice data visible when defining logic).

When you create a new invoice data file for your customer, Tag will automatically create a form for you to fill out based on the data setup files in use.

When a new data file is created, the calculated fields will run if they have sufficient information and auto-populate the form.

Customer data is entered using the Auto fill feature, which lets you import data from a CSV file. The form can also import directly from a web API, if your CRM provides that capability (most do). Order data is entered manually using intuitive form controls.

Note that data from multiple invoices can easily be merged into a single CSV file, making it available for year-end accounting and process streamlining.

Once all data is entered, it is time to generate. Generation creates a new word processing document and saves it to a file. You can select any file location that is visible to your computer, including cloud drives like Google Drive and Microsoft’s OneDrive. The generated document for the invoice sample looks like this.

Summary

When invoices are manually created, there is often quite a bit of copy/paste involved. Customer and order data may come from other systems or get manually copied from other documents. Each time a piece of information is pasted, there is a chance of a mistake.

When customer data is imported from a CSV or web API, there is little chance for errors like this. Similarly, data validation in forms and calculated fields both reduce the chance of data errors.

By saving headers and footers in a separate template file, reuse and standardization of company branding is improved. Other generated documents can reuse them, and if changes are made all affected documents will be automatically updated.

Aggregating data from multiple invoices makes a lot of sense. Having an accurate CSV that summarizes customer and order information can be valuable, and not just for year-end accounting. By adding fields that better describe your orders (e.g., add dropdown lists that describe shipping and/or order fulfillment in some way), you can improve team communication and order delivery.

All files described in this use case are available as a sample in Tag that you can download. If you have any questions about how to reuse the "invoice" sample, please contact us.