From 75445fbfb5bfaa3841628c0de70b532b8df59879 Mon Sep 17 00:00:00 2001 From: Pier-Paolo Mammi Date: Fri, 6 Mar 2026 12:22:26 +0100 Subject: [PATCH] new: elixFormsAPI - calcolo ore qeuivalenti corretto --- .../Calcolo ore IN o OUT servizio.yml | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 collections/elixForms API v2/EFTL processing/CCT - Liquidazione Compensi/Calcolo ore IN o OUT servizio.yml diff --git a/collections/elixForms API v2/EFTL processing/CCT - Liquidazione Compensi/Calcolo ore IN o OUT servizio.yml b/collections/elixForms API v2/EFTL processing/CCT - Liquidazione Compensi/Calcolo ore IN o OUT servizio.yml new file mode 100644 index 0000000..0191929 --- /dev/null +++ b/collections/elixForms API v2/EFTL processing/CCT - Liquidazione Compensi/Calcolo ore IN o OUT servizio.yml @@ -0,0 +1,58 @@ +info: + name: Calcolo ore IN o OUT servizio + type: http + seq: 25 + +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: "24829" + 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][HEADER name="trimDocument" value="true" type="boolean" /] + [VAR name="tipoAttivita" type="string"][TAG]GETVALUEBYTAG,ATTIVITA_TIPO,REQUEST,IUQOID,UPDATED_LAST[/TAG][/VAR] + [VAR name="oreAttivita" type="string"][TAG]GETVALUEBYTAG,ATTIVITA_ORE,REQUEST,IUQOID,UPDATED_LAST[/TAG][/VAR] + + [VAR name="oreOrarioIn" type="string"][% oreOrarioIn = "0"; %][/VAR] + [VAR name="oreOrarioOut" type="string"][% oreOrarioOut = "0"; %][/VAR] + + [IF] + [CONDITION][% tipoAttivita == "in orario di lavoro" %][/CONDITION] + [THEN][% oreOrarioIn = oreAttivita; %][/THEN] + [ELSE][% oreOrarioOut = oreAttivita; %][/ELSE] + [/IF] + + [%= oreOrarioIn %] + [%= crlf %] + [%= oreOrarioOut %] + [/EFTL] + `); + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5