<p><strong>Generation Date:</strong> {% date_time "dd/MM/YYYY HH:mm" %}</p>This function applies the date and time when the template is rendered, using the dd/MM/YYYY HH:mm format.<p><strong>Organization:</strong> {{ midaz_onboarding.organization.0.legal_name }}</p>This line renders the legal name of the first Organization associated with the onboarding data.
midaz_onboarding.organization: the list of Organizations in the system.
0: fetches the first item in the list.
legal_name: fetches the value of the legal_name field.
<p><strong>Ledger:</strong> {{ midaz_onboarding.ledger.0.name }}</p>This line renders the name of the first Ledger associated with the onboarding data.
midaz_onboarding.ledger: the list of Ledgers in the system.
<div class="section-title">Account: {{ account.alias }}</div>Displays a section title with the account alias (a friendly or readable name for the account).<p><strong>ID:</strong> {{ account.id }}</p>Shows the unique identifier of the account.<p><strong>Currency:</strong> {{ balance.asset_code }}</p>Displays the currency code (like “BRL” or “USD”) associated with the account’s balance.<p><strong>Current Balance:</strong> {{ balance.available }}Shows the current available balance.
{% for operation in midaz_transaction.operation %} {% if operation.account_id == account.id %} {% set original_amount = operation.amount %} {% set discount_amount = original_amount * 0.03 %} {% set final_amount = original_amount - discount_amount %}
{% for operation in midaz_transaction.operation %}This loops through all operations from the midaz_transaction.operation list.{% if operation.account_id == account.id %}This line checks whether the current operation is related to the current account in the outer loop (from your earlier block) and only proceeds if:
The operation’s account_id matches the account.id in focus.
{% set original_amount = operation.amount %}This line sets a temporary variable named original_amount and gives it the value of the amount field in the operation object.{% set discount_amount = original_amount * 0.03 %}This line calculates a 3% discount on the original amount.
The result is saved as discount_amount.
{% set final_amount = original_amount - discount_amount %}This line subtracts the discount from the original amount.
The final result is stored in final_amount, which can be rendered later.
This block outputs a clean, readable table row for each operation, including the following information:<td>{{ operation.id }}</td>Unique identifier for the operation.<td>{{ operation.type }}</td>Type of operation, such as credit or debit.<td>{{ original_amount|floatformat:2 }}</td>Shows the original (unadjusted) amount, formatted with 2 decimal places.<td>{{ discount_amount|floatformat:2 }}</td>Displays the calculated discount, also with 2 decimal places.<td>{{ final_amount|floatformat:2 }}</td>Shows the final amount after applying the 3% discount, nicely formatted.<td>{{ operation.description }}</td>Renders the description or label of the operation, such as “Transfer to savings”.
This line renders a footer at the bottom of the document, indicating that the content was automatically generated using Reporter by Lerian.
It also includes the legal document number of the first organization linked to the onboarding data, pulled dynamically using the {{ midaz_onboarding.organization.0.legal_document }} placeholder.