wip(qa): preserve package one pending functional acceptance
This commit is contained in:
@@ -17,6 +17,7 @@ import {
|
||||
WidthType,
|
||||
} from 'docx';
|
||||
import JSZip from 'jszip';
|
||||
import { displayReportMoney } from './integral-financial-report.ts';
|
||||
import {
|
||||
classifyDossierAttachment,
|
||||
MAX_EMBEDDED_TEXT_BYTES,
|
||||
@@ -450,6 +451,36 @@ export async function generateProjectDossierDocx(
|
||||
);
|
||||
const table = sectionTable(section);
|
||||
if (table) children.push(table);
|
||||
for (const entry of section.tables ?? []) {
|
||||
children.push(
|
||||
new Paragraph({
|
||||
text: entry.title,
|
||||
heading: HeadingLevel.HEADING_2,
|
||||
}),
|
||||
);
|
||||
for (const note of [...entry.issues, ...entry.notes])
|
||||
children.push(new Paragraph(note));
|
||||
// Repeat the rubric with at most four periods per page-width table.
|
||||
for (let start = 1; start < entry.headers.length; start += 4) {
|
||||
const indices = [
|
||||
0,
|
||||
...Array.from(
|
||||
{ length: Math.min(4, entry.headers.length - start) },
|
||||
(_, i) => start + i,
|
||||
),
|
||||
];
|
||||
children.push(
|
||||
tableForDocx(
|
||||
indices.map((i) => entry.headers[i]),
|
||||
entry.rows.map((row) =>
|
||||
indices.map((i) =>
|
||||
displayReportMoney(row[i] ?? ''),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
if (!section.rows.length && !section.paragraphs.length)
|
||||
children.push(
|
||||
new Paragraph('Não há informação fornecida nesta secção.'),
|
||||
@@ -609,6 +640,17 @@ export async function createProjectDossierPrintHtml(
|
||||
content.push(`<section><h2>${escapeHtml(section.title)}</h2>`);
|
||||
for (const paragraph of section.paragraphs)
|
||||
content.push(`<p>${escapeHtml(paragraph)}</p>`);
|
||||
for (const entry of section.tables ?? []) {
|
||||
content.push(`<h3>${escapeHtml(entry.title)}</h3>`);
|
||||
for (const note of [...entry.issues, ...entry.notes])
|
||||
content.push(`<p>${escapeHtml(note)}</p>`);
|
||||
content.push(
|
||||
`<div style="overflow-x:auto">${htmlTable(
|
||||
entry.headers,
|
||||
entry.rows.map((row) => row.map(displayReportMoney)),
|
||||
)}</div>`,
|
||||
);
|
||||
}
|
||||
if (section.rows.length)
|
||||
content.push(
|
||||
htmlTable(
|
||||
|
||||
Reference in New Issue
Block a user