Files
api-collections/collections/elixForms API v2/EFTL processing/CCT - Liquidazione Compensi/DSAN/Importo richiedente da Proposta ADVANCED.yml
T

68 lines
2.2 KiB
YAML

info:
name: Importo richiedente da Proposta ADVANCED
type: http
seq: 13
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: "31555"
body:
type: json
data: |-
{
"userDocument": "{{elixBase64EftlDocument}}", // see the pre-request script
"userContext": {
"lang": "IT",
"crlf": "\r\n",
"useTestCF": false
}
}
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="codiceFiscaleRichiedente" type="string"][TAG]GETVALUEBYTAG,RICHIEDENTE_CODFIS,REQUEST,IUQOID[/TAG][/VAR]
[VAR name="datiRipartizioniIterable" type="iterable"][SPLIT regex="##"][TAG]GETVALUEBYTAG,RIPARTIZIONE_DATI_COMPLETI,REQUEST,IUQOID,CONCAT,##[/TAG][/SPLIT][/VAR]
[VAR name="item2" type="number"][% item2 = 1; %][/VAR]
[VAR name="item5" type="number"][% item5 = 4; %][/VAR]
[VAR name="importoRichiedente" type="number"][% importoRichiedente = 0; %][/VAR]
[FOR varname="riga" iterable="datiRipartizioniIterable"]
[VAR name="rigaiIterable" type="iterable"][SPLIT regex=";;"][VALUE_OF varname="riga" /][/SPLIT][/VAR]
[VAR name="codiceFiscale" type="string"][VALUE_OF varname="rigaiIterable" index="item2" /][/VAR]
[VAR name="importo" type="number"][VALUE_OF varname="rigaiIterable" index="item5" /][/VAR]
[IF]
[CONDITION][% codiceFiscale == codiceFiscaleRichiedente %][/CONDITION]
[THEN][% importoRichiedente = importo; %][/THEN]
[/IF]
[/FOR]
[FORMAT type="number" pattern="0.00"][% importoRichiedente %][/FORMAT]
[/EFTL]
`);
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
SchemaId 709
Campo COL0118