fix build config & fixes for invoice FA1/FA2/FA3

This commit is contained in:
Michał Chudy
2025-12-03 13:42:56 +01:00
parent b9972746aa
commit 1912b5b48d
68 changed files with 1144 additions and 227 deletions

View File

@@ -3,6 +3,7 @@ import {
createHeader,
createLabelText,
formatText,
generateColumns,
getTable,
hasValue,
verticalSpacing,
@@ -35,8 +36,8 @@ export function generatePodmiot2Podmiot2K(podmiot2: Podmiot2, podmiot2K: Podmiot
columnGap: 20,
});
}
firstColumn = generateCorrectedContent(podmiot2K);
secondColumn = generateCorrectedContent(podmiot2);
firstColumn = generateCorrectedContent(podmiot2K, 'Treść korygowana');
secondColumn = generateCorrectedContent(podmiot2, 'Treść korygująca');
if (podmiot2.AdresKoresp) {
secondColumn.push(
formatText('Adres do korespondencji', [FormatTyp.Label, FormatTyp.LabelMargin]),
@@ -45,10 +46,7 @@ export function generatePodmiot2Podmiot2K(podmiot2: Podmiot2, podmiot2K: Podmiot
}
if (firstColumn.length || secondColumn.length) {
result.push({
columns: [firstColumn, secondColumn],
columnGap: 20,
});
result.push(generateColumns([firstColumn, secondColumn]));
}
if (result.length) {
result.push(verticalSpacing(1));
@@ -56,10 +54,10 @@ export function generatePodmiot2Podmiot2K(podmiot2: Podmiot2, podmiot2K: Podmiot
return result;
}
export function generateCorrectedContent(podmiot: Podmiot2 | Podmiot2K): Content[] {
export function generateCorrectedContent(podmiot: Podmiot2 | Podmiot2K, header: string): Content[] {
const result: Content[] = [];
result.push(createHeader('Treść korygowana'));
result.push(createHeader(header));
if (hasValue(podmiot.IDNabywcy)) {
result.push(createLabelText('Identyfikator nabywcy: ', podmiot.IDNabywcy));