makeapps-transformer 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +3 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +4 -0
- package/dist/lib-public/FA3-generator.js +50 -0
- package/dist/lib-public/enums/invoice.enums.js +9 -0
- package/dist/lib-public/generate-invoice.js +21 -0
- package/dist/lib-public/generators/FA2/Adnotacje.js +174 -0
- package/dist/lib-public/generators/FA2/Adres.js +23 -0
- package/dist/lib-public/generators/FA2/DodatkoweInformacje.js +69 -0
- package/dist/lib-public/generators/FA2/Platnosc.js +91 -0
- package/dist/lib-public/generators/FA2/Podmiot1.js +32 -0
- package/dist/lib-public/generators/FA2/Podmiot1Podmiot1K.js +63 -0
- package/dist/lib-public/generators/FA2/Podmiot2.js +28 -0
- package/dist/lib-public/generators/FA2/Podmiot2Podmiot2k.js +62 -0
- package/dist/lib-public/generators/FA2/Podmiot3.js +37 -0
- package/dist/lib-public/generators/FA2/Podmiot3Podmiot2k.js +57 -0
- package/dist/lib-public/generators/FA2/PodmiotAdres.js +14 -0
- package/dist/lib-public/generators/FA2/PodmiotDaneIdentyfikacyjneTPodmiot1Dto.js +10 -0
- package/dist/lib-public/generators/FA2/PodmiotDaneIdentyfikacyjneTPodmiot2Dto.js +34 -0
- package/dist/lib-public/generators/FA2/PodmiotDaneIdentyfikacyjneTPodmiot3Dto.js +44 -0
- package/dist/lib-public/generators/FA2/PodmiotDaneKontaktowe.js +13 -0
- package/dist/lib-public/generators/FA2/PodmiotUpowazniony.js +29 -0
- package/dist/lib-public/generators/FA2/PodmiotUpowaznionyDaneKontaktowe.js +28 -0
- package/dist/lib-public/generators/FA2/Podmioty.js +92 -0
- package/dist/lib-public/generators/FA2/PodsumowanieStawekPodatkuVat.js +260 -0
- package/dist/lib-public/generators/FA2/Przewoznik.js +17 -0
- package/dist/lib-public/generators/FA2/Rabat.js +57 -0
- package/dist/lib-public/generators/FA2/RachunekBankowy.js +54 -0
- package/dist/lib-public/generators/FA2/Szczegoly.js +138 -0
- package/dist/lib-public/generators/FA2/Transport.js +78 -0
- package/dist/lib-public/generators/FA2/WarunkiTransakcji.js +68 -0
- package/dist/lib-public/generators/FA2/Wiersze.js +140 -0
- package/dist/lib-public/generators/FA2/Zamowienie.js +148 -0
- package/dist/lib-public/generators/FA3/Adnotacje.js +185 -0
- package/dist/lib-public/generators/FA3/Adres.js +23 -0
- package/dist/lib-public/generators/FA3/DodatkoweInformacje.js +69 -0
- package/dist/lib-public/generators/FA3/Platnosc.js +105 -0
- package/dist/lib-public/generators/FA3/Podmiot1.js +32 -0
- package/dist/lib-public/generators/FA3/Podmiot1Podmiot1K.js +67 -0
- package/dist/lib-public/generators/FA3/Podmiot2.js +34 -0
- package/dist/lib-public/generators/FA3/Podmiot2Podmiot2k.js +49 -0
- package/dist/lib-public/generators/FA3/Podmiot3.js +37 -0
- package/dist/lib-public/generators/FA3/Podmiot3Podmiot2k.js +57 -0
- package/dist/lib-public/generators/FA3/PodmiotAdres.js +14 -0
- package/dist/lib-public/generators/FA3/PodmiotDaneIdentyfikacyjneTPodmiot1Dto.js +10 -0
- package/dist/lib-public/generators/FA3/PodmiotDaneIdentyfikacyjneTPodmiot2Dto.js +34 -0
- package/dist/lib-public/generators/FA3/PodmiotDaneIdentyfikacyjneTPodmiot3Dto.js +44 -0
- package/dist/lib-public/generators/FA3/PodmiotDaneKontaktowe.js +13 -0
- package/dist/lib-public/generators/FA3/PodmiotUpowazniony.js +29 -0
- package/dist/lib-public/generators/FA3/PodmiotUpowaznionyDaneKontaktowe.js +28 -0
- package/dist/lib-public/generators/FA3/Podmioty.js +92 -0
- package/dist/lib-public/generators/FA3/PodsumowanieStawekPodatkuVat.js +264 -0
- package/dist/lib-public/generators/FA3/Przewoznik.js +17 -0
- package/dist/lib-public/generators/FA3/Rabat.js +57 -0
- package/dist/lib-public/generators/FA3/RachunekBankowy.js +58 -0
- package/dist/lib-public/generators/FA3/Szczegoly.js +138 -0
- package/dist/lib-public/generators/FA3/Transport.js +78 -0
- package/dist/lib-public/generators/FA3/WarunkiTransakcji.js +68 -0
- package/dist/lib-public/generators/FA3/Wiersze.js +140 -0
- package/dist/lib-public/generators/FA3/Zamowienie.js +148 -0
- package/dist/lib-public/generators/common/DaneFaKorygowanej.js +74 -0
- package/dist/lib-public/generators/common/Naglowek.js +100 -0
- package/dist/lib-public/generators/common/Rozliczenie.js +120 -0
- package/dist/lib-public/generators/common/Stopka.js +113 -0
- package/dist/lib-public/generators/common/Wiersze.js +28 -0
- package/dist/lib-public/generators/common/Zalaczniki.js +182 -0
- package/dist/lib-public/index.js +5 -0
- package/dist/lib-public/types/common.types.js +2 -0
- package/dist/lib-public/types/fa1-additional-types.js +2 -0
- package/dist/lib-public/types/fa1.types.js +2 -0
- package/dist/lib-public/types/fa2-additional-types.js +2 -0
- package/dist/lib-public/types/fa2.types.js +2 -0
- package/dist/lib-public/types/fa2Podmiot3DaneIdentyfikacyjne.types.js +2 -0
- package/dist/lib-public/types/fa3.types.js +2 -0
- package/dist/lib-public/types/fa3Podmiot3DaneIdentyfikacyjne.types.js +2 -0
- package/dist/lib-public/types/tax-summary.types.js +2 -0
- package/dist/lib-public/types/upo-v4_2.types.js +2 -0
- package/dist/shared/PDF-functions.js +429 -0
- package/dist/shared/XML-parser.js +21 -0
- package/dist/shared/consts/const.js +390 -0
- package/dist/shared/enums/common.enum.js +48 -0
- package/dist/shared/enums/invoice.enums.js +13 -0
- package/dist/shared/generators/common/functions.js +95 -0
- package/dist/shared/types/additional-data.types.js +2 -0
- package/dist/shared/types/pdf-types.js +2 -0
- package/dist/shared/types/universal.types.js +2 -0
- package/package.json +21 -0
- package/src/index.d.ts +7 -0
- package/src/index.ts +2 -0
- package/src/lib-public/FA3-generator.ts +56 -0
- package/src/lib-public/enums/invoice.enums.ts +5 -0
- package/src/lib-public/generate-invoice.ts +32 -0
- package/src/lib-public/generators/FA2/Adnotacje.ts +206 -0
- package/src/lib-public/generators/FA2/Adres.ts +20 -0
- package/src/lib-public/generators/FA2/DodatkoweInformacje.ts +97 -0
- package/src/lib-public/generators/FA2/Platnosc.ts +131 -0
- package/src/lib-public/generators/FA2/Podmiot1.ts +40 -0
- package/src/lib-public/generators/FA2/Podmiot1Podmiot1K.ts +73 -0
- package/src/lib-public/generators/FA2/Podmiot2.ts +42 -0
- package/src/lib-public/generators/FA2/Podmiot2Podmiot2k.ts +74 -0
- package/src/lib-public/generators/FA2/Podmiot3.ts +50 -0
- package/src/lib-public/generators/FA2/Podmiot3Podmiot2k.ts +77 -0
- package/src/lib-public/generators/FA2/PodmiotAdres.ts +19 -0
- package/src/lib-public/generators/FA2/PodmiotDaneIdentyfikacyjneTPodmiot1Dto.ts +10 -0
- package/src/lib-public/generators/FA2/PodmiotDaneIdentyfikacyjneTPodmiot2Dto.ts +37 -0
- package/src/lib-public/generators/FA2/PodmiotDaneIdentyfikacyjneTPodmiot3Dto.ts +44 -0
- package/src/lib-public/generators/FA2/PodmiotDaneKontaktowe.ts +12 -0
- package/src/lib-public/generators/FA2/PodmiotUpowazniony.ts +31 -0
- package/src/lib-public/generators/FA2/PodmiotUpowaznionyDaneKontaktowe.ts +34 -0
- package/src/lib-public/generators/FA2/Podmioty.ts +96 -0
- package/src/lib-public/generators/FA2/PodsumowanieStawekPodatkuVat.ts +294 -0
- package/src/lib-public/generators/FA2/Przewoznik.ts +21 -0
- package/src/lib-public/generators/FA2/Rabat.ts +47 -0
- package/src/lib-public/generators/FA2/RachunekBankowy.ts +60 -0
- package/src/lib-public/generators/FA2/Szczegoly.ts +187 -0
- package/src/lib-public/generators/FA2/Transport.ts +108 -0
- package/src/lib-public/generators/FA2/WarunkiTransakcji.ts +105 -0
- package/src/lib-public/generators/FA2/Wiersze.ts +126 -0
- package/src/lib-public/generators/FA2/Zamowienie.ts +144 -0
- package/src/lib-public/generators/FA3/Adnotacje.ts +249 -0
- package/src/lib-public/generators/FA3/Adres.ts +20 -0
- package/src/lib-public/generators/FA3/DodatkoweInformacje.ts +92 -0
- package/src/lib-public/generators/FA3/Platnosc.ts +144 -0
- package/src/lib-public/generators/FA3/Podmiot1.ts +40 -0
- package/src/lib-public/generators/FA3/Podmiot1Podmiot1K.ts +78 -0
- package/src/lib-public/generators/FA3/Podmiot2.ts +55 -0
- package/src/lib-public/generators/FA3/Podmiot2Podmiot2k.ts +59 -0
- package/src/lib-public/generators/FA3/Podmiot3.ts +50 -0
- package/src/lib-public/generators/FA3/Podmiot3Podmiot2k.ts +78 -0
- package/src/lib-public/generators/FA3/PodmiotAdres.ts +19 -0
- package/src/lib-public/generators/FA3/PodmiotDaneIdentyfikacyjneTPodmiot1Dto.ts +10 -0
- package/src/lib-public/generators/FA3/PodmiotDaneIdentyfikacyjneTPodmiot2Dto.ts +37 -0
- package/src/lib-public/generators/FA3/PodmiotDaneIdentyfikacyjneTPodmiot3Dto.ts +44 -0
- package/src/lib-public/generators/FA3/PodmiotDaneKontaktowe.ts +12 -0
- package/src/lib-public/generators/FA3/PodmiotUpowazniony.ts +31 -0
- package/src/lib-public/generators/FA3/PodmiotUpowaznionyDaneKontaktowe.ts +34 -0
- package/src/lib-public/generators/FA3/Podmioty.ts +96 -0
- package/src/lib-public/generators/FA3/PodsumowanieStawekPodatkuVat.ts +298 -0
- package/src/lib-public/generators/FA3/Przewoznik.ts +24 -0
- package/src/lib-public/generators/FA3/Rabat.ts +45 -0
- package/src/lib-public/generators/FA3/RachunekBankowy.ts +60 -0
- package/src/lib-public/generators/FA3/Szczegoly.ts +184 -0
- package/src/lib-public/generators/FA3/Transport.ts +108 -0
- package/src/lib-public/generators/FA3/WarunkiTransakcji.ts +100 -0
- package/src/lib-public/generators/FA3/Wiersze.ts +126 -0
- package/src/lib-public/generators/FA3/Zamowienie.ts +143 -0
- package/src/lib-public/generators/common/DaneFaKorygowanej.ts +91 -0
- package/src/lib-public/generators/common/Naglowek.ts +84 -0
- package/src/lib-public/generators/common/Rozliczenie.ts +119 -0
- package/src/lib-public/generators/common/Stopka.ts +161 -0
- package/src/lib-public/generators/common/Wiersze.ts +32 -0
- package/src/lib-public/generators/common/Zalaczniki.ts +232 -0
- package/src/lib-public/index.ts +3 -0
- package/src/lib-public/types/common.types.ts +29 -0
- package/src/lib-public/types/fa1-additional-types.ts +26 -0
- package/src/lib-public/types/fa1.types.ts +299 -0
- package/src/lib-public/types/fa2-additional-types.ts +30 -0
- package/src/lib-public/types/fa2.types.ts +307 -0
- package/src/lib-public/types/fa2Podmiot3DaneIdentyfikacyjne.types.ts +12 -0
- package/src/lib-public/types/fa3.types.ts +384 -0
- package/src/lib-public/types/fa3Podmiot3DaneIdentyfikacyjne.types.ts +12 -0
- package/src/lib-public/types/tax-summary.types.ts +8 -0
- package/src/lib-public/types/upo-v4_2.types.ts +68 -0
- package/src/shared/PDF-functions.ts +466 -0
- package/src/shared/XML-parser.ts +42 -0
- package/src/shared/consts/const.ts +406 -0
- package/src/shared/enums/common.enum.ts +45 -0
- package/src/shared/enums/invoice.enums.ts +9 -0
- package/src/shared/generators/common/functions.ts +101 -0
- package/src/shared/types/additional-data.types.ts +15 -0
- package/src/shared/types/pdf-types.ts +58 -0
- package/src/shared/types/universal.types.ts +16 -0
- package/transformer.code-workspace +45 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.generatePlatnosc = generatePlatnosc;
|
|
7
|
+
const PDF_functions_1 = require("../../../shared/PDF-functions");
|
|
8
|
+
const functions_1 = require("../../../shared/generators/common/functions");
|
|
9
|
+
const RachunekBankowy_1 = require("./RachunekBankowy");
|
|
10
|
+
const common_enum_1 = __importDefault(require("../../../shared/enums/common.enum"));
|
|
11
|
+
function generatePlatnosc(platnosc) {
|
|
12
|
+
var _a, _b, _c, _d;
|
|
13
|
+
if (!platnosc) {
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
const terminPlatnosci = (0, PDF_functions_1.getTable)(platnosc.TerminPlatnosci);
|
|
17
|
+
const zaplataCzesciowaHeader = [
|
|
18
|
+
{
|
|
19
|
+
name: 'Termin',
|
|
20
|
+
title: 'Termin płatności',
|
|
21
|
+
format: common_enum_1.default.Default,
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
if (terminPlatnosci.some((termin) => termin.TerminOpis)) {
|
|
25
|
+
zaplataCzesciowaHeader.push({ name: 'TerminOpis', title: 'Opis płatności', format: common_enum_1.default.Default });
|
|
26
|
+
}
|
|
27
|
+
const zaplataCzesciowaNaglowek = [
|
|
28
|
+
{
|
|
29
|
+
name: 'DataZaplatyCzesciowej',
|
|
30
|
+
title: 'Data zapłaty częściowej',
|
|
31
|
+
format: common_enum_1.default.Default,
|
|
32
|
+
},
|
|
33
|
+
{ name: 'KwotaZaplatyCzesciowej', title: 'Kwota zapłaty częściowej', format: common_enum_1.default.Currency },
|
|
34
|
+
{ name: 'FormaPlatnosci', title: 'Forma płatności', format: common_enum_1.default.FormOfPayment },
|
|
35
|
+
];
|
|
36
|
+
const table = [(0, PDF_functions_1.generateLine)(), ...(0, PDF_functions_1.createHeader)('Płatność')];
|
|
37
|
+
if ((0, PDF_functions_1.getValue)(platnosc.Zaplacono) === '1') {
|
|
38
|
+
table.push((0, PDF_functions_1.createLabelText)('Informacja o płatności: ', 'Zapłacono'));
|
|
39
|
+
table.push((0, PDF_functions_1.createLabelText)('Data zapłaty: ', platnosc.DataZaplaty));
|
|
40
|
+
}
|
|
41
|
+
else if ((0, PDF_functions_1.getValue)(platnosc.ZnacznikZaplatyCzesciowej) === '1' ||
|
|
42
|
+
(0, PDF_functions_1.getValue)(platnosc.ZnacznikZaplatyCzesciowej) === '2') {
|
|
43
|
+
table.push((0, PDF_functions_1.createLabelText)('Informacja o płatności: ', 'Zapłata częściowa'));
|
|
44
|
+
table.push((0, PDF_functions_1.createLabelText)('Informacja o płatności (kontynuacja): ', (0, PDF_functions_1.getValue)(platnosc.ZnacznikZaplatyCzesciowej) === '1'
|
|
45
|
+
? 'Zapłacono w części'
|
|
46
|
+
: 'Zapłacono całość w częściach'));
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
table.push((0, PDF_functions_1.createLabelText)('Informacja o płatności: ', 'Brak zapłaty'));
|
|
50
|
+
}
|
|
51
|
+
if ((0, PDF_functions_1.hasValue)(platnosc.FormaPlatnosci)) {
|
|
52
|
+
table.push((0, PDF_functions_1.createLabelText)('Forma płatności: ', (0, functions_1.getFormaPlatnosciString)(platnosc.FormaPlatnosci)));
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
if ((_a = platnosc.OpisPlatnosci) === null || _a === void 0 ? void 0 : _a._text) {
|
|
56
|
+
table.push((0, PDF_functions_1.createLabelText)('Forma płatności: ', 'Płatność inna'));
|
|
57
|
+
table.push((0, PDF_functions_1.createLabelText)('Opis płatności innej: ', platnosc.OpisPlatnosci));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const zaplataCzesciowa = (0, PDF_functions_1.getTable)(platnosc.ZaplataCzesciowa);
|
|
61
|
+
const tableZaplataCzesciowa = (0, PDF_functions_1.getContentTable)(zaplataCzesciowaNaglowek, zaplataCzesciowa, '*');
|
|
62
|
+
const terminPatnosciContent = terminPlatnosci.map((platnosc) => {
|
|
63
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
64
|
+
if (!terminPlatnosci.some((termin) => termin.TerminOpis)) {
|
|
65
|
+
return platnosc;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
return {
|
|
69
|
+
...platnosc,
|
|
70
|
+
TerminOpis: {
|
|
71
|
+
_text: `${(_c = (_b = (_a = platnosc.TerminOpis) === null || _a === void 0 ? void 0 : _a.Ilosc) === null || _b === void 0 ? void 0 : _b._text) !== null && _c !== void 0 ? _c : ''} ${(_f = (_e = (_d = platnosc.TerminOpis) === null || _d === void 0 ? void 0 : _d.Jednostka) === null || _e === void 0 ? void 0 : _e._text) !== null && _f !== void 0 ? _f : ''} ${(_j = (_h = (_g = platnosc.TerminOpis) === null || _g === void 0 ? void 0 : _g.ZdarzeniePoczatkowe) === null || _h === void 0 ? void 0 : _h._text) !== null && _j !== void 0 ? _j : ''}`,
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
const tableTerminPlatnosci = (0, PDF_functions_1.getContentTable)(zaplataCzesciowaHeader, terminPatnosciContent, '*');
|
|
77
|
+
if (zaplataCzesciowa.length > 0 && terminPlatnosci.length > 0) {
|
|
78
|
+
table.push((0, PDF_functions_1.generateTwoColumns)((_b = tableZaplataCzesciowa.content) !== null && _b !== void 0 ? _b : [], (_c = tableTerminPlatnosci.content) !== null && _c !== void 0 ? _c : [], [0, 4, 0, 0]));
|
|
79
|
+
}
|
|
80
|
+
else if (terminPlatnosci.length > 0) {
|
|
81
|
+
if (tableTerminPlatnosci.content) {
|
|
82
|
+
table.push((0, PDF_functions_1.generateTwoColumns)([], tableTerminPlatnosci.content));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else if (zaplataCzesciowa.length > 0 && tableZaplataCzesciowa.content) {
|
|
86
|
+
table.push(tableZaplataCzesciowa.content);
|
|
87
|
+
}
|
|
88
|
+
if (platnosc.LinkDoPlatnosci) {
|
|
89
|
+
table.push((0, PDF_functions_1.formatText)('Link do płatności bezgotówkowej: ', common_enum_1.default.Label));
|
|
90
|
+
table.push({
|
|
91
|
+
text: (0, PDF_functions_1.formatText)(platnosc.LinkDoPlatnosci._text, common_enum_1.default.Link),
|
|
92
|
+
link: (0, PDF_functions_1.formatText)(platnosc.LinkDoPlatnosci._text, common_enum_1.default.Link),
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
if ((_d = platnosc.IPKSeF) === null || _d === void 0 ? void 0 : _d._text) {
|
|
96
|
+
(0, PDF_functions_1.createLabelText)('Identyfikator płatności Krajowego Systemu e-Faktur: ', platnosc.IPKSeF);
|
|
97
|
+
}
|
|
98
|
+
table.push((0, PDF_functions_1.generateTwoColumns)((0, RachunekBankowy_1.generujRachunekBankowy)((0, PDF_functions_1.getTable)(platnosc.RachunekBankowy), 'Numer rachunku bankowego'), (0, RachunekBankowy_1.generujRachunekBankowy)((0, PDF_functions_1.getTable)(platnosc.RachunekBankowyFaktora), 'Numer rachunku bankowego faktora')));
|
|
99
|
+
if (platnosc.Skonto) {
|
|
100
|
+
table.push((0, PDF_functions_1.createHeader)('Skonto', [0, 0]));
|
|
101
|
+
table.push((0, PDF_functions_1.createLabelText)('Warunki skonta: ', platnosc.Skonto.WarunkiSkonta));
|
|
102
|
+
table.push((0, PDF_functions_1.createLabelText)('Wysokość skonta: ', platnosc.Skonto.WysokoscSkonta));
|
|
103
|
+
}
|
|
104
|
+
return table;
|
|
105
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.generatePodmiot1 = generatePodmiot1;
|
|
7
|
+
const PDF_functions_1 = require("../../../shared/PDF-functions");
|
|
8
|
+
const common_enum_1 = __importDefault(require("../../../shared/enums/common.enum"));
|
|
9
|
+
const Adres_1 = require("./Adres");
|
|
10
|
+
const PodmiotDaneIdentyfikacyjneTPodmiot1Dto_1 = require("./PodmiotDaneIdentyfikacyjneTPodmiot1Dto");
|
|
11
|
+
const PodmiotDaneKontaktowe_1 = require("./PodmiotDaneKontaktowe");
|
|
12
|
+
function generatePodmiot1(podmiot1) {
|
|
13
|
+
const result = (0, PDF_functions_1.createHeader)('Sprzedawca');
|
|
14
|
+
result.push((0, PDF_functions_1.createLabelText)('NrEORI: ', podmiot1.NrEORI), (0, PDF_functions_1.createLabelText)('Prefiks VAT: ', podmiot1.PrefiksPodatnika));
|
|
15
|
+
if (podmiot1.DaneIdentyfikacyjne) {
|
|
16
|
+
result.push(...(0, PodmiotDaneIdentyfikacyjneTPodmiot1Dto_1.generateDaneIdentyfikacyjneTPodmiot1Dto)(podmiot1.DaneIdentyfikacyjne));
|
|
17
|
+
}
|
|
18
|
+
if (podmiot1.Adres) {
|
|
19
|
+
result.push((0, PDF_functions_1.formatText)('Adres', [common_enum_1.default.Label, common_enum_1.default.LabelMargin]), (0, Adres_1.generateAdres)(podmiot1.Adres));
|
|
20
|
+
}
|
|
21
|
+
if (podmiot1.AdresKoresp) {
|
|
22
|
+
result.push((0, PDF_functions_1.formatText)('Adres do korespondencji', [common_enum_1.default.Label, common_enum_1.default.LabelMargin]), ...(0, Adres_1.generateAdres)(podmiot1.AdresKoresp));
|
|
23
|
+
}
|
|
24
|
+
if (podmiot1.DaneKontaktowe) {
|
|
25
|
+
result.push((0, PDF_functions_1.formatText)('Dane kontaktowe', [common_enum_1.default.Label, common_enum_1.default.LabelMargin]), ...(0, PodmiotDaneKontaktowe_1.generateDaneKontaktowe)(podmiot1.DaneKontaktowe));
|
|
26
|
+
result.push((0, PDF_functions_1.createLabelText)('Status podatnika: ', podmiot1.StatusInfoPodatnika));
|
|
27
|
+
}
|
|
28
|
+
else if (podmiot1.StatusInfoPodatnika) {
|
|
29
|
+
result.push((0, PDF_functions_1.createLabelText)('Status podatnika: ', podmiot1.StatusInfoPodatnika));
|
|
30
|
+
}
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.generatePodmiot1Podmiot1K = generatePodmiot1Podmiot1K;
|
|
7
|
+
exports.generateCorrectedContent = generateCorrectedContent;
|
|
8
|
+
const PDF_functions_1 = require("../../../shared/PDF-functions");
|
|
9
|
+
const common_enum_1 = __importDefault(require("../../../shared/enums/common.enum"));
|
|
10
|
+
const PodmiotDaneIdentyfikacyjneTPodmiot1Dto_1 = require("./PodmiotDaneIdentyfikacyjneTPodmiot1Dto");
|
|
11
|
+
const PodmiotDaneKontaktowe_1 = require("./PodmiotDaneKontaktowe");
|
|
12
|
+
const Adres_1 = require("./Adres");
|
|
13
|
+
function generatePodmiot1Podmiot1K(podmiot1, podmiot1K) {
|
|
14
|
+
const result = (0, PDF_functions_1.createHeader)('Sprzedawca');
|
|
15
|
+
let firstColumn = [];
|
|
16
|
+
let secondColumn = [];
|
|
17
|
+
firstColumn.push((0, PDF_functions_1.createHeader)('Dane identyfikacyjne'), (0, PDF_functions_1.createLabelText)('Numer EORI: ', podmiot1.NrEORI));
|
|
18
|
+
if (podmiot1.DaneIdentyfikacyjne) {
|
|
19
|
+
firstColumn.push(...(0, PodmiotDaneIdentyfikacyjneTPodmiot1Dto_1.generateDaneIdentyfikacyjneTPodmiot1Dto)(podmiot1.DaneIdentyfikacyjne));
|
|
20
|
+
}
|
|
21
|
+
if (podmiot1.DaneKontaktowe) {
|
|
22
|
+
const daneKontaktowe = (0, PodmiotDaneKontaktowe_1.generateDaneKontaktowe)((0, PDF_functions_1.getTable)(podmiot1.DaneKontaktowe));
|
|
23
|
+
if (daneKontaktowe.length) {
|
|
24
|
+
firstColumn.push((0, PDF_functions_1.createHeader)('Dane kontaktowe'));
|
|
25
|
+
firstColumn.push(daneKontaktowe);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (podmiot1.StatusInfoPodatnika) {
|
|
29
|
+
firstColumn.push((0, PDF_functions_1.createLabelText)('Status podatnika: ', podmiot1.StatusInfoPodatnika));
|
|
30
|
+
}
|
|
31
|
+
if (firstColumn.length) {
|
|
32
|
+
result.push({
|
|
33
|
+
columns: [firstColumn, []],
|
|
34
|
+
columnGap: 20,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
firstColumn = generateCorrectedContent(podmiot1K);
|
|
38
|
+
secondColumn = generateCorrectedContent(podmiot1);
|
|
39
|
+
if (podmiot1.AdresKoresp) {
|
|
40
|
+
secondColumn.push((0, PDF_functions_1.formatText)('Adres do korespondencji', [common_enum_1.default.Label, common_enum_1.default.LabelMargin]), (0, Adres_1.generateAdres)(podmiot1.AdresKoresp));
|
|
41
|
+
}
|
|
42
|
+
if (firstColumn.length || secondColumn.length) {
|
|
43
|
+
result.push({
|
|
44
|
+
columns: [firstColumn, secondColumn],
|
|
45
|
+
columnGap: 20,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (result.length) {
|
|
49
|
+
result.push((0, PDF_functions_1.verticalSpacing)(1));
|
|
50
|
+
}
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
function generateCorrectedContent(podmiot) {
|
|
54
|
+
var _a;
|
|
55
|
+
const result = [];
|
|
56
|
+
result.push((0, PDF_functions_1.createHeader)('Treść korygowana'));
|
|
57
|
+
if ((_a = podmiot.PrefiksPodatnika) === null || _a === void 0 ? void 0 : _a._text) {
|
|
58
|
+
result.push((0, PDF_functions_1.createLabelText)('Prefiks VAT: ', podmiot.PrefiksPodatnika));
|
|
59
|
+
}
|
|
60
|
+
if (podmiot.DaneIdentyfikacyjne) {
|
|
61
|
+
result.push(...(0, PodmiotDaneIdentyfikacyjneTPodmiot1Dto_1.generateDaneIdentyfikacyjneTPodmiot1Dto)(podmiot.DaneIdentyfikacyjne));
|
|
62
|
+
}
|
|
63
|
+
if (podmiot.Adres) {
|
|
64
|
+
result.push((0, PDF_functions_1.formatText)('Adres', [common_enum_1.default.Label, common_enum_1.default.LabelMargin]), (0, Adres_1.generateAdres)(podmiot.Adres));
|
|
65
|
+
}
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.generatePodmiot2 = generatePodmiot2;
|
|
7
|
+
const PDF_functions_1 = require("../../../shared/PDF-functions");
|
|
8
|
+
const common_enum_1 = __importDefault(require("../../../shared/enums/common.enum"));
|
|
9
|
+
const Adres_1 = require("./Adres");
|
|
10
|
+
const PodmiotDaneIdentyfikacyjneTPodmiot2Dto_1 = require("./PodmiotDaneIdentyfikacyjneTPodmiot2Dto");
|
|
11
|
+
const PodmiotDaneKontaktowe_1 = require("./PodmiotDaneKontaktowe");
|
|
12
|
+
function generatePodmiot2(podmiot2) {
|
|
13
|
+
var _a, _b, _c;
|
|
14
|
+
const result = (0, PDF_functions_1.createHeader)('Nabywca');
|
|
15
|
+
result.push((0, PDF_functions_1.createLabelText)('Identyfikator nabywcy: ', podmiot2.IDNabywcy), (0, PDF_functions_1.createLabelText)('NrEORI: ', podmiot2.NrEORI));
|
|
16
|
+
if (podmiot2.DaneIdentyfikacyjne) {
|
|
17
|
+
result.push(...(0, PodmiotDaneIdentyfikacyjneTPodmiot2Dto_1.generateDaneIdentyfikacyjneTPodmiot2Dto)(podmiot2.DaneIdentyfikacyjne));
|
|
18
|
+
}
|
|
19
|
+
if (podmiot2.Adres) {
|
|
20
|
+
result.push((0, PDF_functions_1.formatText)('Adres', [common_enum_1.default.Label, common_enum_1.default.LabelMargin]), (0, Adres_1.generateAdres)(podmiot2.Adres));
|
|
21
|
+
}
|
|
22
|
+
if (podmiot2.AdresKoresp) {
|
|
23
|
+
result.push((0, PDF_functions_1.formatText)('Adres do korespondencji', [common_enum_1.default.Label, common_enum_1.default.LabelMargin]), ...(0, Adres_1.generateAdres)(podmiot2.AdresKoresp));
|
|
24
|
+
}
|
|
25
|
+
if (podmiot2.DaneKontaktowe || podmiot2.NrKlienta) {
|
|
26
|
+
result.push((0, PDF_functions_1.formatText)('Dane kontaktowe', [common_enum_1.default.Label, common_enum_1.default.LabelMargin]), ...(0, PodmiotDaneKontaktowe_1.generateDaneKontaktowe)((_a = podmiot2.DaneKontaktowe) !== null && _a !== void 0 ? _a : []), (0, PDF_functions_1.createLabelText)('Numer klienta: ', podmiot2.NrKlienta));
|
|
27
|
+
const daneKontaktowe = (0, PDF_functions_1.getTable)(podmiot2.DaneKontaktowe);
|
|
28
|
+
if (daneKontaktowe.length) {
|
|
29
|
+
(0, PDF_functions_1.createLabelText)('Faktura dotyczy jednostki podrzędnej JST: ', ((_b = daneKontaktowe[0].JST) === null || _b === void 0 ? void 0 : _b._text) === '1' ? 'TAK' : 'NIE');
|
|
30
|
+
(0, PDF_functions_1.createLabelText)('Faktura dotyczy członka grupy GV: ', ((_c = daneKontaktowe[0].GV) === null || _c === void 0 ? void 0 : _c._text) === '1' ? 'TAK' : 'NIE');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.generatePodmiot2Podmiot2K = generatePodmiot2Podmiot2K;
|
|
7
|
+
const PDF_functions_1 = require("../../../shared/PDF-functions");
|
|
8
|
+
const common_enum_1 = __importDefault(require("../../../shared/enums/common.enum"));
|
|
9
|
+
const PodmiotDaneIdentyfikacyjneTPodmiot1Dto_1 = require("./PodmiotDaneIdentyfikacyjneTPodmiot1Dto");
|
|
10
|
+
const PodmiotDaneKontaktowe_1 = require("./PodmiotDaneKontaktowe");
|
|
11
|
+
const Podmiot2Podmiot2k_1 = require("../FA2/Podmiot2Podmiot2k");
|
|
12
|
+
const Adres_1 = require("../FA2/Adres");
|
|
13
|
+
function generatePodmiot2Podmiot2K(podmiot2, podmiot2K) {
|
|
14
|
+
const result = (0, PDF_functions_1.createHeader)('Nabywca');
|
|
15
|
+
let firstColumn = [];
|
|
16
|
+
let secondColumn = [];
|
|
17
|
+
firstColumn.push((0, PDF_functions_1.createHeader)('Dane identyfikacyjne'), (0, PDF_functions_1.createLabelText)('Numer EORI: ', podmiot2.NrEORI));
|
|
18
|
+
if (podmiot2.DaneIdentyfikacyjne) {
|
|
19
|
+
firstColumn.push(...(0, PodmiotDaneIdentyfikacyjneTPodmiot1Dto_1.generateDaneIdentyfikacyjneTPodmiot1Dto)(podmiot2.DaneIdentyfikacyjne));
|
|
20
|
+
}
|
|
21
|
+
if (podmiot2.DaneKontaktowe) {
|
|
22
|
+
firstColumn.push((0, PDF_functions_1.formatText)('Dane kontaktowe', [common_enum_1.default.Label, common_enum_1.default.LabelMargin]));
|
|
23
|
+
if (podmiot2.NrKlienta) {
|
|
24
|
+
firstColumn.push((0, PDF_functions_1.createLabelText)('Numer klienta: ', podmiot2.NrKlienta));
|
|
25
|
+
}
|
|
26
|
+
firstColumn.push((0, PodmiotDaneKontaktowe_1.generateDaneKontaktowe)((0, PDF_functions_1.getTable)(podmiot2.DaneKontaktowe)));
|
|
27
|
+
}
|
|
28
|
+
if (firstColumn.length) {
|
|
29
|
+
result.push({
|
|
30
|
+
columns: [firstColumn, []],
|
|
31
|
+
columnGap: 20,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
firstColumn = (0, Podmiot2Podmiot2k_1.generateCorrectedContent)(podmiot2K);
|
|
35
|
+
secondColumn = (0, Podmiot2Podmiot2k_1.generateCorrectedContent)(podmiot2);
|
|
36
|
+
if (podmiot2.AdresKoresp) {
|
|
37
|
+
secondColumn.push((0, PDF_functions_1.formatText)('Adres do korespondencji', [common_enum_1.default.Label, common_enum_1.default.LabelMargin]), (0, Adres_1.generateAdres)(podmiot2.AdresKoresp));
|
|
38
|
+
}
|
|
39
|
+
if (firstColumn.length || secondColumn.length) {
|
|
40
|
+
result.push({
|
|
41
|
+
columns: [firstColumn, secondColumn],
|
|
42
|
+
columnGap: 20,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
if (result.length) {
|
|
46
|
+
result.push((0, PDF_functions_1.verticalSpacing)(1));
|
|
47
|
+
}
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.generatePodmiot3 = generatePodmiot3;
|
|
7
|
+
const PDF_functions_1 = require("../../../shared/PDF-functions");
|
|
8
|
+
const common_enum_1 = __importDefault(require("../../../shared/enums/common.enum"));
|
|
9
|
+
const PodmiotDaneIdentyfikacyjneTPodmiot3Dto_1 = require("./PodmiotDaneIdentyfikacyjneTPodmiot3Dto");
|
|
10
|
+
const PodmiotDaneKontaktowe_1 = require("./PodmiotDaneKontaktowe");
|
|
11
|
+
const functions_1 = require("../../../shared/generators/common/functions");
|
|
12
|
+
const Adres_1 = require("../FA2/Adres");
|
|
13
|
+
function generatePodmiot3(podmiot, index) {
|
|
14
|
+
const result = [];
|
|
15
|
+
result.push((0, PDF_functions_1.generateLine)());
|
|
16
|
+
const column1 = [
|
|
17
|
+
...(0, PDF_functions_1.createHeader)(`Podmiot inny ${index + 1}`),
|
|
18
|
+
(0, PDF_functions_1.createLabelText)('Identyfikator nabywcy: ', podmiot.IDNabywcy),
|
|
19
|
+
(0, PDF_functions_1.createLabelText)('NrEORI: ', podmiot.NrEORI),
|
|
20
|
+
...(0, PodmiotDaneIdentyfikacyjneTPodmiot3Dto_1.generateDaneIdentyfikacyjneTPodmiot3Dto)(podmiot.DaneIdentyfikacyjne),
|
|
21
|
+
(0, PDF_functions_1.createLabelText)('Rola: ', (0, functions_1.getRolaString)(podmiot.Rola, 3)),
|
|
22
|
+
(0, PDF_functions_1.createLabelText)('Rola inna: ', podmiot.OpisRoli),
|
|
23
|
+
(0, PDF_functions_1.createLabelText)('Udział: ', podmiot.Udzial, [common_enum_1.default.Percentage]),
|
|
24
|
+
];
|
|
25
|
+
const column2 = [];
|
|
26
|
+
if (podmiot.Adres) {
|
|
27
|
+
column2.push((0, PDF_functions_1.formatText)('Adres', [common_enum_1.default.Label, common_enum_1.default.LabelMargin]), (0, Adres_1.generateAdres)(podmiot.Adres));
|
|
28
|
+
}
|
|
29
|
+
if (podmiot.AdresKoresp) {
|
|
30
|
+
column2.push((0, PDF_functions_1.formatText)('Adres do korespondencji', [common_enum_1.default.Label, common_enum_1.default.LabelMargin]), ...(0, Adres_1.generateAdres)(podmiot.AdresKoresp));
|
|
31
|
+
}
|
|
32
|
+
if (podmiot.DaneKontaktowe) {
|
|
33
|
+
column2.push((0, PDF_functions_1.formatText)('Dane kontaktowe', [common_enum_1.default.Label, common_enum_1.default.LabelMargin]), ...(0, PodmiotDaneKontaktowe_1.generateDaneKontaktowe)(podmiot.DaneKontaktowe), (0, PDF_functions_1.createLabelText)('Numer klienta: ', podmiot.NrKlienta));
|
|
34
|
+
}
|
|
35
|
+
result.push((0, PDF_functions_1.generateTwoColumns)(column1, column2));
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.generateDaneIdentyfikacyjneTPodmiot3Dto = generateDaneIdentyfikacyjneTPodmiot3Dto;
|
|
7
|
+
const PDF_functions_1 = require("../../../shared/PDF-functions");
|
|
8
|
+
const common_enum_1 = __importDefault(require("../../../shared/enums/common.enum"));
|
|
9
|
+
const functions_1 = require("../../../shared/generators/common/functions");
|
|
10
|
+
const PodmiotAdres_1 = require("./PodmiotAdres");
|
|
11
|
+
const PodmiotDaneIdentyfikacyjneTPodmiot2Dto_1 = require("./PodmiotDaneIdentyfikacyjneTPodmiot2Dto");
|
|
12
|
+
const PodmiotDaneKontaktowe_1 = require("./PodmiotDaneKontaktowe");
|
|
13
|
+
function generateDaneIdentyfikacyjneTPodmiot3Dto(podmiot2KDto, index) {
|
|
14
|
+
var _a;
|
|
15
|
+
if (!podmiot2KDto) {
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
const podmiot1 = podmiot2KDto.fakturaPodmiotNDto;
|
|
19
|
+
const podmiot1DaneKontaktowe = (0, PDF_functions_1.getTable)(podmiot1.DaneKontaktowe);
|
|
20
|
+
const podmiot1K = podmiot2KDto.podmiot2KDto;
|
|
21
|
+
const result = (0, PDF_functions_1.createHeader)(`Podmiot inny ${index + 1}`);
|
|
22
|
+
if ((0, PDF_functions_1.hasValue)(podmiot1.NrEORI) ||
|
|
23
|
+
(0, PDF_functions_1.hasValue)(podmiot1.Rola) ||
|
|
24
|
+
(0, PDF_functions_1.hasValue)(podmiot1.OpisRoli) ||
|
|
25
|
+
(0, PDF_functions_1.hasValue)(podmiot1 === null || podmiot1 === void 0 ? void 0 : podmiot1.Udzial)) {
|
|
26
|
+
result.push(...(0, PDF_functions_1.createHeader)('Dane identyfikacyjne'), (0, PDF_functions_1.createLabelText)('Numer EORI: ', podmiot1.NrEORI), (0, PDF_functions_1.createLabelText)('Rola: ', (0, functions_1.getRolaString)(podmiot1.Rola, 3)), (0, PDF_functions_1.createLabelText)('Rola inna: ', podmiot1.OpisRoli), (0, PDF_functions_1.createLabelText)('Udział: ', podmiot1.Udzial, common_enum_1.default.Currency6));
|
|
27
|
+
}
|
|
28
|
+
if (podmiot1DaneKontaktowe.length > 0 || (0, PDF_functions_1.hasValue)(podmiot1.NrKlienta)) {
|
|
29
|
+
result.push((0, PodmiotDaneKontaktowe_1.generateDaneKontaktowe)((_a = podmiot1.DaneKontaktowe) !== null && _a !== void 0 ? _a : []));
|
|
30
|
+
result.push((0, PDF_functions_1.createLabelText)('Numer klienta: ', podmiot1.NrKlienta));
|
|
31
|
+
}
|
|
32
|
+
const columns1 = [
|
|
33
|
+
...(0, PDF_functions_1.createHeader)('Treść korygowana'),
|
|
34
|
+
(0, PDF_functions_1.createLabelText)('Identyfikator nabywcy: ', podmiot1K === null || podmiot1K === void 0 ? void 0 : podmiot1K.IDNabywcy),
|
|
35
|
+
];
|
|
36
|
+
if (podmiot1K === null || podmiot1K === void 0 ? void 0 : podmiot1K.DaneIdentyfikacyjne) {
|
|
37
|
+
columns1.push((0, PodmiotDaneIdentyfikacyjneTPodmiot2Dto_1.generateDaneIdentyfikacyjneTPodmiot2Dto)(podmiot1K.DaneIdentyfikacyjne));
|
|
38
|
+
}
|
|
39
|
+
if (podmiot1K === null || podmiot1K === void 0 ? void 0 : podmiot1K.Adres) {
|
|
40
|
+
columns1.push((0, PodmiotAdres_1.generatePodmiotAdres)(podmiot1K.Adres));
|
|
41
|
+
}
|
|
42
|
+
const columns2 = [
|
|
43
|
+
...(0, PDF_functions_1.createHeader)('Treść korygująca'),
|
|
44
|
+
(0, PDF_functions_1.createLabelText)('Identyfikator nabywcy: ', podmiot1 === null || podmiot1 === void 0 ? void 0 : podmiot1.IDNabywcy),
|
|
45
|
+
];
|
|
46
|
+
if (podmiot1 === null || podmiot1 === void 0 ? void 0 : podmiot1.DaneIdentyfikacyjne) {
|
|
47
|
+
columns2.push((0, PodmiotDaneIdentyfikacyjneTPodmiot2Dto_1.generateDaneIdentyfikacyjneTPodmiot2Dto)(podmiot1.DaneIdentyfikacyjne));
|
|
48
|
+
}
|
|
49
|
+
if (podmiot1 === null || podmiot1 === void 0 ? void 0 : podmiot1.Adres) {
|
|
50
|
+
columns2.push((0, PodmiotAdres_1.generatePodmiotAdres)(podmiot1.Adres));
|
|
51
|
+
}
|
|
52
|
+
if (podmiot1.AdresKoresp != null) {
|
|
53
|
+
columns2.push((0, PodmiotAdres_1.generatePodmiotAdres)(podmiot1.AdresKoresp, 'Adres korespondencyjny'));
|
|
54
|
+
}
|
|
55
|
+
result.push((0, PDF_functions_1.generateTwoColumns)(columns1, columns2));
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generatePodmiotAdres = generatePodmiotAdres;
|
|
4
|
+
const PDF_functions_1 = require("../../../shared/PDF-functions");
|
|
5
|
+
const Adres_1 = require("./Adres");
|
|
6
|
+
function generatePodmiotAdres(podmiotAdres, headerTitle = 'Adres', isSubheader = false, headerMargin) {
|
|
7
|
+
if (!podmiotAdres) {
|
|
8
|
+
return [];
|
|
9
|
+
}
|
|
10
|
+
return [
|
|
11
|
+
...(isSubheader ? (0, PDF_functions_1.createSubHeader)(headerTitle, headerMargin) : (0, PDF_functions_1.createHeader)(headerTitle, headerMargin)),
|
|
12
|
+
...(0, Adres_1.generateAdres)(podmiotAdres),
|
|
13
|
+
];
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateDaneIdentyfikacyjneTPodmiot1Dto = generateDaneIdentyfikacyjneTPodmiot1Dto;
|
|
4
|
+
const PDF_functions_1 = require("../../../shared/PDF-functions");
|
|
5
|
+
function generateDaneIdentyfikacyjneTPodmiot1Dto(daneIdentyfikacyjne) {
|
|
6
|
+
return [
|
|
7
|
+
(0, PDF_functions_1.createLabelText)('NIP: ', daneIdentyfikacyjne.NIP),
|
|
8
|
+
(0, PDF_functions_1.createLabelText)('Nazwa: ', daneIdentyfikacyjne.Nazwa),
|
|
9
|
+
];
|
|
10
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.generateDaneIdentyfikacyjneTPodmiot2Dto = generateDaneIdentyfikacyjneTPodmiot2Dto;
|
|
7
|
+
const PDF_functions_1 = require("../../../shared/PDF-functions");
|
|
8
|
+
const common_enum_1 = __importDefault(require("../../../shared/enums/common.enum"));
|
|
9
|
+
function generateDaneIdentyfikacyjneTPodmiot2Dto(daneIdentyfikacyjne) {
|
|
10
|
+
var _a, _b, _c;
|
|
11
|
+
const result = [];
|
|
12
|
+
result.push((0, PDF_functions_1.createLabelText)('NIP: ', daneIdentyfikacyjne.NIP));
|
|
13
|
+
if ((_a = daneIdentyfikacyjne.NrVatUE) === null || _a === void 0 ? void 0 : _a._text) {
|
|
14
|
+
result.push((0, PDF_functions_1.createLabelTextArray)([
|
|
15
|
+
{ value: 'Numer VAT-UE: ', formatTyp: common_enum_1.default.Label },
|
|
16
|
+
{ value: daneIdentyfikacyjne.KodUE, formatTyp: common_enum_1.default.Value },
|
|
17
|
+
{ value: ' ' },
|
|
18
|
+
{ value: daneIdentyfikacyjne.NrVatUE, formatTyp: common_enum_1.default.Value },
|
|
19
|
+
]));
|
|
20
|
+
}
|
|
21
|
+
if ((_b = daneIdentyfikacyjne.KodKraju) === null || _b === void 0 ? void 0 : _b._text) {
|
|
22
|
+
result.push((0, PDF_functions_1.createLabelTextArray)([
|
|
23
|
+
{ value: 'Identyfikator podatkowy inny: ', formatTyp: common_enum_1.default.Label },
|
|
24
|
+
{ value: daneIdentyfikacyjne.KodKraju, formatTyp: common_enum_1.default.Value },
|
|
25
|
+
{ value: ' ' },
|
|
26
|
+
{ value: daneIdentyfikacyjne.NrID, formatTyp: common_enum_1.default.Value },
|
|
27
|
+
]));
|
|
28
|
+
}
|
|
29
|
+
if (((_c = daneIdentyfikacyjne.BrakID) === null || _c === void 0 ? void 0 : _c._text) === '1') {
|
|
30
|
+
result.push((0, PDF_functions_1.formatText)('Brak identyfikatora', common_enum_1.default.Label));
|
|
31
|
+
}
|
|
32
|
+
result.push((0, PDF_functions_1.createLabelText)('Nazwa: ', daneIdentyfikacyjne.Nazwa));
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.generateDaneIdentyfikacyjneTPodmiot3Dto = generateDaneIdentyfikacyjneTPodmiot3Dto;
|
|
7
|
+
const PDF_functions_1 = require("../../../shared/PDF-functions");
|
|
8
|
+
const common_enum_1 = __importDefault(require("../../../shared/enums/common.enum"));
|
|
9
|
+
function generateDaneIdentyfikacyjneTPodmiot3Dto(daneIdentyfikacyjne) {
|
|
10
|
+
var _a;
|
|
11
|
+
if (!daneIdentyfikacyjne) {
|
|
12
|
+
return [];
|
|
13
|
+
}
|
|
14
|
+
const result = [];
|
|
15
|
+
if ((0, PDF_functions_1.hasValue)(daneIdentyfikacyjne.NIP)) {
|
|
16
|
+
result.push((0, PDF_functions_1.createLabelText)('NIP: ', daneIdentyfikacyjne.NIP, common_enum_1.default.Default));
|
|
17
|
+
}
|
|
18
|
+
else if ((0, PDF_functions_1.hasValue)(daneIdentyfikacyjne.IDWew)) {
|
|
19
|
+
result.push((0, PDF_functions_1.createLabelText)('Identyfikator wewnętrzny: ', daneIdentyfikacyjne.IDWew, common_enum_1.default.Default));
|
|
20
|
+
}
|
|
21
|
+
else if ((0, PDF_functions_1.hasValue)(daneIdentyfikacyjne.KodUE)) {
|
|
22
|
+
result.push((0, PDF_functions_1.createLabelTextArray)([
|
|
23
|
+
{ value: 'Numer VAT-UE: ', formatTyp: common_enum_1.default.Label },
|
|
24
|
+
{ value: daneIdentyfikacyjne.KodUE, formatTyp: common_enum_1.default.Default },
|
|
25
|
+
{ value: '' },
|
|
26
|
+
{ value: daneIdentyfikacyjne.NrVatUE, formatTyp: common_enum_1.default.Default },
|
|
27
|
+
]));
|
|
28
|
+
}
|
|
29
|
+
else if ((0, PDF_functions_1.hasValue)(daneIdentyfikacyjne.NrID)) {
|
|
30
|
+
result.push((0, PDF_functions_1.createLabelTextArray)([
|
|
31
|
+
{ value: 'Identyfikator podatkowy inny: ', formatTyp: common_enum_1.default.Label },
|
|
32
|
+
{ value: daneIdentyfikacyjne.KodKraju, formatTyp: common_enum_1.default.Default },
|
|
33
|
+
{ value: '' },
|
|
34
|
+
{ value: daneIdentyfikacyjne.NrID, formatTyp: common_enum_1.default.Default },
|
|
35
|
+
]));
|
|
36
|
+
}
|
|
37
|
+
else if (((_a = daneIdentyfikacyjne.BrakID) === null || _a === void 0 ? void 0 : _a._text) === '1') {
|
|
38
|
+
result.push((0, PDF_functions_1.createLabelText)('Brak identyfikatora', ' ', common_enum_1.default.Default));
|
|
39
|
+
}
|
|
40
|
+
if ((0, PDF_functions_1.hasValue)(daneIdentyfikacyjne.Nazwa)) {
|
|
41
|
+
result.push((0, PDF_functions_1.createLabelText)('Nazwa: ', daneIdentyfikacyjne.Nazwa, common_enum_1.default.Default));
|
|
42
|
+
}
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateDaneKontaktowe = generateDaneKontaktowe;
|
|
4
|
+
const PDF_functions_1 = require("../../../shared/PDF-functions");
|
|
5
|
+
function generateDaneKontaktowe(daneKontaktowe) {
|
|
6
|
+
var _a;
|
|
7
|
+
return (_a = (0, PDF_functions_1.getTable)(daneKontaktowe)) === null || _a === void 0 ? void 0 : _a.map((daneKontaktowe) => {
|
|
8
|
+
return [
|
|
9
|
+
(0, PDF_functions_1.createLabelText)('Email: ', daneKontaktowe.Email),
|
|
10
|
+
(0, PDF_functions_1.createLabelText)('Tel.: ', daneKontaktowe.Telefon),
|
|
11
|
+
];
|
|
12
|
+
});
|
|
13
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generatePodmiotUpowazniony = generatePodmiotUpowazniony;
|
|
4
|
+
const PDF_functions_1 = require("../../../shared/PDF-functions");
|
|
5
|
+
const PodmiotAdres_1 = require("./PodmiotAdres");
|
|
6
|
+
const PodmiotDaneIdentyfikacyjneTPodmiot1Dto_1 = require("./PodmiotDaneIdentyfikacyjneTPodmiot1Dto");
|
|
7
|
+
const PodmiotUpowaznionyDaneKontaktowe_1 = require("./PodmiotUpowaznionyDaneKontaktowe");
|
|
8
|
+
const functions_1 = require("../../../shared/generators/common/functions");
|
|
9
|
+
function generatePodmiotUpowazniony(podmiotUpowazniony) {
|
|
10
|
+
if (!podmiotUpowazniony) {
|
|
11
|
+
return [];
|
|
12
|
+
}
|
|
13
|
+
const result = (0, PDF_functions_1.createHeader)('Podmiot upoważniony');
|
|
14
|
+
if ((0, PDF_functions_1.hasValue)(podmiotUpowazniony.RolaPU)) {
|
|
15
|
+
result.push((0, PDF_functions_1.createLabelText)('Rola: ', (0, functions_1.getRolaUpowaznionegoString)(podmiotUpowazniony.RolaPU, 3)));
|
|
16
|
+
}
|
|
17
|
+
if ((0, PDF_functions_1.hasValue)(podmiotUpowazniony.NrEORI)) {
|
|
18
|
+
result.push((0, PDF_functions_1.createLabelText)('Numer EORI: ', podmiotUpowazniony.NrEORI));
|
|
19
|
+
}
|
|
20
|
+
if (podmiotUpowazniony.DaneIdentyfikacyjne) {
|
|
21
|
+
result.push((0, PodmiotDaneIdentyfikacyjneTPodmiot1Dto_1.generateDaneIdentyfikacyjneTPodmiot1Dto)(podmiotUpowazniony.DaneIdentyfikacyjne));
|
|
22
|
+
}
|
|
23
|
+
result.push([
|
|
24
|
+
...(0, PodmiotAdres_1.generatePodmiotAdres)(podmiotUpowazniony.Adres),
|
|
25
|
+
...(0, PodmiotAdres_1.generatePodmiotAdres)(podmiotUpowazniony.AdresKoresp, 'Adres korespondencyjny'),
|
|
26
|
+
...(0, PodmiotUpowaznionyDaneKontaktowe_1.generatePodmiotUpowaznionyDaneKontaktowe)(podmiotUpowazniony.DaneKontaktowe),
|
|
27
|
+
]);
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.generatePodmiotUpowaznionyDaneKontaktowe = generatePodmiotUpowaznionyDaneKontaktowe;
|
|
7
|
+
const PDF_functions_1 = require("../../../shared/PDF-functions");
|
|
8
|
+
const common_enum_1 = __importDefault(require("../../../shared/enums/common.enum"));
|
|
9
|
+
function generatePodmiotUpowaznionyDaneKontaktowe(daneKontaktoweSource) {
|
|
10
|
+
if (!daneKontaktoweSource) {
|
|
11
|
+
return [];
|
|
12
|
+
}
|
|
13
|
+
const result = [(0, PDF_functions_1.formatText)('Dane kontaktowe', common_enum_1.default.Description)];
|
|
14
|
+
const daneKontaktowe = (0, PDF_functions_1.getTable)(daneKontaktoweSource);
|
|
15
|
+
if (daneKontaktowe.length === 0) {
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
daneKontaktowe.forEach((kontakt) => {
|
|
19
|
+
if ((0, PDF_functions_1.hasValue)(kontakt.EmailPU)) {
|
|
20
|
+
result.push((0, PDF_functions_1.createLabelText)('E-mail: ', kontakt.EmailPU));
|
|
21
|
+
}
|
|
22
|
+
if ((0, PDF_functions_1.hasValue)(kontakt.TelefonPU)) {
|
|
23
|
+
result.push((0, PDF_functions_1.createLabelText)('Tel.: ', kontakt.TelefonPU));
|
|
24
|
+
}
|
|
25
|
+
result.push((0, PDF_functions_1.verticalSpacing)(1));
|
|
26
|
+
});
|
|
27
|
+
return result;
|
|
28
|
+
}
|