Budgets, vendors and templates
Templates
Templates control how a purchase request looks when you print it or save it as a PDF. They use HTML with Handlebars syntax, test data for the preview, and default styling.
What it is for
A purchasing template is the layout of the printed purchase request. You write it in HTML with Handlebars syntax, which fills in the request details, such as the title, vendor, budget, lines, and totals.
People print a saved purchase request, or save it as a PDF, with one of the active templates.
Who can do it
Purchasing Admins create and change purchasing templates. A user with a direct Account Admin grant can do the same.
Requests Users and Purchasing Admins who open a saved purchase request use the active templates to print it.
Rights that give access: Purchasing Admin
Steps
Add a template
- In the menu, open Purchasing > Templates.
- Select Add Template. The new template starts with a sample layout and default CSS.
- In Title, enter a name that people will see when they choose a template to print.
- In Edit Template, change the HTML and Handlebars body. Check the result in Live Preview.
- In Styling, change the CSS if you need to.
- Select Save.
Change a template
- In the menu, open Purchasing > Templates.
- Select the title of the template to open it. To find it, you can search by title or filter by Created By.
- Change the template and check Live Preview.
- Select Save.
Check a template with other sample data
- Open the template and select Test Data.
- Change the sample JSON. If it is not valid JSON, Workflow shows Invalid JSON.
- Select Edit Template and check Live Preview with your sample data.
Print a purchase request
- Open a saved purchase request.
- Open the request status, then select the PDF button, Print/Save.
- In Print/Preview Template, choose a template in Select Templates if the account has two or more active templates.
- Check the preview and select Print/Save. In the print window of your browser, print the document or save it as a PDF.
Rules and details
- Printing and PDF preview of a saved purchase request work only when the account has at least one active purchasing template. Without one, the PDF button is turned off and asks you to add an active purchasing template.
- New templates are active. The template list shows the creator, the title, and the Created On date. In the actions of a row, use Open in New Tab or Copy Link.
- The Edit Template section holds the HTML and Handlebars body of the printed purchase request. Its editor suggests HTML, the supported helpers, and the field names from the current Test Data.
- Live Preview shows only in Edit Template. It shows the current template with the test data, so you can check the printed result while you edit. Test Data, Styling, and Help use the full width without the preview.
- Test Data is sample JSON that the preview and the field suggestions use. Its editor suggests the standard purchase request fields. Changes to Test Data do not change real purchase requests, and Workflow does not save them with the template.
- Styling holds the default CSS for the printed document. Workflow uses it when the template does not set its own styling.
- Help explains the Handlebars syntax and the helpers Compare, Format Price, and Format Dates.
- Use day-month-year dates in printed documents, for example {{formatDate createdAt "DD MMMM YYYY"}}.
- formatPrice takes an ISO currency code, such as THB or USD. By default, and with "short", it shows the short currency symbol for the language. With "long", it shows the currency name in that language.