Files
Mareon/ax/SRC/FCLT_SetOpdrachtStatus.js
2025-07-21 18:15:45 +00:00

34 lines
1.5 KiB
JavaScript

// --------------------------------------------------------------------------------------
// FCLT_SetOpdrachtStatus.js
// Copyright 2017 SG|facilitor. 053-4800 700, helpdesk@sgfacilitor.nl
// Written by MB (2017)
//
//MARX#89952 Notities in Mareon ook als notitie in Facilitor (en niet meer in afhandeling)
//Wanneer deze functie wordt aangeroepen met een eindstatus als ORDAFM of ORDCAN, dan moet de tekst 'v_extraInfo' in <opmerking>
//In alle andere gevallen, wordt de tekst in <note> naar Facilitor gestuurd.
//PS. ORDAFM verloopt via andere functie FCLT_CompleteServiceTask, maar we houden hier (alvast) rekening mee...
function FCLT_SetOpdrachtStatus(v_company_id, v_taskId, v_externnr, v_status, v_mut_datum, v_extraInfo)
{
var v_API = "MARX_OPDR_STATUS";
var v_req = "<opdracht key=\"" + v_externnr + "\" type=\"update\">"
+ " <status>" + v_status + "</status>";
if (v_extraInfo != ""){
if (v_status == "ORDCAN" || v_status == "ORDAFM")
v_req = v_req + " <opmerking>" + v_extraInfo + "</opmerking>";
else
v_req = v_req + " <note>" + v_extraInfo + "</note>";
}
if (v_mut_datum != ""){
v_req = v_req + "<mut_datum>" + v_mut_datum + "</mut_datum>";
}
v_req = v_req + "</opdracht>";
var v_type = 1;
var v_soapAction = "";
var v_soort_api = 1; // (nav MARX#61048: Documenten versturen van Mareon naar AX) is waarde 1 (oude/huidige api via SupplierService) of waarde 2 (nieuwe api via CustomerPortalAX)
var v_resp = apiAX_GENERAL(v_API, v_req, v_type, v_soapAction, 0, v_soort_api);
return v_resp;
}