Files
Mareon/ax/SRC/A_UpdatePurchStatus.js
Marcel Bourseau b150688e51 MARX#62647: Koppeling AX365 - Mareon (Push)
svn path=/Mareon/trunk/; revision=47788
2020-08-14 15:31:25 +00:00

40 lines
1.7 KiB
JavaScript

// --------------------------------------------------------------------------------------
// A_updatePurchStatus.js
// Copyright 2019 Facilitor. 053-4800 700, helpdesk@facilitor.nl
// Written by MB (2019)
//
function A_UpdatePurchStatus(v_company_id, v_statuscode, v_purchId, v_extraInfo, v_dateTime)
{
v_resp = "";
if (G_mar_communicatielogboek == 1){
// Alleen als het communicatielogboek bij de klant is ingericht kunnen/mogen deze calls worden uitgevoerd!
var v_API = "updatePurchStatus";
v_datum_xml = "";
if (v_dateTime == "-1"){
// met v_dateTime gelijk aan -1 willen we de datumtime xml niet opnemen in de request!
v_datum_xml = "";
}
else{
if (v_dateTime == ""){
// AX kan niet tegen een lege datum, brrrr, we spreken af dat 1900-01-01 wordt gestuurd (zonder Z!)
v_dateTime = "1900-01-01T00:00:00";
}
// en anders wordt in de request wel een datum-xml gedeelte meegestuurd...
v_datum_xml = "<dateTime>" + v_dateTime + "</dateTime>"
}
v_req = '<updatePurchStatus xmlns="http://tempuri.org/"><companyId>' + v_company_id + "</companyId><statusCode>" + v_statuscode + "</statusCode><purchId>" + v_purchId + "</purchId><extraInfo>" + v_extraInfo + "</extraInfo>" + v_datum_xml + "</updatePurchStatus>";
v_type = 0;
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)
v_resp = apiAX_GENERAL(v_API, v_req, v_type,v_soapAction, 0, v_soort_api);
}
else {
__Log("GEEN Communicatielogboek",2);
}
return v_resp;
}