# The Invoice Template

<p class="callout info">The Invoice Template feature allows administrators to fully customize the email and PDF invoices sent to companies for outstanding permits. Its primary purpose is to ensure that billing communications accurately reflect your organizational branding while dynamically generating all necessary financial details using shortcodes. This article is intended for OPS-COM administrators.</p>

## Setup and Configuration

Configuring the invoice template involves adjusting the meta data that dictates how the email is identified and formatted before it reaches the recipient.

**Admin Side:**

1. Hover over **System Config** and click **Email Templates**.
2. Click the **Edit** button next to **Permit Invoice** to access the template configuration form.
3. Enter a descriptive name for internal reference in the **Label** field.
4. Choose the appropriate language from the **Language** drop-down menu.
5. Select the default layout from the **Layout** drop-down menu.
6. Enter the text that will appear as the email subject line in the **Subject** field.

<p class="callout success">You can successfully use shortcodes in the **Subject** field to dynamically personalize the email. For example, inserting **\[invoice account="name"\]** will automatically call up and display the specific account name for the company being invoiced directly in the subject line.</p>

**User Side:** End-users do not interact with the setup or configuration of administrative email templates.

## Using this Feature

The template form interface contains four primary areas: Meta Data at the top, a list of available Short Codes on the left, the actual visual Template on the right, and a Text Content field at the bottom (used for configuring a plain text version of the invoice).

Administrators interact with the visual template editor to place static branding and dynamic shortcodes.

### Available Shortcodes

The template allows the use of special tokens, or shortcodes, to accurately pull live information from the database and populate the invoice when sent. These function similarly to a standard mail merge.

- **\[invoice account="number"\]**: The account number for the company.
- **\[invoice account="name"\]**: The account name for the company.
- **\[invoice account="fulladdress"\]**: The full address for the company.
- **\[invoice account="invoice\_comments"\]**: The invoice comment value that is editable for companies only. Any line breaks will be preserved.
- **\[invoice show="invoiceno"\]**: The unique Invoice Number.
- **\[invoice show="duedate"\]**: The invoice due date.
- **\[invoice show="billdate"\]**: The invoice bill date.
- **\[invoice show="subtotal"\]**: The subtotal of all items before *[Taxes](https://opscom.wiki/books/setup-configuration-for-admins/page/taxes)*<span class="citation-1170 citation-1171 citation-end-1171">.<sup class="superscript embedded" data-turn-source-index="1"></sup></span><span class="citation-1170 citation-end-1170"><sup class="superscript embedded" data-turn-source-index="2"></sup></span>
- **<span class="citation-1168 citation-1169">\[invoice show="taxtotal"\]</span>**<span class="citation-1168 citation-1169 citation-end-1169">: The total calculated amount of tax.<sup class="superscript embedded" data-turn-source-index="3"></sup></span><span class="citation-1168 citation-end-1168"><sup class="superscript embedded" data-turn-source-index="4"></sup></span>
- **<span class="citation-1166 citation-1167">\[invoice show="amounttotal"\]</span>**<span class="citation-1166 citation-1167 citation-end-1167">: The total sum amount for all outstanding permits for this invoice.<sup class="superscript embedded" data-turn-source-index="5"></sup></span><span class="citation-1166 citation-end-1166"><sup class="superscript embedded" data-turn-source-index="6"></sup></span>
- **<span class="citation-1164 citation-1165">\[invoice show="counttotal"\]</span>**<span class="citation-1164 citation-1165 citation-end-1165">: The total number of permits<sup class="superscript embedded" data-turn-source-index="7"></sup></span><span class="citation-1164 citation-end-1164"> for the selected sales window.<sup class="superscript embedded" data-turn-source-index="8"></sup></span>
- **<span class="citation-1163">\[invoice show="details"\]</span>**<span class="citation-1163 citation-end-1163">: The comprehen<sup class="superscript embedded" data-turn-source-index="9"></sup></span>sive list of permits, costs, and who holds the permit.

### Customizing the Template Sections

There are several key areas on the template that should be actively edited by the admin to ensure proper branding and data delivery:

- **Company Logo Field:** Replace the placeholder by inserting your o<span class="citation-1161 citation-1162 citation-end-1162">rganization's logo.<sup class="superscript embedded" data-turn-source-index="10"></sup></span><span class="citation-1161 citation-end-1161"><sup class="superscript embedded" data-turn-source-index="11"></sup></span>
- **<span class="citation-1159 citation-1160">Company Address:</span>**<span class="citation-1159 citation-1160 citation-end-1160"> Enter your physical organizational address so it clearly appears on the generated document.<sup class="superscript embedded" data-turn-source-index="12"></sup></span><span class="citation-1159 citation-end-1159"><sup class="superscript embedded" data-turn-source-index="13"></sup></span>
- **<span class="citation-1157 citation-1158">Invoice Identification:</span>**<span class="citation-1157 citation-1158"> Insert shortcodes to pull in the </span>**<span class="citation-1157 citation-1158">\[invoice show="invoiceno"\]</span>**<span class="citation-1157 citation-1158 citation-end-1158">, <sup class="superscript embedded" data-turn-source-index="14"></sup></span>**<span class="citation-1157 citation-end-1157">\[invoice show="bi<sup class="superscript embedded" data-turn-source-index="15"></sup></span>lldate"\]**, and **\[invoice show="duedate"\]**.
- **Invoice Details:** Insert the **\[invoice show="details"\]** shortcode. When generated, this will automatically expand to list the Parker's Name, Item type being paid for (e.g., Permit, Access card), Item number (Permit Number), Sales Window, Lot Name, Quantity, and Cost.
- **Payment Information:** Insert shortcodes to dynamically pull in the billing cost information, such as the **\[invoice show="subtotal"\]**, **\[invoice show="taxtotal"\]**, and **\[invoice show="amounttotal"\]**.

---

## <span style="color: rgb(22, 145, 121);">Best Practices and Considerations</span>

- <span style="color: rgb(22, 145, 121);">**Optimize your logo format:** **Using a JPEG or PNG file format is highly recommended for your company logo.** These formats ensure the highest quality rendering when the system generates the attached PDF version of the invoice.</span>
- <span style="color: rgb(22, 145, 121);">**Verify data placement:** **Always test your shortcodes by generating a sample invoice.** This ensures the system retrieves and formats the intended data (such as the company's full address and account number) exactly where you placed the tokens.</span>
- <span style="color: rgb(22, 145, 121);">**Leverage company comments:** **Add specific billing instructions or notes in the company configuration.** Using the **\[invoice account="invoice\_comments"\]** shortcode allows you to pass these targeted messages directly onto the finalized invoice, maintaining clear communication with corporate clients.</span>