64 lines
2.9 KiB
HTML
64 lines
2.9 KiB
HTML
{% extends 'base.html' %}
|
|
|
|
{% block title %}Nova Venda{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col-md-8 offset-md-2">
|
|
<h1 class="mb-4">Registrar Nova Venda</h1>
|
|
|
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
|
{% if messages %}
|
|
{% for category, message in messages %}
|
|
<div class="alert alert-{{ category }}">{{ message }}</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endwith %}
|
|
|
|
<form method="post" class="mb-4">
|
|
<div class="mb-3">
|
|
<label for="militante_id" class="form-label">Militante:</label>
|
|
<select class="form-select" id="militante_id" name="militante_id" required>
|
|
<option value="">Selecione o militante</option>
|
|
{% for militante in militantes %}
|
|
<option value="{{ militante.id }}">{{ militante.nome }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<label for="material_id" class="form-label">Material:</label>
|
|
<select class="form-select" id="material_id" name="material_id" required>
|
|
<option value="">Selecione o material</option>
|
|
{% for material in materiais %}
|
|
<option value="{{ material.id }}">{{ material.descricao }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<label for="quantidade" class="form-label">Quantidade:</label>
|
|
<input type="number" class="form-control" id="quantidade" name="quantidade" min="1" required>
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<label for="valor_total" class="form-label">Valor Total:</label>
|
|
<input type="number" class="form-control" id="valor_total" name="valor_total" step="0.01" required>
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<label for="data_venda" class="form-label">Data da Venda:</label>
|
|
<input type="date" class="form-control" id="data_venda" name="data_venda" required>
|
|
</div>
|
|
|
|
<div class="d-flex gap-2">
|
|
<button type="submit" class="btn btn-primary">Registrar</button>
|
|
<a href="{{ url_for('listar_vendas') }}" class="btn btn-secondary">Voltar</a>
|
|
<a href="{{ url_for('home') }}" class="btn btn-outline-primary">Início</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %} |