Repõe a regra aprovada dos rácios e agrupa as faltas por causa

O Pacote 3, aprovado a 20/11, não classifica automaticamente empréstimos
nem presume vencimentos: a liquidez volta a exigir a classificação
declarada. Na lista «Falta preencher» do plano de negócio, a mesma
instrução para vários meses passa a ser uma linha com os meses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzJmxFy3izprXr5dSq91jM
This commit is contained in:
Claude
2026-12-04 21:11:45 +02:00
committed by nala
parent b7ec4578dd
commit 7446970c64
4 changed files with 39 additions and 39 deletions
+2 -17
View File
@@ -119,23 +119,12 @@ export function buildFinancialRatiosTable(
rows['Retorno do capital'].push(
consistent && profitValid ? quotient(net, capital, true) : unknown,
);
// Ask only what cannot be calculated: without a declared
// classification, the balance gives the current amounts and loans
// are read as long-term (stated in the table notes).
const fixed = cell(balance, 'Activos fixos líquidos', i),
loans = cell(balance, 'Empréstimos e suprimentos por reembolsar', i);
const currentAssets = settingsValid
? declaration(settings.assetsByMonth[end])
: settings === undefined && assets !== null && fixed !== null
? assets - fixed
: null,
: null,
currentLiabilities = settingsValid
? declaration(settings.liabilitiesByMonth[end])
: settings === undefined &&
liabilities !== null &&
loans !== null
? liabilities - loans
: null;
: null;
const validCurrent =
currentAssets !== null &&
currentLiabilities !== null &&
@@ -169,10 +158,6 @@ export function buildFinancialRatiosTable(
`${headers[i + 1]}: capital negativo; o retorno conserva o sinal matemático e exige interpretação desta situação.`,
);
}
if (settings === undefined)
result.notes.push(
'Activo e passivo correntes calculados a partir do balanço: activo corrente = total do activo − activos fixos líquidos; passivo corrente = total do passivo − empréstimos e suprimentos, considerados de longo prazo. Se parte dos empréstimos vencer em menos de um ano, declare a classificação.',
);
result.rows = Object.values(rows);
if (blockedPeriods.length)
result.issues.push(
+23 -2
View File
@@ -1049,10 +1049,31 @@ export function createInvestorDecisionReport(
missing.push({
message: `Tabelas ainda sem dados suficientes: ${expected.length} de ${integralFinancialTableIds.length}.`,
});
for (const issue of financialIssuesForDisplay(tables))
// One line per cause: the same instruction for many months is grouped.
const grouped = new Map<string, { months: number[]; tables: string }>();
for (const issue of financialIssuesForDisplay(tables)) {
const month = /— mês (\d+):/.exec(issue.message);
const key = month
? issue.message.replace(/— mês \d+:/, '— meses {meses}:')
: issue.message;
const entry = grouped.get(key) ?? {
months: [],
tables: issue.tables.join('; '),
};
if (month) entry.months.push(Number(month[1]));
grouped.set(key, entry);
}
for (const [key, entry] of grouped) {
const months = entry.months.sort((a, b) => a - b);
const range =
months.length > 1 &&
months[months.length - 1] - months[0] === months.length - 1
? `${months[0]} a ${months[months.length - 1]}`
: months.join(', ');
missing.push({
message: `${issue.message} (${issue.tables.join('; ')})`,
message: `${key.replace('{meses}', range).replace('— meses ' + months[0] + ':', '— mês ' + months[0] + ':')} (${entry.tables})`,
});
}
const chapter = (
title: string,
paragraphs: string[],