<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Relatório Financeiro Analítico</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f4f6f9;
color: #333;
padding: 40px;
}
.container {
max-width: 900px;
margin: auto;
background: #ffffff;
padding: 30px 40px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
h1 {
text-align: center;
font-size: 24px;
color: #004080;
margin-bottom: 10px;
}
.subtitle {
text-align: center;
font-size: 14px;
color: #777;
margin-bottom: 30px;
}
.section-title {
font-weight: bold;
font-size: 16px;
margin-top: 30px;
margin-bottom: 10px;
color: #004080;
border-bottom: 1px solid #ccc;
padding-bottom: 4px;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 15px;
}
th, td {
padding: 10px;
text-align: left;
border: 1px solid #ccc;
}
th {
background-color: #e8f0fe;
font-weight: bold;
color: #003366;
}
.info p {
margin: 4px 0;
}
.footer {
margin-top: 40px;
text-align: center;
font-size: 12px;
color: #999;
}
</style>
</head>
<body>
<div class="container">
<h1>Relatório Financeiro Analítico</h1>
<div class="subtitle">Análise detalhada de movimentações por contas vinculadas.</div>
<div class="info">
<p><strong>Data de Geração:</strong> {% date_time "dd/MM/YYYY HH:mm" %}</p>
<p><strong>Organização:</strong> {{ midaz_onboarding.organization.0.legal_name }}</p>
<p><strong>Livro-Razão:</strong> {{ midaz_onboarding.ledger.0.name }}</p>
</div>
{% for account in midaz_onboarding.account %}
{% with balance = filter(midaz_transaction.balance, "account_id", account.id)[0] %}
<div class="section-title">Conta: {{ account.alias }}</div>
<div class="info">
<p><strong>ID:</strong> {{ account.id }}</p>
<p><strong>Moeda:</strong> {{ balance.asset_code }}</p>
<p><strong>Saldo Atual:</strong> {{ balance.available }}</p>
</div>
<table>
<thead>
<tr>
<th>ID da Operação</th>
<th>Tipo</th>
<th>Valor Original</th>
<th>Desconto (3%)</th>
<th>Valor Final</th>
<th>Descrição</th>
</tr>
</thead>
<tbody>
{% 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 %}
<tr>
<td>{{ operation.id }}</td>
<td>{{ operation.type }}</td>
<td>{{ original_amount|floatformat:2 }}</td>
<td>{{ discount_amount|floatformat:2 }}</td>
<td>{{ final_amount|floatformat:2 }}</td>
<td>{{ operation.description }}</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
{% endwith %}
{% endfor %}
<div class="footer">
Documento gerado automaticamente via Reporter - Lerian · {{ midaz_onboarding.organization.0.legal_document }}
</div>
</div>
</body>
</html>