69 lines
2.1 KiB
YAML
69 lines
2.1 KiB
YAML
info:
|
|
name: Importo richiesta - Calcolo totale
|
|
type: http
|
|
seq: 3
|
|
|
|
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: "40749"
|
|
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: |-
|
|
// Copy-pasta your EFTL document below inside the template literals (`)
|
|
var eftlDocumentToBeProcessed = bru.setVar("elixBase64EftlDocument", btoa(String.raw`
|
|
[EFTL][HEADER name="trimDocument" value="true" type="boolean" /]
|
|
[% importoTotale = 0; %]
|
|
|
|
[VAR name="imponibile" type="number"][TAG]GETVALUEBYTAG,RICHIESTA_IMPONIBILE,REQUEST,ID_OBJECT[/TAG][/VAR]
|
|
[% importoTotale = importoTotale + imponibile; %]
|
|
|
|
[VAR name="cassaPrevidenzialePercentuale" type="number"][TAG]GETVALUEBYTAG,RICHIESTA_CASSA_PREVIDENZIALE_PERCENTUALE,REQUEST,ID_OBJECT[/TAG][/VAR]
|
|
[% cassaPrevidenziale = imponibile * cassaPrevidenzialePercentuale / 100; %]
|
|
[% importoTotale = importoTotale + cassaPrevidenziale; %]
|
|
|
|
[VAR name="ivaPercentuale" type="number"][TAG]GETVALUEBYTAG,RICHIESTA_IVA_PERCENTUALE,REQUEST,ID_OBJECT[/TAG][/VAR]
|
|
[% iva = imponibile * ivaPercentuale / 100; %]
|
|
[% importoTotale = importoTotale + iva; %]
|
|
|
|
[!--
|
|
--
|
|
IM: [%= imponibile %]
|
|
CP: [%= cassaPrevidenzialePercentuale %]
|
|
CC: [%= cassaPrevidenziale %]
|
|
IP: [%= ivaPercentuale %]
|
|
IV: [%= iva %]
|
|
TT: [%= importoTotale %]
|
|
--
|
|
--]
|
|
|
|
[FORMAT type="number" pattern="#,##0.00"][% importoTotale %][/FORMAT]
|
|
[/EFTL]
|
|
`));
|
|
|
|
settings:
|
|
encodeUrl: true
|
|
timeout: 0
|
|
followRedirects: true
|
|
maxRedirects: 5
|
|
forwardAuthorizationHeader: true
|