Persano commited on
Commit
18172b4
·
verified ·
1 Parent(s): 52f0241

Update templates/relatorio_pdf.html

Browse files
Files changed (1) hide show
  1. templates/relatorio_pdf.html +111 -55
templates/relatorio_pdf.html CHANGED
@@ -1,66 +1,122 @@
1
  <!DOCTYPE html>
2
  <html lang="pt-BR">
3
  <head>
4
- <meta charset="UTF-8" />
5
- <title>Relatório Simulação de Investimentos</title>
6
- <style>
7
- body {
8
- font-family: Arial, sans-serif;
9
- font-size: 12px;
10
- margin: 20px;
11
- color: #333;
12
- }
13
- h1, h2 {
14
- text-align: center;
15
- color: #2c3e50;
16
- margin-bottom: 10px;
17
- }
18
- table {
19
- width: 100%;
20
- border-collapse: collapse;
21
- margin-bottom: 25px;
22
- }
23
- th, td {
24
- border: 1px solid #000;
25
- padding: 6px 8px;
26
- text-align: right;
27
- }
28
- th {
29
- background-color: #007bff;
30
- color: white;
31
- text-align: center;
32
- }
33
- .resultado-destaque {
34
- border: 2px solid #2e7d32;
35
- background-color: #e8f5e9;
36
- padding: 10px;
37
- font-weight: bold;
38
- text-align: center;
39
- color: #2e7d32;
40
- margin-top: 20px;
41
- border-radius: 5px;
42
- }
43
- img {
44
- display: block;
45
- margin: 0 auto 25px auto;
46
- max-width: 90%;
47
- height: auto;
48
- }
49
- </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  </head>
51
  <body>
52
 
53
- <h1>Simulador de Investimentos</h1>
54
-
55
- <h2>Gráfico Comparativo</h2>
56
- <img src="data:image/png;base64,{{ grafico }}" alt="Gráfico de Investimentos" />
 
 
 
57
 
58
- {{ tabela | safe }}
 
 
59
 
60
- <div class="resultado-destaque">
61
- Investimento com maior retorno: {{ investimento_mais_valorizado }}<br>
62
- Valor final estimado: R$ {{ "{:,.2f}".format(valor_mais_alto).replace(",", "X").replace(".", ",").replace("X", ".") }}
63
- </div>
 
 
 
 
 
64
 
65
  </body>
66
  </html>
 
 
1
  <!DOCTYPE html>
2
  <html lang="pt-BR">
3
  <head>
4
+ <meta charset="UTF-8" />
5
+ <title>Relatório de Investimentos</title>
6
+ <style>
7
+ @page {
8
+ size: A4;
9
+ margin: 20mm 15mm 20mm 15mm;
10
+ @top-center {
11
+ content: element(header);
12
+ }
13
+ @bottom-center {
14
+ content: element(footer);
15
+ }
16
+ }
17
+
18
+ body {
19
+ font-family: Arial, sans-serif;
20
+ font-size: 12px;
21
+ color: #333;
22
+ margin: 0;
23
+ padding: 0;
24
+ }
25
+
26
+ header {
27
+ display: block;
28
+ text-align: center;
29
+ font-weight: bold;
30
+ font-size: 16px;
31
+ margin-bottom: 10px;
32
+ border-bottom: 1px solid #ccc;
33
+ padding-bottom: 5px;
34
+ }
35
+
36
+ footer {
37
+ display: block;
38
+ text-align: center;
39
+ font-size: 10px;
40
+ color: #666;
41
+ border-top: 1px solid #ccc;
42
+ padding-top: 5px;
43
+ position: fixed;
44
+ bottom: 0;
45
+ width: 100%;
46
+ }
47
+
48
+ .page-number:before {
49
+ content: "Página " counter(page);
50
+ }
51
+
52
+ .report-container {
53
+ max-width: 700px; /* Limita a largura da tabela */
54
+ margin: auto;
55
+ }
56
+
57
+ table {
58
+ width: 100%;
59
+ border-collapse: collapse;
60
+ margin-bottom: 20px;
61
+ font-size: 12px;
62
+ }
63
+
64
+ th {
65
+ background-color: #004080;
66
+ color: white;
67
+ padding: 8px;
68
+ border: 1px solid #004080;
69
+ text-align: center;
70
+ }
71
+
72
+ td {
73
+ border: 1px solid #ddd;
74
+ padding: 6px 8px;
75
+ text-align: right;
76
+ }
77
+
78
+ td:first-child {
79
+ text-align: center;
80
+ font-weight: bold;
81
+ }
82
+
83
+ h1 {
84
+ text-align: center;
85
+ color: #004080;
86
+ margin-top: 0;
87
+ }
88
+
89
+ .graph-container {
90
+ text-align: center;
91
+ margin-bottom: 20px;
92
+ }
93
+
94
+ </style>
95
  </head>
96
  <body>
97
 
98
+ <header role="header" id="header">
99
+ Relatório de Investimentos - Simulação Financeira
100
+ </header>
101
+
102
+ <div class="report-container">
103
+
104
+ <h1>Simulação de Investimentos - 5 Anos</h1>
105
 
106
+ <div class="graph-container">
107
+ <img src="data:image/png;base64,{{ grafico }}" alt="Gráfico de Investimentos" style="max-width: 100%; height: auto;" />
108
+ </div>
109
 
110
+ {{ tabela|safe }}
111
+
112
+ <p><strong>Investimento mais valorizado:</strong> {{ investimento_mais_valorizado }} com R$ {{ '{:,.2f}'.format(valor_mais_alto) }}</p>
113
+
114
+ </div>
115
+
116
+ <footer role="contentinfo" id="footer">
117
+ Gerado em {{ now.strftime('%d/%m/%Y %H:%M') }} - Página <span class="page-number"></span>
118
+ </footer>
119
 
120
  </body>
121
  </html>
122
+