{# Building blocks shared by the company-form PDFs. Each mirrors a part of the printed form. #} {% macro letterhead(full) %}
{{ company_name }}
{% if full %}
{{ company_address }}
Website: {{ company_website }} E-Mail:{{ company_email }}
PHONE: {{ company_phone }}
{% endif %}
{% endmacro %} {# NAME / HEADQUARTER on the left, DATE / MONTH on the right — empty slots stay empty. #} {% macro meta_block(rows) %} {% if rows %} {% for pair in rows %} {% for slot in pair %} {% endfor %} {% endfor %}
{% if slot %}{{ slot[0] }} {{ slot[1] }}{% endif %}
{% endif %} {% endmacro %} {% macro grid(g, left=False) %} {% for w in g.widths %}{% endfor %}{% for h in g.headers %}{% endfor %} {% for r in g.rows %} {% for c in r.cells %}{% endfor %} {% endfor %}
{% for part in h.split("\n") %}{{ part }}{% if not loop.last %}
{% endif %}{% endfor %}
{{ c }}
{% endmacro %} {# "SIGNATURE" alone, low on the right — the sales / activity / call-report forms. #} {% macro sign_right(text="SIGNATURE") %}
{{ text }}
{% endmacro %} {# Tour plan, standard tour plan and fare chart: MR signature plus the ABM approval. #} {% macro sign_approval(approval) %}
SIGNATURE: {{ approval.mr_name }} {{ approval.label }} {{ approval.value }}{% if approval.when %}
{{ approval.when }}
{% endif %}
{% endmacro %}