add eftl on Proposta CCT for titulus dynamic naming

This commit is contained in:
2026-03-24 16:33:48 +01:00
parent 910174145c
commit 5a1f68146b
4 changed files with 240 additions and 2 deletions
@@ -5,13 +5,54 @@ info:
http:
method: GET
url: "{{IdemApiUrl}}/contratto_fs_esteso_ap.php?cod_con=ESPO_S_26_ACC_ACC_EMENDAMENTO2VABORKIDS_01"
url: "{{IdemApiUrl}}/contratto_fs_esteso_ap.php?cod_con=GIUL_F_25_CRCT_RA_MOVYON_01"
params:
- name: cod_con
value: ESPO_S_26_ACC_ACC_EMENDAMENTO2VABORKIDS_01
value: GIUL_F_25_CRCT_RA_MOVYON_01
type: query
auth: inherit
runtime:
scripts:
- type: after-response
code: |-
var jsonData = res.getBody();
var titolo = jsonData.Titolo;
var idContratto = jsonData.Identificativo;
var responsabileProponente = jsonData.responsabile_proponente.cognome + " " + jsonData.responsabile_proponente.nome;
var contraente = jsonData.contraenti_array[0]?.ragione_sociale;
var responsabiliProponenti = "";
for (var i = 0; i < jsonData.Responsabili_array.length; i++)
{
responsabiliProponenti += jsonData.Responsabili_array[i].cognome + " " + jsonData.Responsabili_array[i].nome + ", ";
}
responsabiliProponenti = responsabiliProponenti.slice(0, -2);
var contraenti = "";
for (var i = 0; i < jsonData.contraenti_array.length; i++)
{
contraenti += jsonData.contraenti_array[i].ragione_sociale + ", ";
}
contraenti = contraenti.slice(0, -2);
var titoloFascicolo =
idContratto + " - " +
contraenti + " - " +
responsabiliProponenti + " - " +
titolo;
var oggettoDocumento =
"Proposta di contratto / convenzione - " +
idContratto + " - " +
contraenti + " - " +
responsabiliProponenti + " - " +
titolo;
console.log(titoloFascicolo);
console.log(oggettoDocumento);
settings:
encodeUrl: true
timeout: 0