fix(qa): clarify and deduplicate V12 financial inconsistency messages

This commit is contained in:
2026-11-20 21:54:16 +02:00
parent fe3c229ca9
commit 4ef5f58e97
7 changed files with 451 additions and 11 deletions
+20 -2
View File
@@ -16,6 +16,7 @@ import {
TextRun,
WidthType,
} from 'docx';
import { financialIssuesForDisplay } from './financial-issue-presentation.ts';
import JSZip from 'jszip';
import { investmentReportTableSlices } from './integral-financial-report.ts';
import {
@@ -451,6 +452,17 @@ export async function generateProjectDossierDocx(
);
const table = sectionTable(section);
if (table) children.push(table);
for (const issue of financialIssuesForDisplay(section.tables ?? [])) {
children.push(
new Paragraph({ text: issue.message, keepNext: true }),
);
children.push(
new Paragraph({
text: `Tabelas afectadas: ${issue.tables.join('; ')}.`,
keepNext: true,
}),
);
}
for (const entry of section.tables ?? []) {
children.push(
new Paragraph({
@@ -459,7 +471,7 @@ export async function generateProjectDossierDocx(
keepNext: true,
}),
);
for (const note of [...entry.issues, ...entry.notes])
for (const note of entry.notes)
children.push(new Paragraph({ text: note, keepNext: true }));
for (const slice of investmentReportTableSlices(entry)) {
// Word merges adjacent tables and then repeats the first
@@ -640,9 +652,15 @@ export async function createProjectDossierPrintHtml(
]),
),
);
for (const issue of financialIssuesForDisplay(section.tables ?? [])) {
content.push(`<p>${escapeHtml(issue.message)}</p>`);
content.push(
`<p>Tabelas afectadas: ${escapeHtml(issue.tables.join('; '))}.</p>`,
);
}
for (const entry of section.tables ?? []) {
content.push(`<h3>${escapeHtml(entry.title)}</h3>`);
for (const note of [...entry.issues, ...entry.notes])
for (const note of entry.notes)
content.push(`<p>${escapeHtml(note)}</p>`);
for (const slice of investmentReportTableSlices(entry))
content.push(htmlTable(slice.headers, slice.rows));