719 lines
35 KiB
HTML
719 lines
35 KiB
HTML
{% load static %}
|
|
{% load contabil_extras %}
|
|
<!doctype html>
|
|
<html lang="pt-br">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Conciliação de Fornecedores · {{ conciliacao.codigo_empresa }} {{ conciliacao.nome_empresa }}</title>
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Manrope:wght@600;700;800&display=swap" rel="stylesheet">
|
|
<style>
|
|
/* Documento gerado: paleta fixa do escritório (mesma do relatório do
|
|
Relatório Contábil), sem tema claro/escuro do Portal. */
|
|
:root {
|
|
--roxo-escuro: #3d2178;
|
|
--roxo-mais-escuro: #281552;
|
|
--roxo-claro: #efe8ff;
|
|
--roxo-medio: #7a5bc0;
|
|
--dourado: #b4872a;
|
|
--dourado-claro: #f6ecd4;
|
|
--dourado-vivo: #d9ac48;
|
|
--texto: #211d2b;
|
|
--texto-muted: #6b6478;
|
|
--borda: #e6e1f0;
|
|
--bg-canvas: #f5f3fa;
|
|
--sucesso-bg: #dcf5e3;
|
|
--sucesso-texto: #1a7a3d;
|
|
--falha-bg: #fbe2e2;
|
|
--falha-texto: #b3261e;
|
|
--aviso-bg: #fdf0d8;
|
|
--aviso-texto: #9a6a0a;
|
|
--neutro-bg: #eeecf3;
|
|
--sombra: 0 1px 2px rgba(40, 21, 82, 0.04), 0 8px 24px -12px rgba(40, 21, 82, 0.18);
|
|
}
|
|
* { box-sizing: border-box; }
|
|
body {
|
|
margin: 0;
|
|
background:
|
|
radial-gradient(circle at 15% -10%, rgba(122, 91, 192, 0.14), transparent 42%),
|
|
radial-gradient(circle at 100% 0%, rgba(180, 135, 42, 0.10), transparent 38%),
|
|
var(--bg-canvas);
|
|
color: var(--texto);
|
|
font-family: "Inter", "Segoe UI", Arial, sans-serif;
|
|
font-size: 14px;
|
|
line-height: 1.5;
|
|
-webkit-font-smoothing: antialiased;
|
|
}
|
|
h1, h2, h3, .cfr-card__valor, .cfr-parecer__nivel { font-family: "Manrope", "Inter", sans-serif; }
|
|
@keyframes cfrFadeSlideUp {
|
|
from { opacity: 0; transform: translateY(10px); }
|
|
to { opacity: 1; transform: translateY(0); }
|
|
}
|
|
|
|
.cfr-page { max-width: 1140px; margin: 0 auto; padding: 0 24px 56px; }
|
|
|
|
/* ---- Cabeçalho ---- */
|
|
.cfr-header {
|
|
background: linear-gradient(135deg, var(--roxo-escuro) 0%, var(--roxo-mais-escuro) 100%);
|
|
color: #fff;
|
|
padding: 28px;
|
|
margin: 0 -24px 24px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 22px;
|
|
flex-wrap: wrap;
|
|
border-bottom: 3px solid var(--dourado);
|
|
}
|
|
.cfr-header__brand { display: flex; align-items: center; gap: 18px; }
|
|
.cfr-header img { height: 52px; width: auto; }
|
|
.cfr-header h1 { margin: 0; font-size: 1.35rem; font-weight: 800; }
|
|
.cfr-header p { margin: 4px 0 0; color: var(--dourado-claro); font-size: 0.86rem; }
|
|
.cfr-print-btn {
|
|
margin-left: auto;
|
|
background: linear-gradient(135deg, var(--dourado-vivo), var(--dourado));
|
|
color: var(--roxo-mais-escuro);
|
|
border: none;
|
|
border-radius: 8px;
|
|
padding: 11px 20px;
|
|
font: inherit;
|
|
font-size: 0.86rem;
|
|
font-weight: 700;
|
|
cursor: pointer;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
transition: transform 160ms ease;
|
|
}
|
|
.cfr-print-btn:hover { transform: translateY(-2px); }
|
|
.cfr-print-btn:active { transform: scale(0.97); }
|
|
|
|
/* ---- Aviso de conciliação em andamento ---- */
|
|
.cfr-aviso {
|
|
display: flex;
|
|
gap: 12px;
|
|
align-items: flex-start;
|
|
background: var(--aviso-bg);
|
|
color: var(--aviso-texto);
|
|
border: 1px solid #f0d9a8;
|
|
border-radius: 12px;
|
|
padding: 12px 16px;
|
|
margin-bottom: 20px;
|
|
font-weight: 600;
|
|
}
|
|
.cfr-aviso svg { flex-shrink: 0; margin-top: 2px; }
|
|
|
|
/* ---- Parecer ---- */
|
|
.cfr-parecer {
|
|
display: grid;
|
|
grid-template-columns: 240px 1fr;
|
|
gap: 20px;
|
|
background: #fff;
|
|
border: 1px solid var(--borda);
|
|
border-radius: 16px;
|
|
padding: 20px;
|
|
box-shadow: var(--sombra);
|
|
margin-bottom: 20px;
|
|
animation: cfrFadeSlideUp 360ms ease both;
|
|
}
|
|
.cfr-parecer__risco {
|
|
border-radius: 12px;
|
|
padding: 18px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
gap: 4px;
|
|
}
|
|
.cfr-parecer__risco--alto { background: var(--falha-bg); color: var(--falha-texto); }
|
|
.cfr-parecer__risco--moderado { background: var(--aviso-bg); color: var(--aviso-texto); }
|
|
.cfr-parecer__risco--baixo { background: var(--sucesso-bg); color: var(--sucesso-texto); }
|
|
.cfr-parecer__rotulo { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
|
|
.cfr-parecer__nivel { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
|
|
.cfr-parecer__nota { font-size: 0.74rem; opacity: 0.85; }
|
|
.cfr-parecer__sintese { margin: 0 0 12px; padding-left: 18px; font-size: 0.92rem; }
|
|
.cfr-parecer__sintese li { margin-bottom: 2px; }
|
|
.cfr-parecer__meta { color: var(--texto-muted); font-size: 0.8rem; display: flex; flex-wrap: wrap; gap: 4px 18px; }
|
|
.cfr-parecer__meta strong { color: var(--texto); font-weight: 600; }
|
|
|
|
/* ---- Cards de números ---- */
|
|
.cfr-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 28px; }
|
|
.cfr-card {
|
|
background: #fff;
|
|
border: 1px solid var(--borda);
|
|
border-radius: 14px;
|
|
padding: 14px 16px;
|
|
box-shadow: var(--sombra);
|
|
animation: cfrFadeSlideUp 360ms ease 60ms both;
|
|
}
|
|
.cfr-card__label { font-size: 0.7rem; color: var(--texto-muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
|
|
.cfr-card__valor { font-size: 1.2rem; font-weight: 800; color: var(--roxo-escuro); margin-top: 4px; font-variant-numeric: tabular-nums; }
|
|
.cfr-card__nota { font-size: 0.72rem; color: var(--texto-muted); margin-top: 2px; }
|
|
.cfr-barra { height: 6px; background: var(--neutro-bg); border-radius: 999px; overflow: hidden; margin-top: 8px; }
|
|
.cfr-barra span { display: block; height: 100%; background: linear-gradient(90deg, var(--roxo-medio), var(--roxo-escuro)); border-radius: 999px; }
|
|
|
|
/* ---- Seções ---- */
|
|
.cfr-secao { margin-bottom: 32px; }
|
|
.cfr-secao > h2 {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
margin: 0 0 6px;
|
|
color: var(--roxo-escuro);
|
|
font-size: 1.1rem;
|
|
font-weight: 800;
|
|
}
|
|
.cfr-secao > h2 .cfr-num {
|
|
width: 26px;
|
|
height: 26px;
|
|
border-radius: 50%;
|
|
background: var(--roxo-escuro);
|
|
color: #fff;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 0.8rem;
|
|
}
|
|
.cfr-secao__desc { margin: 0 0 14px; color: var(--texto-muted); font-size: 0.84rem; }
|
|
.cfr-subtitulo { margin: 20px 0 8px; font-size: 0.92rem; font-weight: 700; color: var(--texto); }
|
|
.cfr-subtitulo small { color: var(--texto-muted); font-weight: 500; }
|
|
.cfr-vazio {
|
|
background: #fff;
|
|
border: 1px dashed var(--borda);
|
|
border-radius: 12px;
|
|
padding: 14px 16px;
|
|
color: var(--texto-muted);
|
|
font-size: 0.84rem;
|
|
}
|
|
|
|
/* ---- Blocos de risco ---- */
|
|
.cfr-risco {
|
|
background: #fff;
|
|
border: 1px solid var(--borda);
|
|
border-left: 4px solid var(--borda);
|
|
border-radius: 12px;
|
|
margin-bottom: 10px;
|
|
box-shadow: var(--sombra);
|
|
overflow: hidden;
|
|
}
|
|
.cfr-risco--alta { border-left-color: var(--falha-texto); }
|
|
.cfr-risco--media { border-left-color: var(--dourado); }
|
|
.cfr-risco--baixa { border-left-color: var(--roxo-medio); }
|
|
.cfr-risco > summary {
|
|
list-style: none;
|
|
cursor: pointer;
|
|
padding: 12px 16px;
|
|
display: grid;
|
|
grid-template-columns: auto 1fr auto;
|
|
gap: 4px 12px;
|
|
align-items: center;
|
|
}
|
|
.cfr-risco > summary::-webkit-details-marker { display: none; }
|
|
.cfr-risco > summary:hover { background: #faf8fd; }
|
|
.cfr-risco__titulo { font-weight: 700; }
|
|
.cfr-risco__porque { grid-column: 2 / 4; color: var(--texto-muted); font-size: 0.8rem; }
|
|
.cfr-risco__resumo { text-align: right; font-size: 0.8rem; color: var(--texto-muted); white-space: nowrap; }
|
|
.cfr-risco__resumo strong { color: var(--texto); font-variant-numeric: tabular-nums; }
|
|
.cfr-risco__corpo { border-top: 1px solid var(--borda); padding: 12px 16px 16px; }
|
|
.cfr-risco__extra { font-size: 0.84rem; margin: 0 0 10px; }
|
|
|
|
.cfr-pill {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
padding: 2px 9px;
|
|
border-radius: 999px;
|
|
font-size: 0.68rem;
|
|
font-weight: 700;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.03em;
|
|
white-space: nowrap;
|
|
}
|
|
.cfr-pill--alta, .cfr-pill--divergente, .cfr-pill--pendente { background: var(--falha-bg); color: var(--falha-texto); }
|
|
.cfr-pill--media, .cfr-pill--atencao { background: var(--aviso-bg); color: var(--aviso-texto); }
|
|
.cfr-pill--baixa { background: var(--roxo-claro); color: var(--roxo-escuro); }
|
|
.cfr-pill--conciliada, .cfr-pill--ok { background: var(--sucesso-bg); color: var(--sucesso-texto); }
|
|
.cfr-pill--neutro { background: var(--neutro-bg); color: var(--texto-muted); }
|
|
|
|
/* ---- Tabelas ---- */
|
|
.cfr-tabela-wrap { background: #fff; border: 1px solid var(--borda); border-radius: 12px; overflow-x: auto; }
|
|
table.cfr-tabela { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
|
|
table.cfr-tabela th, table.cfr-tabela td { padding: 7px 10px; border-bottom: 1px solid var(--borda); text-align: left; vertical-align: top; }
|
|
table.cfr-tabela tr:last-child td { border-bottom: none; }
|
|
table.cfr-tabela th {
|
|
background: var(--roxo-claro);
|
|
color: var(--roxo-escuro);
|
|
font-size: 0.66rem;
|
|
font-weight: 700;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.03em;
|
|
white-space: nowrap;
|
|
}
|
|
table.cfr-tabela td.cfr-valor, table.cfr-tabela th.cfr-valor { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
|
|
table.cfr-tabela td.cfr-conta { white-space: nowrap; color: var(--texto-muted); }
|
|
table.cfr-tabela td.cfr-centro, table.cfr-tabela th.cfr-centro { text-align: center; }
|
|
.cfr-justificativa { font-size: 0.78rem; }
|
|
.cfr-justificativa em { color: var(--texto-muted); }
|
|
.cfr-sem-just { color: var(--falha-texto); font-weight: 600; font-size: 0.76rem; }
|
|
.cfr-lista-alertas { margin: 0; padding-left: 16px; }
|
|
.cfr-muted { color: var(--texto-muted); }
|
|
|
|
/* ---- Concentração ---- */
|
|
.cfr-conc-barra { display: flex; align-items: center; gap: 8px; min-width: 160px; }
|
|
.cfr-conc-barra .cfr-barra { flex: 1; margin: 0; }
|
|
.cfr-conc-barra .cfr-barra span { background: linear-gradient(90deg, var(--dourado-vivo), var(--dourado)); }
|
|
|
|
/* ---- Anexo ---- */
|
|
.cfr-anexo > summary { cursor: pointer; font-weight: 700; color: var(--roxo-escuro); margin-bottom: 10px; }
|
|
|
|
.cfr-footer { color: var(--texto-muted); font-size: 0.74rem; text-align: center; margin-top: 28px; }
|
|
.cfr-so-impressao { display: none; }
|
|
|
|
@media (max-width: 720px) {
|
|
.cfr-parecer { grid-template-columns: 1fr; }
|
|
.cfr-header { padding: 22px 20px; }
|
|
.cfr-risco > summary { grid-template-columns: auto 1fr; }
|
|
.cfr-risco__resumo { grid-column: 1 / 3; text-align: left; }
|
|
.cfr-risco__porque { grid-column: 1 / 3; }
|
|
}
|
|
|
|
/* Opção de impressão (só na tela): incluir ou não o anexo. */
|
|
.cfr-print-opcoes { display: flex; align-items: center; gap: 14px; margin-left: auto; }
|
|
.cfr-print-opcoes .cfr-print-btn { margin-left: 0; }
|
|
.cfr-print-check { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--dourado-claro); cursor: pointer; }
|
|
.cfr-print-check input { accent-color: var(--dourado-vivo); }
|
|
|
|
/* Impressão compacta: fundo branco, sem sombra nem gradiente, fonte e
|
|
espaçamento menores. Blocos grandes podem quebrar entre páginas (um
|
|
`break-inside: avoid` no bloco inteiro empurrava o bloco para a página
|
|
seguinte e deixava a anterior quase em branco); o que não quebra é a
|
|
linha de tabela, o cabeçalho de cada bloco (fica junto do conteúdo) e
|
|
os cards. O cabeçalho da tabela se repete em cada página. */
|
|
@page { size: A4; margin: 12mm 10mm; }
|
|
@media print {
|
|
* { animation: none !important; transition: none !important; box-shadow: none !important; }
|
|
html, body { background: #fff !important; font-size: 10px; line-height: 1.35; }
|
|
/* Fonte do sistema na impressão: as fontes da web embutidas no PDF
|
|
eram a maior parte do peso do arquivo. */
|
|
body, h1, h2, h3, .cfr-card__valor, .cfr-parecer__nivel { font-family: Arial, "Segoe UI", sans-serif; }
|
|
table.cfr-tabela th { white-space: normal; }
|
|
.cfr-nowrap { white-space: nowrap; }
|
|
.cfr-page { max-width: none; padding: 0; }
|
|
.cfr-print-opcoes { display: none; }
|
|
.cfr-header {
|
|
margin: 0 0 10px;
|
|
padding: 10px 14px;
|
|
background: var(--roxo-escuro);
|
|
border-bottom-width: 2px;
|
|
-webkit-print-color-adjust: exact;
|
|
print-color-adjust: exact;
|
|
}
|
|
.cfr-header img { height: 32px; }
|
|
.cfr-header h1 { font-size: 1.15rem; }
|
|
.cfr-header p { font-size: 0.85rem; }
|
|
.cfr-aviso { padding: 6px 10px; margin-bottom: 10px; border-radius: 6px; }
|
|
.cfr-parecer, .cfr-parecer__risco, .cfr-pill, table.cfr-tabela th, .cfr-barra span, .cfr-aviso {
|
|
-webkit-print-color-adjust: exact;
|
|
print-color-adjust: exact;
|
|
}
|
|
.cfr-parecer { grid-template-columns: 150px 1fr; gap: 12px; padding: 10px; margin-bottom: 10px; border-radius: 8px; break-inside: avoid; }
|
|
.cfr-parecer__risco { padding: 10px; border-radius: 6px; }
|
|
.cfr-parecer__nivel { font-size: 1.4rem; }
|
|
.cfr-parecer__sintese { margin-bottom: 6px; font-size: 1rem; }
|
|
.cfr-cards { grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 14px; }
|
|
.cfr-card { padding: 7px 9px; border-radius: 6px; break-inside: avoid; }
|
|
.cfr-card__valor { font-size: 1.1rem; }
|
|
.cfr-secao { margin-bottom: 14px; }
|
|
.cfr-secao > h2 { font-size: 1.25rem; margin-bottom: 2px; break-after: avoid; }
|
|
.cfr-secao > h2 .cfr-num { width: 18px; height: 18px; font-size: 0.8rem; }
|
|
.cfr-secao__desc { margin-bottom: 8px; }
|
|
.cfr-subtitulo { margin: 10px 0 4px; font-size: 1.05rem; break-after: avoid; }
|
|
.cfr-vazio { padding: 6px 10px; border-radius: 6px; }
|
|
.cfr-risco { border-radius: 6px; margin-bottom: 8px; overflow: visible; }
|
|
.cfr-risco > summary { padding: 6px 10px; break-inside: avoid; break-after: avoid; }
|
|
.cfr-risco__corpo { padding: 6px 10px 8px; }
|
|
.cfr-tabela-wrap { overflow: visible; border-radius: 6px; }
|
|
table.cfr-tabela { font-size: 0.95rem; }
|
|
table.cfr-tabela th, table.cfr-tabela td { padding: 3px 6px; }
|
|
table.cfr-tabela th { font-size: 0.8rem; }
|
|
table.cfr-tabela thead { display: table-header-group; }
|
|
table.cfr-tabela tr { break-inside: avoid; }
|
|
.cfr-anexo > summary { break-after: avoid; }
|
|
body:not(.cfr-imprime-anexo) .cfr-anexo-secao { display: none; }
|
|
.cfr-so-tela { display: none; }
|
|
.cfr-so-impressao { display: block; }
|
|
.cfr-footer { margin-top: 12px; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="cfr-page">
|
|
<header class="cfr-header">
|
|
<div class="cfr-header__brand">
|
|
{# cópia reduzida de logo-branco.png (6250 px de largura pesava mais que o PDF inteiro) #}
|
|
<img src="{% if logo_data_uri %}{{ logo_data_uri }}{% else %}{% static 'img/logo-branco-relatorio.png' %}{% endif %}" alt="De Paula Contadores">
|
|
<div>
|
|
<h1>Conciliação de Fornecedores</h1>
|
|
<p>
|
|
{{ conciliacao.codigo_empresa }} · {{ conciliacao.nome_empresa|default:"Empresa não encontrada no Questor" }}
|
|
· Razão de {% if conciliacao.periodo_inicio %}{{ conciliacao.periodo_inicio|date:"d/m/Y" }} a {{ conciliacao.periodo_fim|date:"d/m/Y" }}{% else %}período sem lançamentos{% endif %}
|
|
· Data-base {{ conciliacao.data_base|date:"d/m/Y" }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div class="cfr-print-opcoes">
|
|
<label class="cfr-print-check">
|
|
<input type="checkbox" id="cfr-imprime-anexo">
|
|
Incluir anexo na impressão
|
|
</label>
|
|
<button type="button" class="cfr-print-btn" onclick="window.print()">
|
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="6 9 6 2 18 2 18 9"/><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"/><rect x="6" y="14" width="12" height="8"/></svg>
|
|
Imprimir
|
|
</button>
|
|
</div>
|
|
</header>
|
|
|
|
{% if not relatorio.concluida %}
|
|
<div class="cfr-aviso" role="note">
|
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>
|
|
<span>Conciliação em andamento: {{ relatorio.contas_nao_validadas|length }} de {{ relatorio.total_contas }} contas ainda sem validação. Este relatório mostra a situação no momento em que foi gerado.</span>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<section class="cfr-parecer" aria-label="Parecer geral">
|
|
<div class="cfr-parecer__risco cfr-parecer__risco--{{ relatorio.risco_geral }}">
|
|
<span class="cfr-parecer__rotulo">Risco geral</span>
|
|
<span class="cfr-parecer__nivel">{{ relatorio.risco_geral_rotulo }}</span>
|
|
<span class="cfr-parecer__nota">Considera só os pontos ainda sem justificativa.</span>
|
|
</div>
|
|
<div>
|
|
<ul class="cfr-parecer__sintese">
|
|
{% for frase in relatorio.sintese %}<li>{{ frase }}.</li>{% endfor %}
|
|
</ul>
|
|
<div class="cfr-parecer__meta">
|
|
<span>Processado por <strong>{{ conciliacao.criado_por.nome|default:"—" }}</strong> em {{ conciliacao.criado_em|date:"d/m/Y H:i" }}</span>
|
|
{% with ultima=conciliacao.atualizacoes.first %}{% if ultima %}
|
|
<span>Razão atualizado por <strong>{{ ultima.usuario.nome|default:"—" }}</strong> em {{ ultima.criado_em|date:"d/m/Y H:i" }}</span>
|
|
{% endif %}{% endwith %}
|
|
<span>Arquivo <strong>{{ conciliacao.nome_arquivo|default:"—" }}</strong></span>
|
|
<span>Participaram <strong>{{ relatorio.responsaveis|join:", "|default:"—" }}</strong></span>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<div class="cfr-cards">
|
|
<div class="cfr-card">
|
|
<div class="cfr-card__label">Saldo de fornecedores</div>
|
|
<div class="cfr-card__valor">{{ relatorio.saldo_total|moeda }}</div>
|
|
<div class="cfr-card__nota">{{ relatorio.total_contas }} contas no razão</div>
|
|
</div>
|
|
<div class="cfr-card">
|
|
<div class="cfr-card__label">Títulos em aberto</div>
|
|
<div class="cfr-card__valor">{{ relatorio.total_em_aberto|moeda }}</div>
|
|
{% if relatorio.total_nao_vinculado %}<div class="cfr-card__nota">{{ relatorio.total_nao_vinculado|moeda }} em pagamentos a vincular</div>{% endif %}
|
|
</div>
|
|
<div class="cfr-card">
|
|
<div class="cfr-card__label">Há mais de {{ meses_vencido }} meses</div>
|
|
<div class="cfr-card__valor">{{ relatorio.total_vencido|moeda }}</div>
|
|
<div class="cfr-card__nota">{{ relatorio.vencidos_revisados|length }} de {{ relatorio.qtd_fornecedores_vencidos }} fornecedores revisados</div>
|
|
</div>
|
|
<div class="cfr-card">
|
|
<div class="cfr-card__label">Pagamentos sem título</div>
|
|
<div class="cfr-card__valor">{{ relatorio.total_excedente|moeda }}</div>
|
|
<div class="cfr-card__nota">além de todos os títulos em aberto</div>
|
|
</div>
|
|
<div class="cfr-card">
|
|
<div class="cfr-card__label">Validação</div>
|
|
<div class="cfr-card__valor">{{ relatorio.contas_validadas }} de {{ relatorio.total_contas }}</div>
|
|
<div class="cfr-barra" aria-hidden="true"><span style="width: {{ relatorio.percentual_validado }}%"></span></div>
|
|
<div class="cfr-card__nota">{{ relatorio.por_status.divergente }} divergentes · {{ relatorio.por_status.atencao }} em atenção · {{ relatorio.por_status.conciliada }} conciliadas</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 1. Situações de risco -->
|
|
<section class="cfr-secao">
|
|
<h2><span class="cfr-num">1</span> Situações de risco</h2>
|
|
<p class="cfr-secao__desc">Cada ponto traz o valor envolvido e por que merece atenção. Quando a conta foi validada com observação, a justificativa aparece ao lado.</p>
|
|
|
|
{% for risco in relatorio.riscos %}
|
|
<details class="cfr-risco cfr-risco--{{ risco.severidade }}"{% if risco.severidade == "alta" and risco.qtd_sem_justificativa %} open{% endif %}>
|
|
<summary>
|
|
<span class="cfr-pill cfr-pill--{{ risco.severidade }}">{{ risco.severidade_rotulo }}</span>
|
|
<span class="cfr-risco__titulo">{{ risco.titulo }}</span>
|
|
<span class="cfr-risco__resumo">
|
|
{{ risco.itens|length }} {% if risco.itens|length == 1 %}item{% else %}itens{% endif %}
|
|
{% if risco.valor_total %}· <strong>{{ risco.valor_total|moeda }}</strong>{% endif %}
|
|
{% if not risco.informativo %}· {% if risco.qtd_sem_justificativa %}{{ risco.qtd_sem_justificativa }} sem justificativa{% else %}todos justificados{% endif %}{% endif %}
|
|
</span>
|
|
<span class="cfr-risco__porque">{{ risco.porque }}{% if risco.informativo %} Informativo: não entra no risco geral.{% endif %}</span>
|
|
</summary>
|
|
<div class="cfr-risco__corpo">
|
|
{% if risco.chave == "juros_descontos" %}
|
|
<p class="cfr-risco__extra">Total pago a maior (possível juros/multa): <strong>{{ relatorio.total_juros|moeda }}</strong> · Total pago a menor (possível desconto): <strong>{{ relatorio.total_descontos|moeda }}</strong></p>
|
|
{% endif %}
|
|
{% if risco.chave == "vencidos" and relatorio.faixas_vencidos %}
|
|
<div class="cfr-tabela-wrap" style="margin-bottom: 12px;">
|
|
<table class="cfr-tabela">
|
|
<thead><tr><th>Faixa</th><th class="cfr-valor">Títulos</th><th class="cfr-valor">Fornecedores</th><th class="cfr-valor">Sem revisão</th><th class="cfr-valor">Valor</th></tr></thead>
|
|
<tbody>
|
|
{% for faixa in relatorio.faixas_vencidos %}
|
|
<tr>
|
|
<td>{{ faixa.rotulo }}</td>
|
|
<td class="cfr-valor">{{ faixa.qtd_titulos }}</td>
|
|
<td class="cfr-valor">{{ faixa.qtd_fornecedores }}</td>
|
|
<td class="cfr-valor">{% if faixa.qtd_sem_revisao %}<span class="cfr-sem-just">{{ faixa.qtd_sem_revisao }}</span>{% else %}0{% endif %}</td>
|
|
<td class="cfr-valor">{{ faixa.valor|moeda }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endif %}
|
|
<div class="cfr-tabela-wrap">
|
|
<table class="cfr-tabela">
|
|
<thead>
|
|
<tr>
|
|
<th>Conta</th><th>Fornecedor</th><th>Situação</th><th class="cfr-valor">Valor</th>
|
|
{% if not risco.informativo %}<th>Justificativa</th>{% endif %}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for item in risco.itens %}
|
|
<tr>
|
|
<td class="cfr-conta">{{ item.conta_numero }}</td>
|
|
<td>{{ item.fornecedor }}</td>
|
|
<td>{{ item.detalhe }}</td>
|
|
<td class="cfr-valor">{% if item.valor is not None %}{{ item.valor|moeda }}{% else %}—{% endif %}</td>
|
|
{% if not risco.informativo %}
|
|
<td class="cfr-justificativa">{% if item.justificado %}{{ item.justificativa|linebreaksbr }}{% else %}<span class="cfr-sem-just">Sem justificativa</span>{% endif %}</td>
|
|
{% endif %}
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</details>
|
|
{% empty %}
|
|
<p class="cfr-vazio">Nenhuma situação de risco encontrada nesta conciliação.</p>
|
|
{% endfor %}
|
|
|
|
{% if relatorio.concentracao %}
|
|
<h3 class="cfr-subtitulo">Concentração do saldo em aberto <small>· os {{ relatorio.concentracao|length }} maiores fornecedores, onde um erro pesa mais</small></h3>
|
|
<div class="cfr-tabela-wrap">
|
|
<table class="cfr-tabela">
|
|
<thead><tr><th>Conta</th><th>Fornecedor</th><th class="cfr-valor">Em aberto</th><th>Participação</th></tr></thead>
|
|
<tbody>
|
|
{% for item in relatorio.concentracao %}
|
|
<tr>
|
|
<td class="cfr-conta">{{ item.conta_numero }}</td>
|
|
<td>{{ item.fornecedor }}</td>
|
|
<td class="cfr-valor">{{ item.valor|moeda }}</td>
|
|
<td><div class="cfr-conc-barra"><div class="cfr-barra"><span style="width: {% widthratio item.valor relatorio.total_em_aberto 100 %}%"></span></div><span>{{ item.participacao|percentual }}</span></div></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endif %}
|
|
</section>
|
|
|
|
<!-- 2. Decisões tomadas -->
|
|
<section class="cfr-secao">
|
|
<h2><span class="cfr-num">2</span> Decisões tomadas</h2>
|
|
<p class="cfr-secao__desc">O que foi decidido na conciliação, por quem e com qual justificativa.</p>
|
|
|
|
<h3 class="cfr-subtitulo">Contas validadas com pendência <small>· conta em Atenção ou Divergente validada por uma pessoa</small></h3>
|
|
{% if relatorio.validacoes_com_pendencia %}
|
|
<div class="cfr-tabela-wrap">
|
|
<table class="cfr-tabela">
|
|
<thead><tr><th>Conta</th><th>Fornecedor</th><th>Situação</th><th>Pendências</th><th>Validada por</th><th>Justificativa</th></tr></thead>
|
|
<tbody>
|
|
{% for v in relatorio.validacoes_com_pendencia %}
|
|
<tr>
|
|
<td class="cfr-conta">{{ v.conta_numero }}</td>
|
|
<td>{{ v.fornecedor }}</td>
|
|
<td><span class="cfr-pill cfr-pill--{{ v.status }}">{{ v.status_rotulo }}</span></td>
|
|
<td><ul class="cfr-lista-alertas">{% for a in v.alertas %}<li>{{ a }}</li>{% endfor %}</ul></td>
|
|
<td>{{ v.validada_por }}<br><span class="cfr-muted cfr-nowrap">{{ v.validada_em|date:"d/m/Y H:i" }}</span></td>
|
|
<td class="cfr-justificativa">{% if v.observacao %}{{ v.observacao|linebreaksbr }}{% else %}<span class="cfr-sem-just">Sem justificativa</span>{% endif %}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<p class="cfr-vazio">Nenhuma conta com pendência foi validada.</p>
|
|
{% endif %}
|
|
|
|
<h3 class="cfr-subtitulo">Ajustes manuais nos vínculos <small>· pelo histórico de vinculações de cada conta</small></h3>
|
|
{% if relatorio.ajustes %}
|
|
<div class="cfr-tabela-wrap">
|
|
<table class="cfr-tabela">
|
|
<thead><tr><th>Conta</th><th style="width: 34%">Fornecedor</th><th class="cfr-centro">Criados</th><th class="cfr-centro">Acrésc.</th><th class="cfr-centro">Autom. desfeitos</th><th class="cfr-centro">Manuais desfeitos</th><th>Responsáveis</th><th>Última ação</th></tr></thead>
|
|
<tbody>
|
|
{% for a in relatorio.ajustes %}
|
|
<tr>
|
|
<td class="cfr-conta">{{ a.conta_numero }}</td>
|
|
<td>{{ a.fornecedor }}</td>
|
|
<td class="cfr-centro">{{ a.vinculou }}</td>
|
|
<td class="cfr-centro">{{ a.acrescentou }}</td>
|
|
<td class="cfr-centro">{% if a.desfez_automatico %}<strong>{{ a.desfez_automatico }}</strong>{% else %}0{% endif %}</td>
|
|
<td class="cfr-centro">{{ a.desfez_manual }}</td>
|
|
<td>{{ a.usuarios|join:", "|default:"—" }}</td>
|
|
<td class="cfr-muted cfr-nowrap">{{ a.ultima_acao|date:"d/m/Y H:i" }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<p class="cfr-vazio">Nenhum ajuste manual: todos os vínculos são os automáticos da importação.</p>
|
|
{% endif %}
|
|
|
|
{% if relatorio.saldos_parciais %}
|
|
<h3 class="cfr-subtitulo">Pagamentos parciais com saldo a pagar <small>· vínculos manuais em que o título não foi quitado por inteiro</small></h3>
|
|
<div class="cfr-tabela-wrap">
|
|
<table class="cfr-tabela">
|
|
<thead><tr><th>Conta</th><th>Fornecedor</th><th>Título de</th><th class="cfr-valor">Saldo a pagar</th><th>Vinculado por</th></tr></thead>
|
|
<tbody>
|
|
{% for s in relatorio.saldos_parciais %}
|
|
<tr>
|
|
<td class="cfr-conta">{{ s.conta_numero }}</td>
|
|
<td>{{ s.fornecedor }}</td>
|
|
<td>{{ s.data_titulo|date:"d/m/Y"|default:"—" }}</td>
|
|
<td class="cfr-valor">{{ s.valor|moeda }}</td>
|
|
<td>{{ s.criado_por|default:"—" }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<h3 class="cfr-subtitulo">Títulos antigos revisados <small>· aba "Em aberto há mais de {{ meses_vencido }} meses"</small></h3>
|
|
{% if relatorio.vencidos_revisados %}
|
|
<div class="cfr-tabela-wrap">
|
|
<table class="cfr-tabela">
|
|
<thead><tr><th>Conta</th><th>Fornecedor</th><th class="cfr-centro">Títulos</th><th>Mais antigo</th><th class="cfr-valor">Valor</th><th>Revisado por</th><th>Observação</th></tr></thead>
|
|
<tbody>
|
|
{% for v in relatorio.vencidos_revisados %}
|
|
<tr>
|
|
<td class="cfr-conta">{{ v.conta_numero }}</td>
|
|
<td>{{ v.fornecedor }}</td>
|
|
<td class="cfr-centro">{{ v.qtd_titulos }}</td>
|
|
<td>{{ v.mais_antigo|date:"d/m/Y" }}</td>
|
|
<td class="cfr-valor">{{ v.valor|moeda }}</td>
|
|
<td>{{ v.revisado_por|default:"—" }}<br><span class="cfr-muted cfr-nowrap">{{ v.revisado_em|date:"d/m/Y H:i" }}</span></td>
|
|
<td class="cfr-justificativa">{% if v.observacao %}{{ v.observacao|linebreaksbr }}{% else %}<em>Sem observação</em>{% endif %}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<p class="cfr-vazio">Nenhum fornecedor com títulos antigos foi revisado ainda.</p>
|
|
{% endif %}
|
|
</section>
|
|
|
|
<!-- 3. O que ainda falta decidir -->
|
|
<section class="cfr-secao">
|
|
<h2><span class="cfr-num">3</span> O que ainda falta decidir</h2>
|
|
<p class="cfr-secao__desc">Contas e fornecedores sem nenhuma decisão registrada.</p>
|
|
|
|
<h3 class="cfr-subtitulo">Contas sem validação <small>· {{ relatorio.contas_nao_validadas|length }}</small></h3>
|
|
{% if relatorio.contas_nao_validadas %}
|
|
<div class="cfr-tabela-wrap">
|
|
<table class="cfr-tabela">
|
|
<thead><tr><th>Conta</th><th>Fornecedor</th><th>Situação</th><th>Motivo principal</th><th class="cfr-valor">Pagamentos pendentes</th></tr></thead>
|
|
<tbody>
|
|
{% for c in relatorio.contas_nao_validadas %}
|
|
<tr>
|
|
<td class="cfr-conta">{{ c.conta_numero }}</td>
|
|
<td>{{ c.fornecedor }}</td>
|
|
<td><span class="cfr-pill cfr-pill--{{ c.status }}">{{ c.status_rotulo }}</span></td>
|
|
<td>{{ c.motivo }}</td>
|
|
<td class="cfr-valor">{% if c.valor %}{{ c.valor|moeda }}{% else %}—{% endif %}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<p class="cfr-vazio">Todas as contas foram validadas.</p>
|
|
{% endif %}
|
|
|
|
<h3 class="cfr-subtitulo">Títulos antigos sem revisão <small>· {{ relatorio.vencidos_nao_revisados|length }} fornecedores</small></h3>
|
|
{% if relatorio.vencidos_nao_revisados %}
|
|
<p class="cfr-vazio cfr-so-impressao">Listados no item 1, "Títulos em aberto há mais de {{ meses_vencido }} meses", como "Sem justificativa".</p>
|
|
<div class="cfr-tabela-wrap cfr-so-tela">
|
|
<table class="cfr-tabela">
|
|
<thead><tr><th>Conta</th><th>Fornecedor</th><th class="cfr-centro">Títulos</th><th>Mais antigo</th><th class="cfr-valor">Valor</th></tr></thead>
|
|
<tbody>
|
|
{% for v in relatorio.vencidos_nao_revisados %}
|
|
<tr>
|
|
<td class="cfr-conta">{{ v.conta_numero }}</td>
|
|
<td>{{ v.fornecedor }}</td>
|
|
<td class="cfr-centro">{{ v.qtd_titulos }}</td>
|
|
<td>{{ v.mais_antigo|date:"d/m/Y" }}</td>
|
|
<td class="cfr-valor">{{ v.valor|moeda }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<p class="cfr-vazio">Todos os fornecedores com títulos antigos foram revisados.</p>
|
|
{% endif %}
|
|
</section>
|
|
|
|
<!-- 4. Anexo (fora da impressão, salvo se marcado no cabeçalho) -->
|
|
<section class="cfr-secao cfr-anexo-secao">
|
|
<details class="cfr-anexo">
|
|
<summary>Anexo: todos os fornecedores ({{ relatorio.anexo|length }})</summary>
|
|
<div class="cfr-tabela-wrap">
|
|
<table class="cfr-tabela">
|
|
<thead><tr><th>Conta</th><th>Fornecedor</th><th class="cfr-valor">Saldo inicial</th><th class="cfr-valor">Saldo final</th><th class="cfr-valor">Em aberto</th><th class="cfr-valor">Há mais de {{ meses_vencido }} meses</th><th>Situação</th><th>Validação</th></tr></thead>
|
|
<tbody>
|
|
{% for l in relatorio.anexo %}
|
|
<tr>
|
|
<td class="cfr-conta">{{ l.conta_numero }}</td>
|
|
<td>{{ l.fornecedor }}</td>
|
|
<td class="cfr-valor">{{ l.saldo_inicial|moeda }}</td>
|
|
<td class="cfr-valor">{{ l.saldo_final|moeda }}</td>
|
|
<td class="cfr-valor">{{ l.total_em_aberto|moeda }}</td>
|
|
<td class="cfr-valor">{% if l.total_vencido %}{{ l.total_vencido|moeda }}{% else %}—{% endif %}</td>
|
|
<td><span class="cfr-pill cfr-pill--{{ l.status }}">{{ l.status_rotulo }}</span></td>
|
|
<td>{% if l.validacao %}{{ l.validacao }}{% else %}<span class="cfr-pill cfr-pill--neutro">Pendente</span>{% endif %}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</details>
|
|
</section>
|
|
|
|
<p class="cfr-footer">
|
|
Gerado em {{ gerado_em|date:"d/m/Y H:i" }} pelo Portal De Paula. Documento interno de análise do contador.
|
|
Os vínculos entre pagamentos e títulos são feitos por valor e data; possível duplicidade considera pagamentos de mesmo valor com até {{ janela_duplicidade }} dias entre eles.
|
|
</p>
|
|
</div>
|
|
<script>
|
|
document.getElementById("cfr-imprime-anexo").addEventListener("change", (e) => {
|
|
document.body.classList.toggle("cfr-imprime-anexo", e.target.checked);
|
|
});
|
|
// Impressão mostra todos os blocos abertos (o anexo só se marcado).
|
|
window.addEventListener("beforeprint", () => {
|
|
document.querySelectorAll("details").forEach((d) => {
|
|
d.dataset.cfrAberto = d.open ? "1" : "";
|
|
d.open = true;
|
|
});
|
|
});
|
|
window.addEventListener("afterprint", () => {
|
|
document.querySelectorAll("details").forEach((d) => {
|
|
d.open = d.dataset.cfrAberto === "1";
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|