diff --git a/gerar_report_json.py b/gerar_report_json.py new file mode 100644 index 0000000..b3747e0 --- /dev/null +++ b/gerar_report_json.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python3 +""" +Gerar report.json consolidado para o Dashboard Estático +""" + +import json +import sys +from datetime import datetime + +# Arquivos +ARQUIVO_DADOS = '/root/mission-control/financeiro/memory/daily/gastos-2026-02-09.json' +ARQUIVO_SAIDA = '/root/clawd/financeiro-dashboard/report.json' + +def gerar_report_json(): + """Gera o report.json consolidado""" + + # 1. Ler dados brutos + print("Lendo dados brutos...") + try: + with open(ARQUIVO_DADOS, 'r', encoding='utf-8') as f: + transacoes = json.load(f) + except Exception as e: + print(f"Erro ao ler dados: {e}") + sys.exit(1) + + print(f"{len(transacoes)} transacoes carregadas") + + # 2. Agrupar por hotel + print("Agrupando por hotel...") + dados_por_hotel = {} + + for transacao in transacoes: + hotel = transacao.get('unidade', 'Desconhecido') + + if hotel not in dados_por_hotel: + dados_por_hotel[hotel] = { + 'total': 0, + 'transactions': [] + } + + dados_por_hotel[hotel]['total'] += float(transacao.get('valor', 0)) + dados_por_hotel[hotel]['transactions'].append(transacao) + + # 3. Calcular totais globais + print("Calculando totais...") + global_total = sum(h['total'] for h in dados_por_hotel.values()) + global_count = sum(len(h['transactions']) for h in dados_por_hotel.values()) + + # 4. Criar lista de hotéis ordenada + print("Ordenando hotéis...") + hoteis_ordenados = [] + + for hotel, dados in dados_por_hotel.items(): + hotel_entry = { + 'name': hotel, + 'total': dados['total'], + 'count': len(dados['transactions']), + 'transactions': dados['transactions'] + } + hoteis_ordenados.append(hotel_entry) + + # Ordenar por total (maior primeiro) + hoteis_ordenados.sort(key=lambda x: x['total'], reverse=True) + + # 5. Criar estrutura JSON final + print("Criando JSON final...") + data_final = { + 'hotels': hoteis_ordenados, + 'global_total': global_total, + 'global_count': global_count, + 'date': datetime.now().strftime('%Y-%m-%d %H:%M:%S') + } + + # 6. Salvar arquivo + print(f"Salvando em {ARQUIVO_SAIDA}...") + try: + with open(ARQUIVO_SAIDA, 'w', encoding='utf-8') as f: + json.dump(data_final, f, indent=2, ensure_ascii=False) + + print(f"Arquivo salvo: {ARQUIVO_SAIDA}") + print(f"Total de hotéis: {len(hoteis_ordenados)}") + print(f"Custo global: R${global_total:.2f}") + print(f"Total de transações: {global_count}") + print() + print("JSON pronto para ser lido pelo dashboard!") + print() + print("Próximos passos:") + print("1. Commit do report.json no GitHub") + print("2. Commit do index.html (dashboard estático) no GitHub") + print("3. GitHub Pages vai publicar os dois arquivos") + print("4. Dashboard vai carregar o report.json automaticamente") + + except Exception as e: + print(f"Erro ao salvar arquivo: {e}") + sys.exit(1) + +if __name__ == '__main__': + gerar_report_json() diff --git a/index.html b/index.html index 9f51c4f..3228759 100644 --- a/index.html +++ b/index.html @@ -17,7 +17,7 @@ padding: 0; } - .dashboard-container { + .container { max-width: 1800px; margin: 0 auto; padding: 2rem; @@ -31,35 +31,6 @@ margin-bottom: 1.5rem; } - .card-header { - display: flex; - justify-content: space-between; - align-items: center; - margin-bottom: 1rem; - padding-bottom: 1rem; - border-bottom: 1px solid #e0e0e0; - } - - .card-title { - font-size: 1.25rem; - font-weight: 600; - color: #1f2937; - } - - .badge { - display: inline-block; - padding: 0.25rem 0.75rem; - border-radius: 4px; - font-size: 0.75rem; - font-weight: 600; - } - - .badge-success { background: #10b981; color: white; } - .badge-warning { background: #f59e0b; color: white; } - .badge-info { background: #3b82f6; color: white; } - .badge-danger { background: #ef4444; color: white; } - .badge-primary { background: #667eea; color: white; } - .hotel-card { background: #f9fafb; border: 1px solid #e5e7eb; @@ -74,11 +45,13 @@ box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15); } - .hotel-header { + .header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; + padding-bottom: 1rem; + border-bottom: 1px solid #e5e7eb; } .hotel-info { @@ -87,36 +60,28 @@ gap: 0.75rem; } - .hotel-icon { - background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); - color: white; - border-radius: 8px; - padding: 0.5rem; + .name { font-size: 1.25rem; - } - - .hotel-name { - font-size: 1.125rem; font-weight: 600; color: #1f2937; } - .hotel-stats { + .stats { text-align: right; } - .hotel-count { + .count { font-size: 0.875rem; color: #6b7280; } - .hotel-total { + .total { font-size: 1.5rem; font-weight: 700; color: #1f2937; } - .toggle-button { + .button { background: white; border: 1px solid #667eea; color: #667eea; @@ -128,19 +93,19 @@ font-weight: 500; } - .toggle-button:hover { + .button:hover { background: #667eea; color: white; } - .transactions-container { + .transactions { display: none; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #e5e7eb; } - .transactions-container.expanded { + .transactions.show { display: block; animation: slideDown 0.3s ease; } @@ -162,7 +127,7 @@ margin-top: 0.5rem; } - .table th { + th { background: #f8f9fa; padding: 0.5rem; text-align: left; @@ -171,30 +136,31 @@ font-size: 0.875rem; } - .table td { + td { padding: 0.5rem; border-bottom: 1px solid #f3f4f6; text-align: left; font-size: 0.875rem; } - .transaction-row { - padding: 0.5rem; + .row { + padding: 0.5rem 0; border-bottom: 1px solid #f3f4f6; - transition: all 0.2s; } - .transaction-row:hover { + .row:hover { background: #f9fafb; } - .transaction-row:last-child { + .row:last-child { border-bottom: none; } - .transaction-category { + .badge { display: inline-block; padding: 0.25rem 0.75rem; + background: #667eea; + color: white; border-radius: 4px; font-size: 0.75rem; font-weight: 600; @@ -203,662 +169,242 @@ .amount { font-weight: 600; color: #1f2937; - font-size: 1rem; } - .search-box { + .search { padding: 0.75rem; border: 1px solid #e0e0e0; border-radius: 8px; width: 100%; - max-width: 500px; font-size: 0.875rem; } - .search-box:focus { + .search:focus { outline: none; border-color: #667eea; box-shadow: 0 0 3px rgba(102, 126, 234, 0.2); } - .last-updated { - font-size: 0.875rem; - color: #6b7280; - text-align: right; - margin-top: 0.5rem; + .loading { + text-align: center; + padding: 2rem; + color: white; + } + + .spinner { + border: 4px solid rgba(255, 255, 255, 0.3); + border-radius: 50%; + border-top: 4px solid white; + width: 40px; + height: 40px; + animation: spin 1s linear infinite; + margin: 0 auto 1rem; + } + + @keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } + } + + .error { + background: #fee2e2; + color: #dc2626; + padding: 1rem; + border-radius: 8px; + text-align: center; + margin: 1rem 0; } -
+

Dashboard Financeiro

Grupo Inova - Squad Financeiro

-

Ultima atualizacao: carregando...

+

Atualizacao: Carregando...

-
-
-
Total de Hoteis
-
...
-
-
-
Custo Total
-
...
-
-
-
Total Transacoes
-
...
-
-
-
Hotel com Maior Gasto
-
...
-
+
+
+

Carregando dados...

-
-
- - + - -
- -
-
-
-
- -
-
Prime AL
-
-
-
14 transacoes
-
R$ 23321.96
-
-
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DescricaoCategoriaValorFornecedorData
GAZIN Compra de equipamentos de informáticaR$ 3337.96GAZIN2026-02-09
SALARIO THAYNARA COBRIU AS FERIAS DA GERENTESalárioR$ 2500.0THAYNARA CRISTINE SANTOS DE OLIVEIRA2026-02-09
SALÁRIO RECEPCIOCISTASalárioR$ 2093.45VALERIA DE ANDRADE FERREIRA2026-02-09
SALÁRIO RECEPCIOCISTASalárioR$ 2001.5DANIELA SILVA DE LIRA2026-02-09
SALÁRIO CAMAREIRASalárioR$ 1885.13monica de sousa matos2026-02-09
SALÁRIO CAMAREIRASalárioR$ 1842.72YOHANA JOSEFINA PEREZ PEINADO2026-02-09
SALÁRIO CAMAREIRASalárioR$ 1728.87SANDRA RODRIGUES DOS SANTOS2026-02-09
SALÁRIO CAMAREIRASalárioR$ 1673.46PAMELA PEREIRA DE ARAUJO2026-02-09
SALÁRIO CAMAREIRASalárioR$ 1672.26MIKAELLY FREITAS SILVA2026-02-09
SALÁRIO CAMAREIRASalárioR$ 1652.38TATIANA R. DE VASCINCELOS2026-02-09
SERVIÇO TRAPORTE DE ROUPALavanderiaR$ 1200.0SERVIÇO ENTREGA DE ROUPA LAVANDERIA2026-02-09
slr admSalários Administrativo (Back office)R$ 966.23OUTROS2026-02-09
SALARIO LAVADORSalárioR$ 588.0REGINALDO RIBEIRO LIMA2026-02-09
devolução clienteDevoluções de clientesR$ 180.0DEVOLUÇOES DE CLENTES2026-02-09
-
-
- -
-
-
-
- -
-
1001 Express
-
-
-
3 transacoes
-
R$ 3463.4
-
-
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DescricaoCategoriaValorFornecedorData
SALARIO IARA SalárioR$ 2400.0Iara Dourado 2026-02-09
VALOR DIVIDIDO COM HOTEL AL ( FRIGOBAR E AR CONDICIONADO )Investimentos geraisR$ 963.4HOTEL PRIME AL 2026-02-09
FRUTAS P/ SEMANASupermercado / AtacarejoR$ 100.0SACOLÃO FABIANA 2026-02-09
-
-
- -
-
-
-
- -
-
Prime ADE
-
-
-
2 transacoes
-
R$ 2261.42
-
-
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DescricaoCategoriaValorFornecedorData
Rescisão RescisõesR$ 1531.39LORRAYNE OLIVEIRA2026-02-09
Salário Matheus REF JAN/26SalárioR$ 730.03Matheus Marques Aires2026-02-09
-
-
- -
-
-
-
- -
-
Padova
-
-
-
5 transacoes
-
R$ 1731.23
-
-
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DescricaoCategoriaValorFornecedorData
ZEAN CAMERASMão de obra terceirizadaR$ 765.0ZEAN MANUTENÇÃO2026-02-09
SALARIOSalárioR$ 500.0GUSTAVO CONTABILIDADE2026-02-09
SALARIOSalárioR$ 244.44ISMAEL FINANCEIRO2026-02-09
SALARIO PAULO COMPRASSalárioR$ 214.29PAULO COMPRAS2026-02-09
TELEFONE FINANCEIROTelefone + internetR$ 7.5TELEFONE E INTERNET2026-02-09
-
-
- -
-
-
-
- -
-
Dolce Amore
-
-
-
4 transacoes
-
R$ 917.38
-
-
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DescricaoCategoriaValorFornecedorData
BATEDEIRA,TORRADEIRA,PANELA DE PRESSÃOCompra de EquipamentosR$ 327.97CARREFOUR2026-02-09
(CARTÃO LILIAN) 46,97 LT COMBUSTIVÉL CombustívelR$ 326.25Cartão Lilian Venc 102026-02-09
COMPRA DE ESPUMANTESALTON,PAPEL A4Compra de EquipamentosR$ 255.3CARREFOUR2026-02-09
TARIFA STONE DIA 09/02Tarifas bancáriasR$ 7.86None2026-02-09
-
-
- -
-
-
-
- -
-
Recanto das Emas
-
-
-
1 transacoes
-
R$ 500.0
-
-
- - - -
- - - - - - - - - - - - - - - - - - - - - -
DescricaoCategoriaValorFornecedorData
THAIS COODENAÇAOMão de obra terceirizadaR$ 500.0THAIS STEFANY2026-02-09
-
-
- -
-
-
-
- -
-
Qnn01
-
-
-
3 transacoes
-
R$ 86.67
-
-
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DescricaoCategoriaValorFornecedorData
PRESTOBARBA Supermercado / AtacarejoR$ 59.0RUMÃO2026-02-09
CARNE ALMOÇOSupermercado / AtacarejoR$ 17.67SUPER CARNES2026-02-09
VT - EDSONTransporte Pessoal ManutençãoR$ 10.0EDSON2026-02-09
-
-
- -
- -
-

© 2026 Grupo Inova - Todos os direitos reservados

-

Sistema Financeiro Automatizado

-

- - Repositorio: rodribm10.github.io/financeiro-dashboard -

-
diff --git a/report.json b/report.json new file mode 100644 index 0000000..0996f74 --- /dev/null +++ b/report.json @@ -0,0 +1,312 @@ +{ + "hotels": [ + { + "name": "Prime AL", + "total": 23321.96, + "count": 14, + "transactions": [ + { + "unidade": "Prime AL", + "categoria": "Compra de equipamentos de informática", + "descricao": "GAZIN ", + "valor": 3337.96, + "data_vencimento": "2026-02-09", + "fornecedor": "GAZIN" + }, + { + "unidade": "Prime AL", + "categoria": "Salário", + "descricao": "SALARIO THAYNARA COBRIU AS FERIAS DA GERENTE", + "valor": 2500.0, + "data_vencimento": "2026-02-09", + "fornecedor": "THAYNARA CRISTINE SANTOS DE OLIVEIRA" + }, + { + "unidade": "Prime AL", + "categoria": "Salário", + "descricao": "SALÁRIO RECEPCIOCISTA", + "valor": 2093.45, + "data_vencimento": "2026-02-09", + "fornecedor": "VALERIA DE ANDRADE FERREIRA" + }, + { + "unidade": "Prime AL", + "categoria": "Salário", + "descricao": "SALÁRIO RECEPCIOCISTA", + "valor": 2001.5, + "data_vencimento": "2026-02-09", + "fornecedor": "DANIELA SILVA DE LIRA" + }, + { + "unidade": "Prime AL", + "categoria": "Salário", + "descricao": "SALÁRIO CAMAREIRA", + "valor": 1885.13, + "data_vencimento": "2026-02-09", + "fornecedor": "monica de sousa matos" + }, + { + "unidade": "Prime AL", + "categoria": "Salário", + "descricao": "SALÁRIO CAMAREIRA", + "valor": 1842.72, + "data_vencimento": "2026-02-09", + "fornecedor": "YOHANA JOSEFINA PEREZ PEINADO" + }, + { + "unidade": "Prime AL", + "categoria": "Salário", + "descricao": "SALÁRIO CAMAREIRA", + "valor": 1728.87, + "data_vencimento": "2026-02-09", + "fornecedor": "SANDRA RODRIGUES DOS SANTOS" + }, + { + "unidade": "Prime AL", + "categoria": "Salário", + "descricao": "SALÁRIO CAMAREIRA", + "valor": 1673.46, + "data_vencimento": "2026-02-09", + "fornecedor": "PAMELA PEREIRA DE ARAUJO" + }, + { + "unidade": "Prime AL", + "categoria": "Salário", + "descricao": "SALÁRIO CAMAREIRA", + "valor": 1672.26, + "data_vencimento": "2026-02-09", + "fornecedor": "MIKAELLY FREITAS SILVA" + }, + { + "unidade": "Prime AL", + "categoria": "Salário", + "descricao": "SALÁRIO CAMAREIRA", + "valor": 1652.38, + "data_vencimento": "2026-02-09", + "fornecedor": "TATIANA R. DE VASCINCELOS" + }, + { + "unidade": "Prime AL", + "categoria": "Lavanderia", + "descricao": "SERVIÇO TRAPORTE DE ROUPA", + "valor": 1200.0, + "data_vencimento": "2026-02-09", + "fornecedor": "SERVIÇO ENTREGA DE ROUPA LAVANDERIA" + }, + { + "unidade": "Prime AL", + "categoria": "Salários Administrativo (Back office)", + "descricao": "slr adm", + "valor": 966.23, + "data_vencimento": "2026-02-09", + "fornecedor": "OUTROS" + }, + { + "unidade": "Prime AL", + "categoria": "Salário", + "descricao": "SALARIO LAVADOR", + "valor": 588.0, + "data_vencimento": "2026-02-09", + "fornecedor": "REGINALDO RIBEIRO LIMA" + }, + { + "unidade": "Prime AL", + "categoria": "Devoluções de clientes", + "descricao": "devolução cliente", + "valor": 180.0, + "data_vencimento": "2026-02-09", + "fornecedor": "DEVOLUÇOES DE CLENTES" + } + ] + }, + { + "name": "1001 Express", + "total": 3463.4, + "count": 3, + "transactions": [ + { + "unidade": "1001 Express", + "categoria": "Salário", + "descricao": "SALARIO IARA ", + "valor": 2400.0, + "data_vencimento": "2026-02-09", + "fornecedor": "Iara Dourado " + }, + { + "unidade": "1001 Express", + "categoria": "Investimentos gerais", + "descricao": "VALOR DIVIDIDO COM HOTEL AL ( FRIGOBAR E AR CONDICIONADO )", + "valor": 963.4, + "data_vencimento": "2026-02-09", + "fornecedor": "HOTEL PRIME AL " + }, + { + "unidade": "1001 Express", + "categoria": "Supermercado / Atacarejo", + "descricao": "FRUTAS P/ SEMANA", + "valor": 100.0, + "data_vencimento": "2026-02-09", + "fornecedor": "SACOLÃO FABIANA " + } + ] + }, + { + "name": "Prime ADE", + "total": 2261.42, + "count": 2, + "transactions": [ + { + "unidade": "Prime ADE", + "categoria": "Rescisões", + "descricao": "Rescisão ", + "valor": 1531.39, + "data_vencimento": "2026-02-09", + "fornecedor": "LORRAYNE OLIVEIRA" + }, + { + "unidade": "Prime ADE", + "categoria": "Salário", + "descricao": "Salário Matheus REF JAN/26", + "valor": 730.03, + "data_vencimento": "2026-02-09", + "fornecedor": "Matheus Marques Aires" + } + ] + }, + { + "name": "Padova", + "total": 1731.23, + "count": 5, + "transactions": [ + { + "unidade": "Padova", + "categoria": "Mão de obra terceirizada", + "descricao": "ZEAN CAMERAS", + "valor": 765.0, + "data_vencimento": "2026-02-09", + "fornecedor": "ZEAN MANUTENÇÃO" + }, + { + "unidade": "Padova", + "categoria": "Salário", + "descricao": "SALARIO", + "valor": 500.0, + "data_vencimento": "2026-02-09", + "fornecedor": "GUSTAVO CONTABILIDADE" + }, + { + "unidade": "Padova", + "categoria": "Salário", + "descricao": "SALARIO", + "valor": 244.44, + "data_vencimento": "2026-02-09", + "fornecedor": "ISMAEL FINANCEIRO" + }, + { + "unidade": "Padova", + "categoria": "Salário", + "descricao": "SALARIO PAULO COMPRAS", + "valor": 214.29, + "data_vencimento": "2026-02-09", + "fornecedor": "PAULO COMPRAS" + }, + { + "unidade": "Padova", + "categoria": "Telefone + internet", + "descricao": "TELEFONE FINANCEIRO", + "valor": 7.5, + "data_vencimento": "2026-02-09", + "fornecedor": "TELEFONE E INTERNET" + } + ] + }, + { + "name": "Dolce Amore", + "total": 917.38, + "count": 4, + "transactions": [ + { + "unidade": "Dolce Amore", + "categoria": "Compra de Equipamentos", + "descricao": "BATEDEIRA,TORRADEIRA,PANELA DE PRESSÃO", + "valor": 327.97, + "data_vencimento": "2026-02-09", + "fornecedor": "CARREFOUR" + }, + { + "unidade": "Dolce Amore", + "categoria": "Combustível", + "descricao": "(CARTÃO LILIAN) 46,97 LT COMBUSTIVÉL ", + "valor": 326.25, + "data_vencimento": "2026-02-09", + "fornecedor": "Cartão Lilian Venc 10" + }, + { + "unidade": "Dolce Amore", + "categoria": "Compra de Equipamentos", + "descricao": "COMPRA DE ESPUMANTESALTON,PAPEL A4", + "valor": 255.3, + "data_vencimento": "2026-02-09", + "fornecedor": "CARREFOUR" + }, + { + "unidade": "Dolce Amore", + "categoria": "Tarifas bancárias", + "descricao": "TARIFA STONE DIA 09/02", + "valor": 7.86, + "data_vencimento": "2026-02-09", + "fornecedor": null + } + ] + }, + { + "name": "Recanto das Emas", + "total": 500.0, + "count": 1, + "transactions": [ + { + "unidade": "Recanto das Emas", + "categoria": "Mão de obra terceirizada", + "descricao": "THAIS COODENAÇAO", + "valor": 500.0, + "data_vencimento": "2026-02-09", + "fornecedor": "THAIS STEFANY" + } + ] + }, + { + "name": "Qnn01", + "total": 86.67, + "count": 3, + "transactions": [ + { + "unidade": "Qnn01", + "categoria": "Supermercado / Atacarejo", + "descricao": "PRESTOBARBA ", + "valor": 59.0, + "data_vencimento": "2026-02-09", + "fornecedor": "RUMÃO" + }, + { + "unidade": "Qnn01", + "categoria": "Supermercado / Atacarejo", + "descricao": "CARNE ALMOÇO", + "valor": 17.67, + "data_vencimento": "2026-02-09", + "fornecedor": "SUPER CARNES" + }, + { + "unidade": "Qnn01", + "categoria": "Transporte Pessoal Manutenção", + "descricao": "VT - EDSON", + "valor": 10.0, + "data_vencimento": "2026-02-09", + "fornecedor": "EDSON" + } + ] + } + ], + "global_total": 32282.059999999998, + "global_count": 32, + "date": "2026-02-10 21:18:22" +} \ No newline at end of file