This commit is contained in:
2026-03-11 15:50:12 +01:00
3 changed files with 171 additions and 2 deletions
@@ -0,0 +1,111 @@
info:
name: Calcolo dinamico ore equivalenti
type: http
seq: 26
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: "22737"
disabled: true
- name: x-ef-request-id
value: "22224"
disabled: true
- name: x-ef-request-id
value: "24829"
body:
type: json
data: |-
{
"userDocument": "{{elixBase64EftlDocument}}", // see the pre-request script
"userContext": {
"lang": "IT",
"crlf": "\r\n",
"fattoreDivisioneImporto": 1500,
"IS_OP": "OP0",
"IS_CO": "CO0",
"IS_FU": "FU0",
"IS_EP": "EP0",
"OP": 0.0431,
"CO": 0.0405,
"FU": 0.0350,
"EP": 0.0307
}
}
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="codiceRuoloRichiedente" type="string"][TAG]GETVALUEBYTAG,RUOLO_DIPENDENTE,REQUEST,IUQOID[/TAG][/VAR]
[VAR name="codiceFiscaleRichiedente" type="string"][TAG]GETVALUEBYTAG,RICHIEDENTE_CODFIS,REQUEST,IUQOID[/TAG][/VAR]
[VAR name="ripartizioniIterable" type="iterable"][SPLIT regex="#"][TAG]GETVALUEBYTAG,COPPIE_RIPARTIZIONI,REQUEST,IUQOID,CONCAT,#[/TAG][/SPLIT][/VAR]
[VAR name="firstItem" type="number"][% firstItem = 0; %][/VAR]
[VAR name="secondItem" type="number"][% secondItem = 1; %][/VAR]
[VAR name="importoRichiedente" type="number"][% importoRichiedente = 0; %][/VAR]
[VAR name="fattoreConversione" type="number"][% fattoreConversione = OP; %][/VAR]
[FOR varname="coppia" iterable="ripartizioniIterable"]
[VAR name="coppiaIterable" type="iterable"][SPLIT regex=":"][VALUE_OF varname="coppia" /][/SPLIT][/VAR]
[VAR name="codiceFiscale" type="string"][VALUE_OF varname="coppiaIterable" index="firstItem" /][/VAR]
[VAR name="importo" type="number"][VALUE_OF varname="coppiaIterable" index="secondItem" /][/VAR]
[IF]
[CONDITION][% codiceFiscale == codiceFiscaleRichiedente %][/CONDITION]
[THEN][% importoRichiedente = importo; %][/THEN]
[/IF]
[/FOR]
[!--
codiceRuoloRichiedente: [%= codiceRuoloRichiedente %]
codiceFiscaleRichiedente: [%= codiceFiscaleRichiedente %]
importoRichiedente: [%= importoRichiedente %]
fattoreDivisioneImporto: [%= fattoreDivisioneImporto %]
--]
[IF]
[CONDITION][CONTAINS varname="IS_OP"][% codiceRuoloRichiedente %][/CONTAINS][/CONDITION]
[THEN][% fattoreConversione = OP; %][/THEN]
[ELSE IF]
[CONDITION][CONTAINS varname="IS_CO"][% codiceRuoloRichiedente %][/CONTAINS][/CONDITION]
[THEN][% fattoreConversione = CO; %][/THEN]
[/ELSE IF]
[ELSE IF]
[CONDITION][CONTAINS varname="IS_FU"][% codiceRuoloRichiedente %][/CONTAINS][/CONDITION]
[THEN][% fattoreConversione = FU; %][/THEN]
[/ELSE IF]
[ELSE IF]
[CONDITION][CONTAINS varname="IS_EP"][% codiceRuoloRichiedente %][/CONTAINS][/CONDITION]
[THEN][% fattoreConversione = EP; %][/THEN]
[/ELSE IF]
[/IF]
[!--
fattoreConversione: [%= fattoreConversione %]
[%= crlf %]
--]
[VAR name="oreEquivalenti" type="number"][% oreEquivalenti = (importoRichiedente * fattoreConversione); %][/VAR]
[%= oreEquivalenti %]
[/EFTL]
`);
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
@@ -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
@@ -18,7 +18,7 @@ http:
value: "22224" value: "22224"
disabled: true disabled: true
- name: x-ef-request-id - name: x-ef-request-id
value: "23719" value: "24829"
body: body:
type: json type: json
data: |- data: |-
@@ -61,7 +61,7 @@ runtime:
[VAR name="fattore" type="number"][TAG]SCHEMAID,709,COL0120,IUQOID, , ,,0.00000[/TAG][/VAR] [VAR name="fattore" type="number"][TAG]SCHEMAID,709,COL0120,IUQOID, , ,,0.00000[/TAG][/VAR]
[%= importoRichiedente * fattore %] [FORMAT type="number" pattern="integer"][% importoRichiedente * fattore %][/FORMAT]
[/EFTL] [/EFTL]
`); `);