Skip to main content
All CollectionsTemplatesIntroduction
Contract template examples
Contract template examples
Thomas van Beek avatar
Written by Thomas van Beek
Updated over 4 years ago

We are going to work our way towards detailed deal information in the template. Just want the code? Scroll down to the bottom for the final result.

If Statements

If statements can be used to display information when a certain datapoint contains specific data.

Example #1

{% if event.event_type == 'Clubshow' %}
  We are playing a clubshow!
{% endif %}

This will display the text "We are playing a clubshow!" whenever the event type is "Clubshow". 

There are several methods available within the if statement:

  • ==
    If datapoint on the left is the same as the text on the right.

  • !=
    If datapoint on the left is different from the text on the right.

  • >
    If datapoint on the left is bigger than the number on the right.

  • <
    If datapoint on the left is smaller than the number on the right.

Examples:

{% if event.vat_percentage > 0 %}
  {{ event.vat_percentage }}% VAT Due
{% endif %}

This will display the sentence "9% VAT Due" when you enter a VAT Percentage of 9% within the deal. If the vat_percentage is 0 the sentence will not be shown.

Basic Deal info - Final Result

{% if event.deal_type != "Door deal" %}
  {{ event.currency_symbol }} {{ event.flat_fee | format_money }}
  {% if event.deal_type == 'Guarantee' %}
    + {{ event.deal_percentage_artist | format_percentage }}% ticket share after breakeven
  {% endif %}
  {% if event.deal_type == 'Guarantee Plus' %}
    + {{ event.deal_percentage_artist | format_percentage }}% ticket share
  {% endif %}
  {% if event.deal_type == 'Guarantee Versus' %}
    vs. {{ event.deal_percentage_artist | format_percentage }}% ticket share
  {% endif %}
{% else %}
  {{ event.deal_percentage_artist | format_percentage }}% ticket share
{% endif %}
{% if event.deal_type != "Door deal" %}{{ event.currency_symbol }} {{ event.flat_fee | format_money }} {% if event.deal_type == 'Guarantee' %}+ {{ event.deal_percentage_artist | format_percentage }}% ticket share after breakeven{% endif %}{% if event.deal_type == 'Guarantee Plus' %}+ {{ event.deal_percentage_artist | format_percentage }}% ticket share{% endif %}{% if event.deal_type == 'Guarantee Versus' %}vs. {{ event.deal_percentage_artist | format_percentage }}% ticket share{% endif %}{% else %}{{ event.deal_percentage_artist | format_percentage }}% ticket share{% endif %}

Bonuses

{% for b in e.event.bonuses %}{% if b.result_type == 'single_bonus' or b.result_type == 'bonus_per_ticket' %}{{ e.event.currency_symbol }} {{ b.result_value | format_money }} {{ b.result_type | replace: "_", " " }}{% else %}{{ b.result_value | format_percentage }}% {{ b.result_type | replace: "_", " " }} upgrade{% endif %} after {% if b.trigger_condition == 'ticket_revenue_gross' %}{{ e.event.currency_symbol }} {{ b.trigger_value | format_money }} gross ticket revenue{% elsif b.trigger_condition == 'ticket_revenue_nett' %}{{ e.event.currency_symbol }} {{ b.trigger_value | format_money }} nett. ticket revenue{% else %}{{ b.trigger_value | format_percentage }}{% if b.trigger_condition == 'occupancy' %}%{% endif %} {{ b.trigger_condition | replace: "_", " " }}{% endif %}{% endfor %}
Did this answer your question?