Templates
Variables (Proposals)
The following variables are available in the template.ejs
files of proposal templates:
#Variables
proposal | Proposal | The proposal that is being rendered. |
showCakedeskBranding |
boolean |
Whether or not to display Cakedesk branding on the proposal. |
#Proposal
proposalId |
string | The user-facing proposal ID.
|
language |
string | The language of the proposal.
|
proposalDate |
string | The date of the proposal.
|
hasVat |
boolean |
Does the proposal include VAT? |
hasQuantities |
boolean |
Does the proposal include quantities for each individual item? |
proposalText | RichText | A piece of text to go along with the proposal. |
buyer | ProposalBuyer | The client. |
seller | ProposalSeller | You. |
items | ProposalItem[] | The individual items that make up the proposal. |
taxSubtotals | TaxSubtotal[] | An array of tax subtotals. Only relevant if |
totalTaxes | MoneyValue | The total amount of taxes included in this proposal. The sum of all VAT. |
subtotal | MoneyValue | The total amount without taxes. |
total | MoneyValue | The total amount including taxes. |
#ProposalBuyer
id |
string | The client's user-facing ID.
|
name |
string | The full name of the client.
|
vatId |
string | The VAT ID of the client.
|
address | Address | The address of the client. |
#ProposalSeller
name |
string | Your company name.
|
vatId |
string | Your VAT ID.
|
phone |
string | Your phone number.
|
email |
string | Your email.
|
website |
string | Your website.
|
address | Address | Your address. |
#Address
To display an address, formatted correctly for its respective country, it's recommended to use the joinAddress
helper.
address |
string | The address part of the address. Usually contains street and street number but can include other
information as well and span multiple lines. For countries whose address format is unknown, the
entire address will be entered in this field, separated by new lines ('\n').
|
addressLine2 |
string | The second part of the address.
|
zipCode |
string | The zip code of the address
|
city |
string | The city.
|
countryCode |
string | The country code.
|
#ProposalItem
title |
string |
The title of the item. |
description | RichText | An optional description for the item. Can be an empty string. |
unitPrice | MoneyValue | The price of a single unit of that item. Only relevant if proposal.hasQuantities is true . |
quantity |
number |
How many of this item were sold. Only relevant if proposal.hasQuantities is true . |
unit | Unit | null | The unit type for this item, or |
amount | MoneyValue | The total price of this item (excluding VAT). |
vatPercentage |
number | null | How much VAT is applied for this item. Only relevant if |
items | ProposalItem[] | Only the top-level proposal items can have child items. |
total | MoneyValue | The total price of this item, including subitems (excluding VAT). |
#Unit
An object describing a unit, for example "hours" or "days" or "kg". To display a unit in a template, it's recommended to use the formatQuantity
or formatUnit
helper.
unitId |
string | A unique slug-like identifier of the unit. Can be used in templates to check if a certain type of unit is provided for an item. |
label.plural | MultiLangString | The label for this unit if quantity is 0 or greater than 1 . |
label.singular | MultiLangString | The label for this unit if quantity is 1 . |
#Example
{
"unitId": "hours",
"label": {
"plural": {
"en": "Hours",
"de": "Stunden"
},
"singular": {
"en": "Hour",
"de": "Stunde"
}
}
}
#TaxSubtotal
vatPercentage |
number | The VAT percentage of this tax subtotal.
|
subtotal | MoneyValue | The amount of this tax subtotal. |
#MoneyValue
currency |
string | The currency of this particular value.
|
amount |
number | The amount for this particular value, in cents.
|
#RichText
Variables with type RichText
are strings of HTML markup. It can include the following tags:
<p>
<ul>
<ol>
<li>
<strong>
#MultiLangString
An object containing one or more languages as a key and strings
as values.
It is not guaranteed that each language is present as a key, or that each key has a value.
#Example
{ "en": "Hello", "de": "Hallo" }