fix: remove demonstration scenario from investor simulator and exports
This commit is contained in:
@@ -3387,7 +3387,7 @@ export function exportBusinessPlanCsv(
|
||||
['Moeda de apresentação', result.presentationCurrency],
|
||||
[
|
||||
'Fonte dos pressupostos',
|
||||
'Valores do formulário; os valores iniciais podem ser exemplos demonstrativos',
|
||||
'Pressupostos introduzidos pelo investidor no formulário',
|
||||
],
|
||||
['Facturação', 'unidades mensais × preço unitário'],
|
||||
['Custo variável', 'unidades mensais × custo variável unitário'],
|
||||
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
import { restoreBusinessPlanSnapshot } from './business-financial-plan.ts';
|
||||
import { fiscalQaRows } from './fiscal-qa-preview.ts';
|
||||
import { financialPlanWarnings } from './financial-plan-warnings.ts';
|
||||
import { buildAnnualExampleTables } from './annual-example-report.ts';
|
||||
import { pathStates } from './investor-path.ts';
|
||||
import {
|
||||
buildProjectDossierRows,
|
||||
@@ -664,47 +663,11 @@ function makeSections(
|
||||
}
|
||||
}
|
||||
if (finance && financialPlan?.reportSource === 'annual_example') {
|
||||
finance.rows = finance.rows
|
||||
.filter((row) => row.field === 'Classificação CAE do plano')
|
||||
.map((row) => ({
|
||||
...row,
|
||||
classification:
|
||||
'Contexto do investimento preservado; não é a classificação do exemplo sintético',
|
||||
}));
|
||||
finance.rows = [];
|
||||
finance.tables = [];
|
||||
finance.paragraphs = [
|
||||
'Exemplo sintético anual editável, da mesma versão guardada do plano. Não representa dados reais do investidor nem financiamento confirmado. As entradas do investidor permanecem preservadas.',
|
||||
'Aviso não bloqueante — O detalhe original por serviço e departamento contém diferenças documentais ainda não reconciliadas. Os totais calculados usam os anuais aprovados; as linhas originais são identificadas separadamente e não são somadas como ajustamentos. A reprodução integral dos dados originais não está validada.',
|
||||
'Seleccione o plano do investidor no editor para incluir os seus dados financeiros no relatório.',
|
||||
];
|
||||
try {
|
||||
const example = buildAnnualExampleTables(financialPlan);
|
||||
finance.tables = example.filter(
|
||||
(t) =>
|
||||
!['market-analysis', 'milestones', 'personnel'].includes(
|
||||
t.id,
|
||||
),
|
||||
);
|
||||
for (const [sectionId, tableId] of [
|
||||
['market', 'market-analysis'],
|
||||
['execution', 'milestones'],
|
||||
['team', 'personnel'],
|
||||
] as const) {
|
||||
const section = sections.get(sectionId);
|
||||
if (section) {
|
||||
section.tables = example.filter((t) => t.id === tableId);
|
||||
section.rows = [];
|
||||
section.paragraphs = [
|
||||
'Dados sintéticos de referência do exemplo anual; não são dados reais do investidor.',
|
||||
];
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
finance.tables = [];
|
||||
finance.paragraphs.push(
|
||||
error instanceof Error
|
||||
? error.message
|
||||
: 'Não foi possível recuperar o exemplo.',
|
||||
);
|
||||
}
|
||||
}
|
||||
if (
|
||||
finance &&
|
||||
@@ -960,7 +923,12 @@ export function createIntegralFinancialReport(
|
||||
...options,
|
||||
selectedSections: new Set(['market', 'finance', 'team', 'execution']),
|
||||
});
|
||||
const tables = report.sections.flatMap((s) => s.tables ?? []);
|
||||
const legacyExample =
|
||||
restoreBusinessPlanSnapshot(text(draft, 'business_plan_snapshot'))
|
||||
?.reportSource === 'annual_example';
|
||||
const tables = legacyExample
|
||||
? []
|
||||
: report.sections.flatMap((s) => s.tables ?? []);
|
||||
const finance = report.sections.find((s) => s.id === 'finance');
|
||||
const planCurrency = restoreBusinessPlanSnapshot(
|
||||
text(draft, 'business_plan_snapshot'),
|
||||
@@ -1003,7 +971,7 @@ export function createIntegralFinancialReport(
|
||||
...(finance?.paragraphs.filter(
|
||||
(p) =>
|
||||
p.startsWith('Aviso não bloqueante') ||
|
||||
p.startsWith('Exemplo sintético anual'),
|
||||
p.startsWith('Seleccione o plano do investidor'),
|
||||
) ?? []),
|
||||
],
|
||||
rows:
|
||||
|
||||
Reference in New Issue
Block a user