{% load i18n leprikon_tags qr_code %}

{{ object.text_registration_payment_request }}

{% include 'leprikon/registration_mail_details.html' %}

{% if object.courseregistration %}
    {% for pps in object.period_payment_statuses %}
        {% if pps.status.amount_due %}
        <p>
            {% trans 'Period' %}: {{ pps.period.name }},
            {% trans 'Amount due' %}: {{ pps.status.amount_due | currency }},
            {% trans 'Due date' %}: {{ pps.status.due_date }}
        </p>
        {% endif %}
    {% endfor %}
{% else %}
    <p>
        {% trans 'Amount due' %}: {{ object.payment_status.amount_due | currency }},
        {% trans 'Due date' %}: {{ object.payment_status.due_date }}
    </p>
{% endif %}

{% if site.payment_gateway %}
<p>
    {% trans 'Please, use following link to perform online payment' %}:<br/>
    <a href="{{ object.payment_url }}">{{ object.payment_url }}</a>
</p>
{% endif %}

{% if object.organization.bank_account %}
<p>
    {% trans 'Please, use following information for bank transfer' %}:<br/>
    {% trans 'Bank account' %}: {{ object.organization.bank_account }}<br/>
    {% trans 'Variable symbol' %}: {{ object.variable_symbol }}<br/>
</p>
<p>
    {% trans 'You may use following QR code to scan the payment details to your mobile banking application' %}:<br/>
    <img src="cid:qr_code"/>
</p>
{% endif %}

{% if not site.payment_gateway and not object.organization.bank_account %}
<p>{% trans 'Currently we only accept payments in cash.' %}</p>
{% endif %}

{% include 'leprikon/registration_mail_footer.html' %}
