Inclusão da coluna Arquivo PDF nas exportações em excel
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -412,6 +412,7 @@ async def export_excel(
|
|||||||
"Valor Total": f.valor_total,
|
"Valor Total": f.valor_total,
|
||||||
"Distribuidora": f.distribuidora,
|
"Distribuidora": f.distribuidora,
|
||||||
"Data Processamento": f.data_processamento,
|
"Data Processamento": f.data_processamento,
|
||||||
|
"Arquivo PDF": f.arquivo_pdf,
|
||||||
})
|
})
|
||||||
filename = "relatorio_aliquota_icms.xlsx"
|
filename = "relatorio_aliquota_icms.xlsx"
|
||||||
|
|
||||||
@@ -447,6 +448,7 @@ async def export_excel(
|
|||||||
"Consumo (kWh)": f.consumo,
|
"Consumo (kWh)": f.consumo,
|
||||||
"Tarifa": f.tarifa,
|
"Tarifa": f.tarifa,
|
||||||
"Nota Fiscal": f.nota_fiscal,
|
"Nota Fiscal": f.nota_fiscal,
|
||||||
|
"Arquivo PDF": f.arquivo_pdf,
|
||||||
})
|
})
|
||||||
filename = "relatorio_exclusao_icms.xlsx"
|
filename = "relatorio_exclusao_icms.xlsx"
|
||||||
|
|
||||||
@@ -484,6 +486,7 @@ async def export_excel(
|
|||||||
"Tarifa": f.tarifa,
|
"Tarifa": f.tarifa,
|
||||||
"Distribuidora": f.distribuidora,
|
"Distribuidora": f.distribuidora,
|
||||||
"Data Processamento": f.data_processamento,
|
"Data Processamento": f.data_processamento,
|
||||||
|
"Arquivo PDF": f.arquivo_pdf,
|
||||||
})
|
})
|
||||||
filename = "relatorio_geral.xlsx"
|
filename = "relatorio_geral.xlsx"
|
||||||
|
|
||||||
@@ -491,6 +494,11 @@ async def export_excel(
|
|||||||
output = BytesIO()
|
output = BytesIO()
|
||||||
df = pd.DataFrame(dados)
|
df = pd.DataFrame(dados)
|
||||||
|
|
||||||
|
# força "Arquivo PDF" a ser a última coluna
|
||||||
|
if "Arquivo PDF" in df.columns:
|
||||||
|
cols = [c for c in df.columns if c != "Arquivo PDF"] + ["Arquivo PDF"]
|
||||||
|
df = df[cols]
|
||||||
|
|
||||||
# garante que colunas percentuais estejam numéricas (se existirem)
|
# garante que colunas percentuais estejam numéricas (se existirem)
|
||||||
for col in ["ICMS (%)", "ICMS (%) (UF/Ref)", "Dif. ICMS (pp)", "PIS (%)", "COFINS (%)"]:
|
for col in ["ICMS (%)", "ICMS (%) (UF/Ref)", "Dif. ICMS (pp)", "PIS (%)", "COFINS (%)"]:
|
||||||
if col in df.columns:
|
if col in df.columns:
|
||||||
|
|||||||
Reference in New Issue
Block a user