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
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
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.generateFA3 = generateFA3;
|
|
7
|
+
const pdfmake_1 = __importDefault(require("pdfmake/build/pdfmake"));
|
|
8
|
+
const vfs_fonts_1 = __importDefault(require("pdfmake/build/vfs_fonts"));
|
|
9
|
+
const PDF_functions_1 = require("../shared/PDF-functions");
|
|
10
|
+
const const_1 = require("../shared/consts/const");
|
|
11
|
+
const Adnotacje_1 = require("./generators/FA3/Adnotacje");
|
|
12
|
+
const DodatkoweInformacje_1 = require("./generators/FA3/DodatkoweInformacje");
|
|
13
|
+
const Platnosc_1 = require("./generators/FA3/Platnosc");
|
|
14
|
+
const Podmioty_1 = require("./generators/FA3/Podmioty");
|
|
15
|
+
const PodsumowanieStawekPodatkuVat_1 = require("./generators/FA3/PodsumowanieStawekPodatkuVat");
|
|
16
|
+
const Rabat_1 = require("./generators/FA3/Rabat");
|
|
17
|
+
const Szczegoly_1 = require("./generators/FA3/Szczegoly");
|
|
18
|
+
const WarunkiTransakcji_1 = require("./generators/FA3/WarunkiTransakcji");
|
|
19
|
+
const Wiersze_1 = require("./generators/FA3/Wiersze");
|
|
20
|
+
const Zamowienie_1 = require("./generators/FA3/Zamowienie");
|
|
21
|
+
const DaneFaKorygowanej_1 = require("./generators/common/DaneFaKorygowanej");
|
|
22
|
+
const Naglowek_1 = require("./generators/common/Naglowek");
|
|
23
|
+
const Rozliczenie_1 = require("./generators/common/Rozliczenie");
|
|
24
|
+
const Stopka_1 = require("./generators/common/Stopka");
|
|
25
|
+
const invoice_enums_1 = require("./enums/invoice.enums");
|
|
26
|
+
pdfmake_1.default.vfs = vfs_fonts_1.default.vfs;
|
|
27
|
+
function generateFA3(invoice, additionalData) {
|
|
28
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
29
|
+
const isKOR_RABAT = ((_b = (_a = invoice.Fa) === null || _a === void 0 ? void 0 : _a.RodzajFaktury) === null || _b === void 0 ? void 0 : _b._text) == const_1.TRodzajFaktury.KOR && (0, PDF_functions_1.hasValue)((_c = invoice.Fa) === null || _c === void 0 ? void 0 : _c.OkresFaKorygowanej);
|
|
30
|
+
const rabatOrRowsInvoice = isKOR_RABAT ? (0, Rabat_1.generateRabat)(invoice.Fa) : (0, Wiersze_1.generateWiersze)(invoice.Fa);
|
|
31
|
+
const docDefinition = {
|
|
32
|
+
content: [
|
|
33
|
+
...(0, Naglowek_1.generateNaglowek)(invoice.Fa, additionalData, invoice.Zalacznik),
|
|
34
|
+
(0, DaneFaKorygowanej_1.generateDaneFaKorygowanej)(invoice.Fa),
|
|
35
|
+
...(0, Podmioty_1.generatePodmioty)(invoice),
|
|
36
|
+
(0, Szczegoly_1.generateSzczegoly)(invoice.Fa),
|
|
37
|
+
rabatOrRowsInvoice,
|
|
38
|
+
(0, Zamowienie_1.generateZamowienie)((_d = invoice.Fa) === null || _d === void 0 ? void 0 : _d.Zamowienie, invoice_enums_1.ZamowienieKorekta.Order, (_g = (_f = (_e = invoice.Fa) === null || _e === void 0 ? void 0 : _e.P_15) === null || _f === void 0 ? void 0 : _f._text) !== null && _g !== void 0 ? _g : '', (_k = (_j = (_h = invoice.Fa) === null || _h === void 0 ? void 0 : _h.RodzajFaktury) === null || _j === void 0 ? void 0 : _j._text) !== null && _k !== void 0 ? _k : '', (_o = (_m = (_l = invoice.Fa) === null || _l === void 0 ? void 0 : _l.KodWaluty) === null || _m === void 0 ? void 0 : _m._text) !== null && _o !== void 0 ? _o : ''),
|
|
39
|
+
(0, PodsumowanieStawekPodatkuVat_1.generatePodsumowanieStawekPodatkuVat)(invoice),
|
|
40
|
+
(0, Adnotacje_1.generateAdnotacje)((_p = invoice.Fa) === null || _p === void 0 ? void 0 : _p.Adnotacje),
|
|
41
|
+
(0, DodatkoweInformacje_1.generateDodatkoweInformacje)(invoice.Fa),
|
|
42
|
+
(0, Rozliczenie_1.generateRozliczenie)((_q = invoice.Fa) === null || _q === void 0 ? void 0 : _q.Rozliczenie, (_t = (_s = (_r = invoice.Fa) === null || _r === void 0 ? void 0 : _r.KodWaluty) === null || _s === void 0 ? void 0 : _s._text) !== null && _t !== void 0 ? _t : ''),
|
|
43
|
+
(0, Platnosc_1.generatePlatnosc)((_u = invoice.Fa) === null || _u === void 0 ? void 0 : _u.Platnosc),
|
|
44
|
+
(0, WarunkiTransakcji_1.generateWarunkiTransakcji)((_v = invoice.Fa) === null || _v === void 0 ? void 0 : _v.WarunkiTransakcji),
|
|
45
|
+
...(0, Stopka_1.generateStopka)(additionalData, invoice.Stopka, invoice.Naglowek, (_w = invoice.Fa) === null || _w === void 0 ? void 0 : _w.WZ, invoice.Zalacznik),
|
|
46
|
+
],
|
|
47
|
+
...(0, PDF_functions_1.generateStyle)(),
|
|
48
|
+
};
|
|
49
|
+
return pdfmake_1.default.createPdf(docDefinition);
|
|
50
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ZamowienieKorekta = void 0;
|
|
4
|
+
var ZamowienieKorekta;
|
|
5
|
+
(function (ZamowienieKorekta) {
|
|
6
|
+
ZamowienieKorekta["BeforeCorrection"] = "Zam\u00F3wienie przed korekt\u0105";
|
|
7
|
+
ZamowienieKorekta["AfterCorrection"] = "Zam\u00F3wienie po korekcie";
|
|
8
|
+
ZamowienieKorekta["Order"] = "Zam\u00F3wienie";
|
|
9
|
+
})(ZamowienieKorekta || (exports.ZamowienieKorekta = ZamowienieKorekta = {}));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateInvoice = generateInvoice;
|
|
4
|
+
const FA3_generator_1 = require("./FA3-generator");
|
|
5
|
+
const XML_parser_1 = require("../shared/XML-parser");
|
|
6
|
+
async function generateInvoice(xmlString, additionalData) {
|
|
7
|
+
var _a, _b, _c, _d;
|
|
8
|
+
const xml = (0, XML_parser_1.parseXML)(xmlString);
|
|
9
|
+
const wersja = (_d = (_c = (_b = (_a = xml.Faktura) === null || _a === void 0 ? void 0 : _a.Naglowek) === null || _b === void 0 ? void 0 : _b.KodFormularza) === null || _c === void 0 ? void 0 : _c._attributes) === null || _d === void 0 ? void 0 : _d.kodSystemowy;
|
|
10
|
+
let pdf;
|
|
11
|
+
return new Promise(res => {
|
|
12
|
+
switch (wersja) {
|
|
13
|
+
case 'FA (3)':
|
|
14
|
+
pdf = (0, FA3_generator_1.generateFA3)(xml.Faktura, additionalData);
|
|
15
|
+
break;
|
|
16
|
+
}
|
|
17
|
+
pdf.getBase64(result => {
|
|
18
|
+
res(result);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
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.generateAdnotacje = generateAdnotacje;
|
|
7
|
+
exports.generateDostawy = generateDostawy;
|
|
8
|
+
const PDF_functions_1 = require("../../../shared/PDF-functions");
|
|
9
|
+
const common_enum_1 = __importDefault(require("../../../shared/enums/common.enum"));
|
|
10
|
+
const const_1 = require("../../../shared/consts/const");
|
|
11
|
+
function generateAdnotacje(adnotacje) {
|
|
12
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
13
|
+
const result = [];
|
|
14
|
+
let firstColumn = [];
|
|
15
|
+
const secondColumn = [];
|
|
16
|
+
if (adnotacje) {
|
|
17
|
+
const zwolnienie = adnotacje.Zwolnienie;
|
|
18
|
+
if (((_a = zwolnienie === null || zwolnienie === void 0 ? void 0 : zwolnienie.P_19) === null || _a === void 0 ? void 0 : _a._text) === '1') {
|
|
19
|
+
firstColumn.push({
|
|
20
|
+
text: 'Dostawa towarów lub świadczenie usług zwolnionych od podatku na podstawie art. 43 ust. 1, art. 113 ust. 1 i 9 albo przepisów wydanych na podstawie art. 82 ust. 3 lub na podstawie innych przepisów',
|
|
21
|
+
});
|
|
22
|
+
if ((_b = zwolnienie.P_19A) === null || _b === void 0 ? void 0 : _b._text) {
|
|
23
|
+
firstColumn.push((0, PDF_functions_1.createLabelText)('Podstawa zwolnienia od podatku: ', 'Przepis ustawy albo aktu wydanego na podstawie ustawy, na podstawie którego podatnik stosuje zwolnienie od podatku'));
|
|
24
|
+
firstColumn.push((0, PDF_functions_1.createLabelText)('Przepis ustawy albo aktu wydanego na podstawie ustawy: ', zwolnienie.P_19A._text));
|
|
25
|
+
}
|
|
26
|
+
if ((_c = zwolnienie.P_19B) === null || _c === void 0 ? void 0 : _c._text) {
|
|
27
|
+
firstColumn.push((0, PDF_functions_1.createLabelText)('Podstawa zwolnienia od podatku: ', 'Przepis dyrektywy 2006/112/WE, który zwalnia od podatku taką dostawę towarów lub takie świadczenie usług'));
|
|
28
|
+
firstColumn.push((0, PDF_functions_1.createLabelText)('Przepis dyrektywy: ', zwolnienie.P_19B._text));
|
|
29
|
+
}
|
|
30
|
+
if ((_d = zwolnienie.P_19C) === null || _d === void 0 ? void 0 : _d._text) {
|
|
31
|
+
firstColumn.push((0, PDF_functions_1.createLabelText)('Podstawa zwolnienia od podatku: ', 'Inna podstawa prawna wskazującą na to, że dostawa towarów lub świadczenie usług korzysta ze zwolnienia'));
|
|
32
|
+
firstColumn.push((0, PDF_functions_1.createLabelText)('Inna podstawa prawna: ', zwolnienie.P_19C._text));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (((_f = (_e = adnotacje.NoweSrodkiTransportu) === null || _e === void 0 ? void 0 : _e.P_42_5) === null || _f === void 0 ? void 0 : _f._text) === '1' ||
|
|
36
|
+
((_h = (_g = adnotacje.NoweSrodkiTransportu) === null || _g === void 0 ? void 0 : _g.P_42_5) === null || _h === void 0 ? void 0 : _h._text) === '2') {
|
|
37
|
+
let obowiazekVAT = [];
|
|
38
|
+
let value = ' ';
|
|
39
|
+
if (((_j = adnotacje.NoweSrodkiTransportu.P_42_5) === null || _j === void 0 ? void 0 : _j._text) === '1') {
|
|
40
|
+
value = 'Istnieje obowiązek wystawienia dokumentu VAT-22';
|
|
41
|
+
}
|
|
42
|
+
else if (((_k = adnotacje.NoweSrodkiTransportu.P_42_5) === null || _k === void 0 ? void 0 : _k._text) === '2') {
|
|
43
|
+
value = 'Nie istnieje obowiązek wystawienia dokumentu VAT-22';
|
|
44
|
+
}
|
|
45
|
+
obowiazekVAT = [
|
|
46
|
+
...(0, PDF_functions_1.createLabelText)('Wewnątrzwspólnotowe dostawy nowych środków transportu: ', value !== null && value !== void 0 ? value : ''),
|
|
47
|
+
];
|
|
48
|
+
if (obowiazekVAT) {
|
|
49
|
+
firstColumn = [firstColumn, ...obowiazekVAT];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (((_l = adnotacje.P_18A) === null || _l === void 0 ? void 0 : _l._text) === '1') {
|
|
53
|
+
secondColumn.push({ text: 'Mechanizm podzielonej płatności' });
|
|
54
|
+
}
|
|
55
|
+
if (((_m = adnotacje.P_16) === null || _m === void 0 ? void 0 : _m._text) === '1') {
|
|
56
|
+
secondColumn.push({ text: 'Metoda kasowa' });
|
|
57
|
+
}
|
|
58
|
+
if (((_o = adnotacje.P_18) === null || _o === void 0 ? void 0 : _o._text) === '1') {
|
|
59
|
+
secondColumn.push({ text: 'Odwrotne obciążenie' });
|
|
60
|
+
}
|
|
61
|
+
if (((_p = adnotacje.P_23) === null || _p === void 0 ? void 0 : _p._text) === '1') {
|
|
62
|
+
secondColumn.push({ text: 'Procedura trójstronna uproszczona' });
|
|
63
|
+
}
|
|
64
|
+
if (((_r = (_q = adnotacje.PMarzy) === null || _q === void 0 ? void 0 : _q.P_PMarzy) === null || _r === void 0 ? void 0 : _r._text) === '1') {
|
|
65
|
+
let valueMarzy = '';
|
|
66
|
+
if (((_s = adnotacje.PMarzy.P_PMarzy_3_1) === null || _s === void 0 ? void 0 : _s._text) === '1') {
|
|
67
|
+
valueMarzy = 'towary używane';
|
|
68
|
+
}
|
|
69
|
+
else if (((_t = adnotacje.PMarzy.P_PMarzy_3_2) === null || _t === void 0 ? void 0 : _t._text) === '1') {
|
|
70
|
+
valueMarzy = 'dzieła sztuki';
|
|
71
|
+
}
|
|
72
|
+
else if (((_u = adnotacje.PMarzy.P_PMarzy_2) === null || _u === void 0 ? void 0 : _u._text) === '1') {
|
|
73
|
+
valueMarzy = 'biura podróży';
|
|
74
|
+
}
|
|
75
|
+
else if (((_v = adnotacje.PMarzy.P_PMarzy_3_3) === null || _v === void 0 ? void 0 : _v._text) === '1') {
|
|
76
|
+
valueMarzy = 'przedmioty kolekcjonerskie i antyki';
|
|
77
|
+
}
|
|
78
|
+
secondColumn.push((0, PDF_functions_1.createLabelText)('Procedura marży: ', valueMarzy));
|
|
79
|
+
}
|
|
80
|
+
if (((_w = adnotacje.P_17) === null || _w === void 0 ? void 0 : _w._text) === '1') {
|
|
81
|
+
secondColumn.push({ text: 'Samofakturowanie' });
|
|
82
|
+
}
|
|
83
|
+
if (firstColumn.length || secondColumn.length) {
|
|
84
|
+
result.push({ columns: [firstColumn, secondColumn], columnGap: 20 });
|
|
85
|
+
}
|
|
86
|
+
if (result.length) {
|
|
87
|
+
result.unshift((0, PDF_functions_1.verticalSpacing)(1));
|
|
88
|
+
result.unshift((0, PDF_functions_1.createHeader)('Adnotacje'));
|
|
89
|
+
result.unshift((0, PDF_functions_1.verticalSpacing)(1));
|
|
90
|
+
result.push((0, PDF_functions_1.verticalSpacing)(1));
|
|
91
|
+
}
|
|
92
|
+
if (((_y = (_x = adnotacje.NoweSrodkiTransportu) === null || _x === void 0 ? void 0 : _x.P_42_5) === null || _y === void 0 ? void 0 : _y._text) === '1' ||
|
|
93
|
+
((_0 = (_z = adnotacje.NoweSrodkiTransportu) === null || _z === void 0 ? void 0 : _z.P_42_5) === null || _0 === void 0 ? void 0 : _0._text) === '2') {
|
|
94
|
+
result.push(generateDostawy(adnotacje.NoweSrodkiTransportu));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return result;
|
|
98
|
+
}
|
|
99
|
+
function generateDostawy(noweSrodkiTransportu) {
|
|
100
|
+
const nowySrodekTransportu = (0, PDF_functions_1.getTable)(noweSrodkiTransportu.NowySrodekTransportu);
|
|
101
|
+
let tableBody = [];
|
|
102
|
+
const table = {
|
|
103
|
+
table: {
|
|
104
|
+
headerRows: 1,
|
|
105
|
+
widths: [100, '*'],
|
|
106
|
+
body: [],
|
|
107
|
+
},
|
|
108
|
+
layout: const_1.DEFAULT_TABLE_LAYOUT,
|
|
109
|
+
marginTop: 4,
|
|
110
|
+
};
|
|
111
|
+
if (nowySrodekTransportu === null || nowySrodekTransportu === void 0 ? void 0 : nowySrodekTransportu.length) {
|
|
112
|
+
const definedHeader = [
|
|
113
|
+
{ text: 'Data dopuszczenia do użytku', style: common_enum_1.default.GrayBoldTitle },
|
|
114
|
+
{ text: 'Opis', style: common_enum_1.default.GrayBoldTitle },
|
|
115
|
+
];
|
|
116
|
+
tableBody = nowySrodekTransportu.map((item) => {
|
|
117
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
118
|
+
const value = [];
|
|
119
|
+
const anyP22B = (0, PDF_functions_1.hasValue)(item.P_22B) ||
|
|
120
|
+
(0, PDF_functions_1.hasValue)(item.P_22BT) ||
|
|
121
|
+
(0, PDF_functions_1.hasValue)(item.P_22B1) ||
|
|
122
|
+
(0, PDF_functions_1.hasValue)(item.P_22B2) ||
|
|
123
|
+
(0, PDF_functions_1.hasValue)(item.P_22B3) ||
|
|
124
|
+
(0, PDF_functions_1.hasValue)(item.P_22B4);
|
|
125
|
+
const anyP22C = (0, PDF_functions_1.hasValue)(item.P_22C) || (0, PDF_functions_1.hasValue)(item.P_22C1);
|
|
126
|
+
const anyP22D = (0, PDF_functions_1.hasValue)(item.P_22D) || (0, PDF_functions_1.hasValue)(item.P_22D1);
|
|
127
|
+
const anyP22N = (0, PDF_functions_1.hasValue)(item.P_22B1) || (0, PDF_functions_1.hasValue)(item.P_22B2) || (0, PDF_functions_1.hasValue)(item.P_22B3) || (0, PDF_functions_1.hasValue)(item.P_22B4);
|
|
128
|
+
if ((_a = item.P_NrWierszaNST) === null || _a === void 0 ? void 0 : _a._text) {
|
|
129
|
+
value.push(item.P_NrWierszaNST._text);
|
|
130
|
+
}
|
|
131
|
+
if (anyP22B) {
|
|
132
|
+
value.push('Dostawa dotyczy pojazdów lądowych, o których mowa w art. 2 pkt 10 lit. a ustawy');
|
|
133
|
+
}
|
|
134
|
+
else if (anyP22C) {
|
|
135
|
+
value.push('Dostawa dotyczy jednostek pływających, o których mowa w art. 2 pkt 10 lit. b ustawy');
|
|
136
|
+
}
|
|
137
|
+
else if (anyP22D) {
|
|
138
|
+
value.push('Dostawa dotyczy statków powietrznych, o których mowa w art. 2 pkt 10 lit. c ustawy');
|
|
139
|
+
}
|
|
140
|
+
if ((_b = item.DetailsString) === null || _b === void 0 ? void 0 : _b._text) {
|
|
141
|
+
value.push(item.DetailsString._text);
|
|
142
|
+
}
|
|
143
|
+
if (anyP22B || anyP22C || anyP22D) {
|
|
144
|
+
value.push((_h = (_f = (_d = (_c = item.P_22B) === null || _c === void 0 ? void 0 : _c._text) !== null && _d !== void 0 ? _d : (_e = item.P_22C) === null || _e === void 0 ? void 0 : _e._text) !== null && _f !== void 0 ? _f : (_g = item.P_22D) === null || _g === void 0 ? void 0 : _g._text) !== null && _h !== void 0 ? _h : '');
|
|
145
|
+
}
|
|
146
|
+
if ((_j = item.P_22C1) === null || _j === void 0 ? void 0 : _j._text) {
|
|
147
|
+
value.push(`Numer kadłuba nowego środka transportu: ${item.P_22C1._text}`);
|
|
148
|
+
}
|
|
149
|
+
if ((_k = item.P_22D1) === null || _k === void 0 ? void 0 : _k._text) {
|
|
150
|
+
value.push(`Numer fabryczny nowego środka transportu: ${item.P_22D1._text}`);
|
|
151
|
+
}
|
|
152
|
+
if (anyP22N) {
|
|
153
|
+
if ((_l = item.P_22B1) === null || _l === void 0 ? void 0 : _l._text) {
|
|
154
|
+
value.push(`Numer VIN: ${item.P_22B1._text}`);
|
|
155
|
+
}
|
|
156
|
+
if ((_m = item.P_22B2) === null || _m === void 0 ? void 0 : _m._text) {
|
|
157
|
+
value.push(`Numer nadwozia: ${item.P_22B2._text}`);
|
|
158
|
+
}
|
|
159
|
+
if ((_o = item.P_22B3) === null || _o === void 0 ? void 0 : _o._text) {
|
|
160
|
+
value.push(`Numer podwozia: ${item.P_22B3._text}`);
|
|
161
|
+
}
|
|
162
|
+
if ((_p = item.P_22B4) === null || _p === void 0 ? void 0 : _p._text) {
|
|
163
|
+
value.push(`Numer ramy: ${item.P_22B4._text}`);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if ((_q = item.P_22BT) === null || _q === void 0 ? void 0 : _q._text) {
|
|
167
|
+
value.push(item.P_22BT._text);
|
|
168
|
+
}
|
|
169
|
+
return [(0, PDF_functions_1.formatText)((_r = item.P_22A) === null || _r === void 0 ? void 0 : _r._text), { text: value.join('\n') }];
|
|
170
|
+
});
|
|
171
|
+
table.table.body = [[...definedHeader], ...tableBody];
|
|
172
|
+
}
|
|
173
|
+
return tableBody.length ? [table, (0, PDF_functions_1.verticalSpacing)(1)] : [];
|
|
174
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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.generateAdres = generateAdres;
|
|
7
|
+
const PDF_functions_1 = require("../../../shared/PDF-functions");
|
|
8
|
+
const common_enum_1 = __importDefault(require("../../../shared/enums/common.enum"));
|
|
9
|
+
function generateAdres(adres) {
|
|
10
|
+
var _a;
|
|
11
|
+
const result = [];
|
|
12
|
+
if (adres === null || adres === void 0 ? void 0 : adres.AdresL1) {
|
|
13
|
+
result.push((0, PDF_functions_1.formatText)(adres.AdresL1._text, common_enum_1.default.Value));
|
|
14
|
+
}
|
|
15
|
+
if (adres === null || adres === void 0 ? void 0 : adres.AdresL2) {
|
|
16
|
+
result.push((0, PDF_functions_1.formatText)(adres.AdresL2._text, common_enum_1.default.Value));
|
|
17
|
+
}
|
|
18
|
+
if (adres === null || adres === void 0 ? void 0 : adres.KodKraju) {
|
|
19
|
+
result.push((0, PDF_functions_1.formatText)((0, PDF_functions_1.getKraj)((_a = adres.KodKraju._text) !== null && _a !== void 0 ? _a : ''), common_enum_1.default.Value));
|
|
20
|
+
}
|
|
21
|
+
result.push(...(0, PDF_functions_1.createLabelText)('GLN: ', adres.GLN));
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
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.generateDodatkoweInformacje = generateDodatkoweInformacje;
|
|
7
|
+
const PDF_functions_1 = require("../../../shared/PDF-functions");
|
|
8
|
+
const common_enum_1 = __importDefault(require("../../../shared/enums/common.enum"));
|
|
9
|
+
function generateDodatkoweInformacje(faVat) {
|
|
10
|
+
const tpLabel1 = [];
|
|
11
|
+
const tpLabel2 = [];
|
|
12
|
+
if ((0, PDF_functions_1.getValue)(faVat.TP) === '1') {
|
|
13
|
+
tpLabel1.push((0, PDF_functions_1.formatText)('- Istniejące powiązania między nabywcą a dokonującym dostawy towarów lub usługodawcą'));
|
|
14
|
+
tpLabel2.push((0, PDF_functions_1.formatText)('- Faktura, o której mowa w art. 109 ust. 3d ustawy'));
|
|
15
|
+
}
|
|
16
|
+
const zwrotAkcyzyLabel = [];
|
|
17
|
+
if ((0, PDF_functions_1.getValue)(faVat.ZwrotAkcyzy) === '1') {
|
|
18
|
+
zwrotAkcyzyLabel.push((0, PDF_functions_1.formatText)('- Informacja dodatkowa związana ze zwrotem podatku akcyzowego zawartego w cenie oleju napędowego'));
|
|
19
|
+
}
|
|
20
|
+
const labels = [tpLabel1, tpLabel2, zwrotAkcyzyLabel].filter((el) => el.length > 0);
|
|
21
|
+
const table = [
|
|
22
|
+
...(0, PDF_functions_1.createHeader)('Dodatkowe informacje'),
|
|
23
|
+
...labels,
|
|
24
|
+
...generateDodatkowyOpis(faVat.DodatkowyOpis),
|
|
25
|
+
];
|
|
26
|
+
return table.length > 1 ? (0, PDF_functions_1.createSection)(table, true) : [];
|
|
27
|
+
}
|
|
28
|
+
function generateDodatkowyOpis(fakturaZaliczkowaData) {
|
|
29
|
+
var _a;
|
|
30
|
+
if (!fakturaZaliczkowaData) {
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
const fakturaZaliczkowa = (_a = (0, PDF_functions_1.getTable)(fakturaZaliczkowaData)) === null || _a === void 0 ? void 0 : _a.map((item, index) => ({
|
|
34
|
+
...item,
|
|
35
|
+
lp: { _text: index + 1 },
|
|
36
|
+
}));
|
|
37
|
+
const table = (0, PDF_functions_1.createSubHeader)('Dodatkowy opis');
|
|
38
|
+
const fakturaZaliczkowaHeader = [
|
|
39
|
+
{
|
|
40
|
+
name: 'lp',
|
|
41
|
+
title: 'Lp.',
|
|
42
|
+
format: common_enum_1.default.Default,
|
|
43
|
+
width: 'auto',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'NrWiersza',
|
|
47
|
+
title: 'Numer wiersza',
|
|
48
|
+
format: common_enum_1.default.Default,
|
|
49
|
+
width: 'auto',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'Klucz',
|
|
53
|
+
title: 'Rodzaj informacji',
|
|
54
|
+
format: common_enum_1.default.Default,
|
|
55
|
+
width: 'auto',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'Wartosc',
|
|
59
|
+
title: 'Treść informacji',
|
|
60
|
+
format: common_enum_1.default.Default,
|
|
61
|
+
width: '*',
|
|
62
|
+
},
|
|
63
|
+
];
|
|
64
|
+
const tableFakturaZaliczkowa = (0, PDF_functions_1.getContentTable)(fakturaZaliczkowaHeader, fakturaZaliczkowa, '*', [0, 0, 0, 0]);
|
|
65
|
+
if (tableFakturaZaliczkowa.content) {
|
|
66
|
+
table.push(tableFakturaZaliczkowa.content);
|
|
67
|
+
}
|
|
68
|
+
return table;
|
|
69
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
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, _e;
|
|
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 (((_a = platnosc.Zaplacono) === null || _a === void 0 ? void 0 : _a._text) === '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 (((_b = platnosc.ZnacznikZaplatyCzesciowej) === null || _b === void 0 ? void 0 : _b._text) === '1') {
|
|
42
|
+
table.push((0, PDF_functions_1.createLabelText)('Informacja o płatności: ', 'Zapłata częściowa'));
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
table.push((0, PDF_functions_1.createLabelText)('Informacja o płatności: ', 'Brak zapłaty'));
|
|
46
|
+
}
|
|
47
|
+
if ((0, PDF_functions_1.hasValue)(platnosc.FormaPlatnosci)) {
|
|
48
|
+
table.push((0, PDF_functions_1.createLabelText)('Forma płatności: ', (0, functions_1.getFormaPlatnosciString)(platnosc.FormaPlatnosci)));
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
if ((_c = platnosc.OpisPlatnosci) === null || _c === void 0 ? void 0 : _c._text) {
|
|
52
|
+
table.push((0, PDF_functions_1.createLabelText)('Forma płatności: ', 'Płatność inna'));
|
|
53
|
+
table.push((0, PDF_functions_1.createLabelText)('Opis płatności innej: ', platnosc.OpisPlatnosci));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const zaplataCzesciowa = (0, PDF_functions_1.getTable)(platnosc.ZaplataCzesciowa);
|
|
57
|
+
const tableZaplataCzesciowa = (0, PDF_functions_1.getContentTable)(zaplataCzesciowaNaglowek, zaplataCzesciowa, '*');
|
|
58
|
+
const terminPatnosciContent = terminPlatnosci.map((platnosc) => {
|
|
59
|
+
var _a, _b;
|
|
60
|
+
if (!terminPlatnosci.some((termin) => termin.TerminOpis)) {
|
|
61
|
+
return platnosc;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
return {
|
|
65
|
+
...platnosc,
|
|
66
|
+
TerminOpis: {
|
|
67
|
+
_text: `${(_b = (_a = platnosc.Termin) === null || _a === void 0 ? void 0 : _a._text) !== null && _b !== void 0 ? _b : ''}`,
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
const tableTerminPlatnosci = (0, PDF_functions_1.getContentTable)(zaplataCzesciowaHeader, terminPatnosciContent, '*');
|
|
73
|
+
if (zaplataCzesciowa.length > 0 && terminPlatnosci.length > 0) {
|
|
74
|
+
table.push((0, PDF_functions_1.generateTwoColumns)((_d = tableZaplataCzesciowa.content) !== null && _d !== void 0 ? _d : [], (_e = tableTerminPlatnosci.content) !== null && _e !== void 0 ? _e : [], [0, 4, 0, 0]));
|
|
75
|
+
}
|
|
76
|
+
else if (terminPlatnosci.length > 0) {
|
|
77
|
+
if (tableTerminPlatnosci.content) {
|
|
78
|
+
table.push((0, PDF_functions_1.generateTwoColumns)([], tableTerminPlatnosci.content));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else if (zaplataCzesciowa.length > 0 && tableZaplataCzesciowa.content) {
|
|
82
|
+
table.push(tableZaplataCzesciowa.content);
|
|
83
|
+
}
|
|
84
|
+
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')));
|
|
85
|
+
if (platnosc.Skonto) {
|
|
86
|
+
table.push((0, PDF_functions_1.createHeader)('Skonto', [0, 0]));
|
|
87
|
+
table.push((0, PDF_functions_1.createLabelText)('Warunki skonta: ', platnosc.Skonto.WarunkiSkonta));
|
|
88
|
+
table.push((0, PDF_functions_1.createLabelText)('Wysokość skonta: ', platnosc.Skonto.WysokoscSkonta));
|
|
89
|
+
}
|
|
90
|
+
return table;
|
|
91
|
+
}
|
|
@@ -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 Adres_1 = require("./Adres");
|
|
9
|
+
const PodmiotDaneIdentyfikacyjneTPodmiot1Dto_1 = require("./PodmiotDaneIdentyfikacyjneTPodmiot1Dto");
|
|
10
|
+
const PodmiotDaneKontaktowe_1 = require("./PodmiotDaneKontaktowe");
|
|
11
|
+
const common_enum_1 = __importDefault(require("../../../shared/enums/common.enum"));
|
|
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,63 @@
|
|
|
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 Adres_1 = require("./Adres");
|
|
11
|
+
const PodmiotDaneIdentyfikacyjneTPodmiot1Dto_1 = require("./PodmiotDaneIdentyfikacyjneTPodmiot1Dto");
|
|
12
|
+
const PodmiotDaneKontaktowe_1 = require("./PodmiotDaneKontaktowe");
|
|
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
|
+
firstColumn.push((0, PodmiotDaneKontaktowe_1.generateDaneKontaktowe)((0, PDF_functions_1.getTable)(podmiot1.DaneKontaktowe)));
|
|
23
|
+
}
|
|
24
|
+
if (podmiot1.StatusInfoPodatnika) {
|
|
25
|
+
firstColumn.push((0, PDF_functions_1.createLabelText)('Status podatnika: ', podmiot1.StatusInfoPodatnika));
|
|
26
|
+
}
|
|
27
|
+
if (firstColumn.length) {
|
|
28
|
+
result.push({
|
|
29
|
+
columns: [firstColumn, []],
|
|
30
|
+
columnGap: 20,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
firstColumn = generateCorrectedContent(podmiot1K);
|
|
34
|
+
secondColumn = generateCorrectedContent(podmiot1);
|
|
35
|
+
if (podmiot1.AdresKoresp) {
|
|
36
|
+
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));
|
|
37
|
+
}
|
|
38
|
+
if (firstColumn.length || secondColumn.length) {
|
|
39
|
+
result.push({
|
|
40
|
+
columns: [firstColumn, secondColumn],
|
|
41
|
+
columnGap: 20,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
if (result.length) {
|
|
45
|
+
result.push((0, PDF_functions_1.verticalSpacing)(1));
|
|
46
|
+
}
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
function generateCorrectedContent(podmiot) {
|
|
50
|
+
var _a;
|
|
51
|
+
const result = [];
|
|
52
|
+
result.push((0, PDF_functions_1.createHeader)('Treść korygowana'));
|
|
53
|
+
if ((_a = podmiot.PrefiksPodatnika) === null || _a === void 0 ? void 0 : _a._text) {
|
|
54
|
+
result.push((0, PDF_functions_1.createLabelText)('Prefiks VAT: ', podmiot.PrefiksPodatnika));
|
|
55
|
+
}
|
|
56
|
+
if (podmiot.DaneIdentyfikacyjne) {
|
|
57
|
+
result.push(...(0, PodmiotDaneIdentyfikacyjneTPodmiot1Dto_1.generateDaneIdentyfikacyjneTPodmiot1Dto)(podmiot.DaneIdentyfikacyjne));
|
|
58
|
+
}
|
|
59
|
+
if (podmiot.Adres) {
|
|
60
|
+
result.push((0, PDF_functions_1.formatText)('Adres', [common_enum_1.default.Label, common_enum_1.default.LabelMargin]), (0, Adres_1.generateAdres)(podmiot.Adres));
|
|
61
|
+
}
|
|
62
|
+
return result;
|
|
63
|
+
}
|
|
@@ -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.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
|
+
const result = (0, PDF_functions_1.createHeader)('Nabywca');
|
|
14
|
+
result.push((0, PDF_functions_1.createLabelText)('Identyfikator nabywcy: ', podmiot2.IDNabywcy), (0, PDF_functions_1.createLabelText)('NrEORI: ', podmiot2.NrEORI));
|
|
15
|
+
if (podmiot2.DaneIdentyfikacyjne) {
|
|
16
|
+
result.push(...(0, PodmiotDaneIdentyfikacyjneTPodmiot2Dto_1.generateDaneIdentyfikacyjneTPodmiot2Dto)(podmiot2.DaneIdentyfikacyjne));
|
|
17
|
+
}
|
|
18
|
+
if (podmiot2.Adres) {
|
|
19
|
+
result.push((0, PDF_functions_1.formatText)('Adres', [common_enum_1.default.Label, common_enum_1.default.LabelMargin]), (0, Adres_1.generateAdres)(podmiot2.Adres));
|
|
20
|
+
}
|
|
21
|
+
if (podmiot2.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)(podmiot2.AdresKoresp));
|
|
23
|
+
}
|
|
24
|
+
if (podmiot2.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)(podmiot2.DaneKontaktowe), (0, PDF_functions_1.createLabelText)('Numer klienta: ', podmiot2.NrKlienta));
|
|
26
|
+
}
|
|
27
|
+
return result;
|
|
28
|
+
}
|