{% extends "base.html" %} {% block title %}Devolução de Nota ao Fornecedor{% endblock %} {% block content %}

Devolução de Nota ao Fornecedor

{% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} {% for category, message in messages %} {% endfor %} {% endif %} {% endwith %}
Selecionar Nota de Entrada para Devolução
Limpar
Notas de Entrada Disponíveis para Devolução
{% for nota in notas_entrada %} {% else %} {% endfor %}
Número Série Fornecedor Data Valor Chave de Acesso Status Dev. Ações
{{ nota.serie or '1' }} {{ nota.data_emissao.strftime('%d/%m/%Y') if nota.data_emissao else '-' }} R$ {{ "%.2f"|format(nota.valor_total or 0) }} {{ (nota.chave_acesso[:20] + '...') if nota.chave_acesso else '-' }} {% if nota.devolucoes|length > 0 %} {% set total_dev = nota.devolucoes|sum(attribute='valor_total') %} {% if total_dev >= nota.valor_total %} Total {% else %} Parcial {% endif %} {% else %} Não devolvida {% endif %}
Nenhuma nota de entrada encontrada. Cadastre notas de entrada para fazer devoluções.
Devoluções Realizadas
{% for dev in devolucoes %} {% else %} {% endfor %}
Nº Dev. Nota Orig. Fornecedor Data Dev. Tipo Valor Status Ações
{{ dev.numero or dev.id }} {{ dev.nota_entrada.numero_nota if dev.nota_entrada else '-' }} {{ dev.fornecedor.razao_social[:40] if dev.fornecedor else '-' }} {{ dev.data_devolucao.strftime('%d/%m/%Y') if dev.data_devolucao else '-' }} {% if dev.tipo_devolucao == 'total' %} Total {% else %} Parcial {% endif %} R$ {{ "%.2f"|format(dev.valor_total or 0) }} {% if dev.status == 'autorizada' %} Autorizada {% elif dev.status == 'transmitida' %} Transmitida {% elif dev.status == 'pronta_para_envio' %} Pronta {% elif dev.status == 'rejeitada' %} Rejeitada {% else %} {{ dev.status|title }} {% endif %} {% if dev.status in ['rascunho', 'pronta_para_envio'] %} {% endif %} {% if dev.status == 'autorizada' %} {% endif %} {% if dev.status == 'rascunho' %} {% endif %}
Nenhuma devolução realizada ainda.
{% endblock %} {% block scripts %} {% endblock %}