Added SQL, dao and app - not functional

This commit is contained in:
Tesouraria CRSP
2024-11-26 10:57:25 -03:00
parent 158ec60b58
commit d6357803b8
25 changed files with 1580 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Listar Assinaturas Anuais</title>
</head>
<body>
<h1>Assinaturas Anuais</h1>
<a href="{{ url_for('nova_assinatura') }}">Adicionar Nova Assinatura</a>
<table border="1">
<thead>
<tr>
<th>ID</th>
<th>Militante ID</th>
<th>Tipo Material</th>
<th>Quantidade</th>
<th>Valor Total</th>
<th>Data Início</th>
<th>Data Fim</th>
</tr>
</thead>
<tbody>
{% for assinatura in assinaturas %}
<tr>
<td>{{ assinatura.id }}</td>
<td>{{ assinatura.militante_id }}</td>
<td>{{ assinatura.tipo_material_id }}</td>
<td>{{ assinatura.quantidade }}</td>
<td>R$ {{ assinatura.valor_total }}</td>
<td>{{ assinatura.data_inicio }}</td>
<td>{{ assinatura.data_fim }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</body>
</html>

View File

@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Listar Cotas Mensais</title>
</head>
<body>
<h1>Cotas Mensais</h1>
<a href="{{ url_for('nova_cota') }}">Adicionar Nova Cota</a>
<table border="1">
<thead>
<tr>
<th>ID</th>
<th>Militante ID</th>
<th>Valor Antigo</th>
<th>Valor Novo</th>
<th>Data de Alteração</th>
</tr>
</thead>
<tbody>
{% for cota in cotas %}
<tr>
<td>{{ cota.id }}</td>
<td>{{ cota.militante_id }}</td>
<td>R$ {{ cota.valor_antigo }}</td>
<td>R$ {{ cota.valor_novo }}</td>
<td>{{ cota.data_alteracao }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</body>
</html>

View File

@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Listar Materiais</title>
</head>
<body>
<h1>Materiais Vendidos</h1>
<a href="{{ url_for('novo_material') }}">Adicionar Novo Material</a>
<table border="1">
<thead>
<tr>
<th>ID</th>
<th>Militante ID</th>
<th>Tipo Material</th>
<th>Descrição</th>
<th>Valor</th>
<th>Data da Venda</th>
</tr>
</thead>
<tbody>
{% for material in materiais %}
<tr>
<td>{{ material.id }}</td>
<td>{{ material.militante_id }}</td>
<td>{{ material.tipo_material_id }}</td>
<td>{{ material.descricao }}</td>
<td>R$ {{ material.valor }}</td>
<td>{{ material.data_venda }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</body>
</html>

View File

@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Lista de Militantes</title>
</head>
<body>
<h1>Militantes</h1>
<ul>
{% for militante in militantes %}
<li>{{ militante.nome }} - {{ militante.email }}</li>
{% endfor %}
</ul>
<a href="{{ url_for('novo_militante') }}">Adicionar Novo Militante</a>
</body>
</html>

View File

@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Listar Pagamentos</title>
</head>
<body>
<h1>Pagamentos</h1>
<a href="{{ url_for('novo_pagamento') }}">Adicionar Novo Pagamento</a>
<table border="1">
<thead>
<tr>
<th>ID</th>
<th>Militante ID</th>
<th>Tipo de Pagamento</th>
<th>Valor</th>
<th>Data do Pagamento</th>
</tr>
</thead>
<tbody>
{% for pagamento in pagamentos %}
<tr>
<td>{{ pagamento.id }}</td>
<td>{{ pagamento.militante_id }}</td>
<td>{{ pagamento.tipo_pagamento_id }}</td>
<td>R$ {{ pagamento.valor }}</td>
<td>{{ pagamento.data_pagamento }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</body>
</html>

View File

@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Listar Relatórios de Cotas</title>
</head>
<body>
<h1>Relatórios de Cotas Mensais</h1>
<a href="{{ url_for('novo_relatorio_cotas') }}">Adicionar Novo Relatório</a>
<table border="1">
<thead>
<tr>
<th>ID</th>
<th>Setor ID</th>
<th>Comitê ID</th>
<th>Total de Cotas</th>
<th>Data do Relatório</th>
</tr>
</thead>
<tbody>
{% for relatorio in relatorios %}
<tr>
<td>{{ relatorio.id }}</td>
<td>{{ relatorio.setor_id }}</td>
<td>{{ relatorio.comite_id }}</td>
<td>R$ {{ relatorio.total_cotas }}</td>
<td>{{ relatorio.data_relatorio }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</body>
</html>

View File

@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Listar Relatórios de Vendas</title>
</head>
<body>
<h1>Relatórios de Vendas de Materiais</h1>
<a href="{{ url_for('novo_relatorio_vendas') }}">Adicionar Novo Relatório</a>
<table border="1">
<thead>
<tr>
<th>ID</th>
<th>Setor ID</th>
<th>Comitê ID</th>
<th>Total de Vendas</th>
<th>Data do Relatório</th>
</tr>
</thead>
<tbody>
{% for relatorio in relatorios %}
<tr>
<td>{{ relatorio.id }}</td>
<td>{{ relatorio.setor_id }}</td>
<td>{{ relatorio.comite_id }}</td>
<td>R$ {{ relatorio.total_vendas }}</td>
<td>{{ relatorio.data_relatorio }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</body>
</html>

View File

@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Listar Vendas de Jornais</title>
</head>
<body>
<h1>Vendas de Jornais Avulsos</h1>
<a href="{{ url_for('nova_venda_jornal') }}">Adicionar Nova Venda</a>
<table border="1">
<thead>
<tr>
<th>ID</th>
<th>Militante ID</th>
<th>Quantidade</th>
<th>Valor Total</th>
<th>Data da Venda</th>
</tr>
</thead>
<tbody>
{% for venda in vendas %}
<tr>
<td>{{ venda.id }}</td>
<td>{{ venda.militante_id }}</td>
<td>{{ venda.quantidade }}</td>
<td>R$ {{ venda.valor_total }}</td>
<td>{{ venda.data_venda }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</body>
</html>

View File

@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Nova Assinatura Anual</title>
</head>
<body>
<h1>Registrar Nova Assinatura Anual</h1>
<form method="post">
<div>
<label for="militante_id">ID do Militante:</label>
<input type="number" id="militante_id" name="militante_id" required>
</div>
<div>
<label for="tipo_material_id">Tipo de Material:</label>
<input type="number" id="tipo_material_id" name="tipo_material_id" required>
</div>
<div>
<label for="quantidade">Quantidade:</label>
<input type="number" id="quantidade" name="quantidade" required>
</div>
<div>
<label for="valor_total">Valor Total:</label>
<input type="number" id="valor_total" name="valor_total" step="0.01" required>
</div>
<div>
<label for="data_inicio">Data de Início:</label>
<input type="date" id="data_inicio" name="data_inicio" required>
</div>
<div>
<label for="data_fim">Data de Fim:</label>
<input type="date" id="data_fim" name="data_fim" required>
</div>
<button type="submit">Registrar Assinatura</button>
</form>
<a href="{{ url_for('listar_assinaturas') }}">Voltar para Lista</a>
</body>
</html>

30
templates/nova_cota.html Normal file
View File

@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Nova Cota Mensal</title>
</head>
<body>
<h1>Registrar Nova Cota Mensal</h1>
<form method="post">
<div>
<label for="militante_id">ID do Militante:</label>
<input type="number" id="militante_id" name="militante_id" required>
</div>
<div>
<label for="valor_antigo">Valor Antigo:</label>
<input type="number" id="valor_antigo" name="valor_antigo" step="0.01" required>
</div>
<div>
<label for="valor_novo">Valor Novo:</label>
<input type="number" id="valor_novo" name="valor_novo" step="0.01" required>
</div>
<div>
<label for="data_alteracao">Data de Alteração:</label>
<input type="date" id="data_alteracao" name="data_alteracao" required>
</div>
<button type="submit">Registrar Cota</button>
</form>
<a href="{{ url_for('listar_cotas') }}">Voltar para Lista</a>
</body>
</html>

View File

@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Nova Venda de Jornal</title>
</head>
<body>
<h1>Registrar Nova Venda de Jornal</h1>
<form method="post">
<div>
<label for="militante_id">ID do Militante:</label>
<input type="number" id="militante_id" name="militante_id" required>
</div>
<div>
<label for="quantidade">Quantidade:</label>
<input type="number" id="quantidade" name="quantidade" required>
</div>
<div>
<label for="valor_total">Valor Total:</label>
<input type="number" id="valor_total" name="valor_total" step="0.01" required>
</div>
<div>
<label for="data_venda">Data da Venda:</label>
<input type="date" id="data_venda" name="data_venda" required>
</div>
<button type="submit">Registrar Venda</button>
</form>
<a href="{{ url_for('listar_vendas_jornal') }}">Voltar para Lista</a>
</body>
</html>

View File

@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Novo Material</title>
</head>
<body>
<h1>Registrar Novo Material</h1>
<form method="post">
<div>
<label for="militante_id">ID do Militante:</label>
<input type="number" id="militante_id" name="militante_id" required>
</div>
<div>
<label for="tipo_material_id">Tipo de Material:</label>
<input type="number" id="tipo_material_id" name="tipo_material_id" required>
</div>
<div>
<label for="descricao">Descrição:</label>
<input type="text" id="descricao" name="descricao" required>
</div>
<div>
<label for="valor">Valor:</label>
<input type="number" id="valor" name="valor" step="0.01" required>
</div>
<div>
<label for="data_venda">Data da Venda:</label>
<input type="date" id="data_venda" name="data_venda" required>
</div>
<button type="submit">Registrar Material</button>
</form>
<a href="{{ url_for('listar_materiais') }}">Voltar para Lista</a>
</body>
</html>

View File

@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Novo Militante</title>
</head>
<body>
<h1>Criar Novo Militante</h1>
<form method="post">
Nome: <input type="text" name="nome" required><br>
CPF: <input type="text" name="cpf" required><br>
Email: <input type="email" name="email" required><br>
Telefone: <input type="text" name="telefone"><br>
Endereço: <input type="text" name="endereco"><br>
Filiado: <input type="checkbox" name="filiado"><br>
<input type="submit" value="Criar">
</form>
</body>
</html>

View File

@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Novo Pagamento</title>
</head>
<body>
<h1>Registrar Novo Pagamento</h1>
<form method="post">
<div>
<label for="militante_id">ID do Militante:</label>
<input type="number" id="militante_id" name="militante_id" required>
</div>
<div>
<label for="tipo_pagamento_id">Tipo de Pagamento:</label>
<input type="number" id="tipo_pagamento_id" name="tipo_pagamento_id" required>
</div>
<div>
<label for="valor">Valor:</label>
<input type="number" id="valor" name="valor" step="0.01" required>
</div>
<div>
<label for="data_pagamento">Data do Pagamento:</label>
<input type="date" id="data_pagamento" name="data_pagamento" required>
</div>
<button type="submit">Registrar Pagamento</button>
</form>
<a href="{{ url_for('listar_pagamentos') }}">Voltar para Lista</a>
</body>
</html>

View File

@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Novo Relatório de Cotas</title>
</head>
<body>
<h1>Registrar Novo Relatório de Cotas</h1>
<form method="post">
<div>
<label for="setor_id">ID do Setor:</label>
<input type="number" id="setor_id" name="setor_id" required>
</div>
<div>
<label for="comite_id">ID do Comitê:</label>
<input type="number" id="comite_id" name="comite_id" required>
</div>
<div>
<label for="total_cotas">Total de Cotas:</label>
<input type="number" id="total_cotas" name="total_cotas" step="0.01" required>
</div>
<div>
<label for="data_relatorio">Data do Relatório:</label>
<input type="date" id="data_relatorio" name="data_relatorio" required>
</div>
<button type="submit">Registrar Relatório</button>
</form>
<a href="{{ url_for('listar_relatorios_cotas') }}">Voltar para Lista</a>
</body>
</html>

View File

@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Novo Relatório de Vendas</title>
</head>
<body>
<h1>Registrar Novo Relatório de Vendas</h1>
<form method="post">
<div>
<label for="setor_id">ID do Setor:</label>
<input type="number" id="setor_id" name="setor_id" required>
</div>
<div>
<label for="comite_id">ID do Comitê:</label>
<input type="number" id="comite_id" name="comite_id" required>
</div>
<div>
<label for="total_vendas">Total de Vendas:</label>
<input type="number" id="total_vendas" name="total_vendas" step="0.01" required>
</div>
<div>
<label for="data_relatorio">Data do Relatório:</label>
<input type="date" id="data_relatorio" name="data_relatorio" required>
</div>
<button type="submit">Registrar Relatório</button>
</form>
<a href="{{ url_for('listar_relatorios_vendas') }}">Voltar para Lista</a>
</body>
</html>