Skip to content

Commit

Permalink
deploy01
Browse files Browse the repository at this point in the history
  • Loading branch information
hemanoelbritoF committed May 2, 2024
1 parent 88c4454 commit be96bf2
Show file tree
Hide file tree
Showing 5 changed files with 228 additions and 156 deletions.
16 changes: 9 additions & 7 deletions project/app/preencheFub.py
Original file line number Diff line number Diff line change
Expand Up @@ -1728,7 +1728,8 @@ def planilhaGeral(planilha,codigo,data1,data2):
sheet2.append(linha)
#formatar as linhas
cinza = "f1f1f1"
variavel_site = f'http://127.0.0.1:2778/'
variavel_site = f'http://automatec.finatec.org.br/'
#variavel_site = f'http://127.0.0.1:2778/'
for column in range(ord('A'), ord('Z')+1):
column_letter = chr(column)
sheet2.column_dimensions[column_letter].width = 25
Expand All @@ -1745,13 +1746,13 @@ def planilhaGeral(planilha,codigo,data1,data2):
cell.font = Font(name="Arial", size=12, color="000000",bold = True)
cell.alignment = Alignment(horizontal="center",vertical="center",wrap_text=True)
sheet2.row_dimensions[cell.row].height = 60
#botão imprime tudo
sheet2['X2'] = f'{variavel_site}download-todos-arquivos/{codigo}_{data1}_{data2}/'
hyperlink_url = f'{variavel_site}download-todos-arquivos/{codigo}_{data1}_{data2}/'
sheet2['X2'].font = Font(name="Arial", size=12, color="0000EE",bold=True)
sheet2['X2'].hyperlink = hyperlink_url
# #botão imprime tudo
# sheet2['X2'] = f'{variavel_site}download-todos-arquivos/{codigo}_{data1}_{data2}/'
# hyperlink_url = f'{variavel_site}download-todos-arquivos/{codigo}_{data1}_{data2}/'
# sheet2['X2'].font = Font(name="Arial", size=12, color="0000EE",bold=True)
# sheet2['X2'].hyperlink = hyperlink_url
#printar resultados
for row_num, row_data in enumerate(dfconsultaDadosPorRubrica.itertuples(index=False), start=3):#inicio linha
for row_num, row_data in enumerate(dfconsultaDadosPorRubrica.itertuples(index=False), start=2):#inicio linha
for col_num, value in enumerate(row_data, start=1):#inicio coluna
value = convert_datetime_to_stringdt(value)
if col_num == 24:
Expand All @@ -1776,6 +1777,7 @@ def planilhaGeral(planilha,codigo,data1,data2):
#print(result_string)

#print(nota)
# if row_data
hyperlink_url = f'{variavel_site}recibos/{value}/'
value = hyperlink_url
sheet2.cell(row=row_num, column=col_num, value=value).font = Font(name="Arial", size=12, color="0000EE",bold=True)
Expand Down
41 changes: 37 additions & 4 deletions project/app/templates/recibo.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,42 @@
<!DOCTYPE html>
<html>
<html lang="pt-BR">
<head>
<title>Download PDF</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Download Falhou</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}

.container {
text-align: center;
padding: 20px;
border: 2px solid #ccc;
border-radius: 10px;
background-color: #fff;
}

h1 {
color: #333;
}

p {
color: #666;
}
</style>
</head>
<body>
<a href="{% url 'download_base64_pdf' %}">Download PDF</a>
<div class="container">
<h1>Download Falhou</h1>
<p>O download não pôde ser concluído porque o recibo não foi encontrado.</p>
</div>
</body>
</html>
</html>
44 changes: 37 additions & 7 deletions project/app/templates/report.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,42 @@
<!DOCTYPE html>
<html>
<html lang="pt-BR">
<head>
<title>Report</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Download Falhou</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}

.container {
text-align: center;
padding: 20px;
border: 2px solid #ccc;
border-radius: 10px;
background-color: #fff;
}

h1 {
color: #333;
}

p {
color: #666;
}
</style>
</head>
<body>
<h1>Here's your report:</h1>
<p>Click the link below to open the PDF report:</p>
<a href="{{ pdf_url }}">View Report (report.pdf)</a>

<div class="container">
<h1>Download Falhou</h1>
<p>O download não pôde ser concluído porque a nota não foi encontrada.</p>
</div>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion project/app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
path('perfil/', views.user_profile, name='user_profile'),
path('notas/<str:filename>/', views.consultaNotas, name='notas'),
path('recibos/<str:filename>/', views.download_base64_pdf, name='download_base64_pdf'),
path('download-todos-arquivos/<str:filename>/', views.download_todos_arquivos, name='download_todos_arquivos'),
#path('download-todos-arquivos/<str:filename>/', views.download_todos_arquivos, name='download_todos_arquivos'),
# path('base/', views.base2, name='base'),-

# path('login_teste/', views.login_teste, name='login_teste'),
Expand Down
Loading

0 comments on commit be96bf2

Please sign in to comment.