diff --git a/collections/elixForms API v2/EFTL processing/CCT - Liquidazione Compensi/Proposta/elixPro - Template Delibera ONLYTABLE.yml b/collections/elixForms API v2/EFTL processing/CCT - Liquidazione Compensi/Proposta/elixPro - Template Delibera ONLYTABLE.yml new file mode 100644 index 0000000..1817c60 --- /dev/null +++ b/collections/elixForms API v2/EFTL processing/CCT - Liquidazione Compensi/Proposta/elixPro - Template Delibera ONLYTABLE.yml @@ -0,0 +1,175 @@ +info: + name: elixPro - Template Delibera ONLYTABLE + type: http + seq: 29 + +http: + method: POST + url: "{{elixFormsApiUrl}}/eftl/process/v1" + headers: + - name: x-requested-with + value: XMLHttpRequest + - name: x-api-key + value: "{{elixFormsWsAuthenticationToken}}" + - name: x-ef-request-id + value: "31630" + disabled: true + - name: x-ef-request-id + value: "31499" + disabled: true + - name: x-ef-request-id + value: "31801" + body: + type: json + data: |- + { + "userDocument": "{{elixBase64EftlDocument}}", // see the pre-request script + "userContext": { + "lang": "IT", + "crlf": "\r\n" + } + } + auth: inherit + +runtime: + scripts: + - type: before-request + code: |- + const { prepareEftlDocument } = require("./elixFormsJs.js") + // Copy-pasta your EFTL document below inside the template literals (`) + prepareEftlDocument(String.raw` + [EFTL] + + [!-- + Codice Fiscale Anno Importo Modalità + RSSNDR76L16I153I 2026 171,46 In orario di lavoro + RSSNDR76L16I153I 2025 514,37 In orario di lavoro + RSSNDR76L16I153I 2024 220,45 In orario di lavoro + RSSNDR76L16I153I 2025 73,48 Fuori orario di lavoro + RSSNDR76L16I153I 2024 122,47 Fuori orario di lavoro + RSSNDR76L16I153I 2023 318,42 Fuori orario di lavoro + LNGSDR63M23L074R 7500 In orario di lavoro + TLTFRC83R30G337R 9.000 Fuori orario di lavoro + LNGSDR63M23L074R 4500 Fuori orario di lavoro + CRSDNL85E53G337Q 870,74 Fuori orario di lavoro + TLTFRC83R30G337R 800 In orario di lavoro + --] + + [VAR name="insertCodiciFiscali" type="string"][TAG]SCHEMAID,862,COL0001,IUQOID, ,##[/TAG][/VAR] + [VAR name="insertImporti" type="string"][TAG]SCHEMAID,862,COL0002,IUQOID, ,##[/TAG][/VAR] + [VAR name="insertAnni" type="string"][TAG]SCHEMAID,862,COL0005,IUQOID, ,##[/TAG][/VAR] + [VAR name="insertModalita" type="string"][TAG]SCHEMAID,862,COL0003,IUQOID, ,##[/TAG][/VAR] + [VAR name="codiciFiscaliIterable" type="iterable"][SPLIT regex="##"][VALUE_OF varname="insertCodiciFiscali" /][/SPLIT][/VAR] + [VAR name="importiIterable" type="iterable"][SPLIT regex="##"][VALUE_OF varname="insertImporti" /][/SPLIT][/VAR] + [VAR name="anniIterable" type="iterable"][SPLIT regex="##"][VALUE_OF varname="insertAnni" /][/SPLIT][/VAR] + [VAR name="modalitaIterable" type="iterable"][SPLIT regex="##"][VALUE_OF varname="insertModalita" /][/SPLIT][/VAR] + [VAR name="insertCount" type="number"][SIZE_OF varname="codiciFiscaliIterable" /][/VAR] + [VAR name="datiRipartizioneIterable" type="iterable"][SPLIT regex="##" emptyIfBlank="true"][TAG]GETVALUEBYTAG,RIPARTIZIONE_DATI_COMPLETI,REQUEST,IUQOID,CONCAT,##[/TAG][/SPLIT][/VAR] + + [VAR name="item1" type="number"][% item1 = 0; %][/VAR] + [VAR name="item2" type="number"][% item2 = 1; %][/VAR] + [VAR name="item3" type="number"][% item3 = 2; %][/VAR] + [VAR name="item4" type="number"][% item4 = 3; %][/VAR] + [VAR name="item5" type="number"][% item5 = 4; %][/VAR] + + + + + + + +

C: [%= insertCodiciFiscali %]

+

I: [%= insertImporti %]

+

A: [%= insertAnni %]

+

M: [%= insertModalita %]

+ + + + + + + + + + [FOR varName="ripartizione" iterable="datiRipartizioneIterable"] + [VAR name="datiIterable" type="iterable"][SPLIT regex=";;" emptyIfBlank="true"][VALUE_OF varname="ripartizione" /][/SPLIT][/VAR] + [VAR name="importoDentro" type="number"][% importoDentro = 0; %][/VAR] + [VAR name="importoFuori" type="number"][% importoFuori = 0; %][/VAR] + + + + + + + + ! + [% insertIdx = 0; %] + [WHILE threshold="99"] + [CONDITION][% insertIdx < insertCount %][/CONDITION] + [DO] + [VAR name="codiceFiscaleCorrente"][VALUE_OF varname="datiIterable" index="item2" /][/VAR] + [VAR name="codiceFiscale"][VALUE_OF varname="codiciFiscaliIterable" index="insertIdx" /][/VAR] + [VAR name="anno"][VALUE_OF varname="anniIterable" index="insertIdx" /][/VAR] + [VAR name="modalita"][VALUE_OF varname="modalitaIterable" index="insertIdx" /][/VAR] + [VAR name="importo"][VALUE_OF varname="importiIterable" index="insertIdx" /][/VAR] + [IF] + [CONDITION][% codiceFiscale == codiceFiscaleCorrente && modalita == "In orario di lavoro" %][/CONDITION] + [THEN] + [VAR name="importoDentro" type="number"][VALUE_OF varname="importiIterable" index="insertIdx" /][/VAR] + ![%= anno %]; [VALUE_OF varname="importo" /] + [/THEN] + [/IF] + [IF] + [CONDITION][% codiceFiscale == codiceFiscaleCorrente && modalita == "Fuori orario di lavoro" %][/CONDITION] + [THEN] + [VAR name="importoFuori" type="number"][VALUE_OF varname="importiIterable" index="insertIdx" /][/VAR] + ![%= anno %]; [VALUE_OF varname="importo" /] + [/THEN] + [/IF] + + [% insertIdx = insertIdx + 1; %] + [/DO] + [/WHILE] + + [/FOR] +
NominativoCodice fiscaleQualificaStrutturaImporto (€)
[VALUE_OF varname="datiIterable" index="item1" /][VALUE_OF varname="datiIterable" index="item2" /][VALUE_OF varname="datiIterable" index="item3" /][VALUE_OF varname="datiIterable" index="item4" /][FORMAT type="number" pattern="#,##0.00"][VALUE_OF varname="datiIterable" index="item5" /][/FORMAT]
[%= codiceFiscaleCorrente %] = [%= codiceFiscale %] and [%= modalita %] per [%= anno %] => [%= importoDentro %]; [%= importoFuori %]
+ + + + + [/EFTL] + `); + - type: after-response + code: |- + var status = res.status; + + if (status !== 200) { + console.log("ERRORE HTTP! Response status code: " + status); + return; + } + + var decodedDocument = ""; + var response = res.getBody(); + + if (response.value.code === "ERROR") { + decodedDocument = "ERRORE EFTL!\n"; + decodedDocument += response.value.description.split("\n").slice(0, 3).join("\n"); + } + else { + decodedDocument = atob(response.value.processedDocument); + } + + bru.visualize('html', { + name: 'HTML', + content: decodedDocument + }); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5