Files
Mareon/ax/SRC/T_PlanServiceTask.js
2015-01-21 12:41:03 +00:00

54 lines
1.4 KiB
JavaScript

// --------------------------------------------------------------------------------------
// T_PlanServiceTask.js
// Copyright 2014 SG|facilitor. 053-4800 700, helpdesk@sgfacilitor.nl
// Written by MB (2014)
//
// v_company_id is hier dummy, puur uit orthogonaliteit met de AX functie.
// v_bonId is hier de bonid, uit het veld mld_opdr_ordernr.
// v_plandate is de plandatum en heeft formaat yyyy-mm-ddTuu:mm:ss
function T_PlanServiceTask(v_company_id, v_bonId, v_plandate)
{
var l_pos_T;
var l_date;
var l_time;
l_pos_T = v_plandate.indexOf("T");
if (l_pos_T >= 0){
l_date = v_plandate.substr(0, l_pos_T);
l_time = v_plandate.substr(l_pos_T + 1);
}
else {
l_date = v_plandate;
l_time = "";
}
var v_API = "SetPlanDatum";
var v_req = "<tob:string>BonId=" + v_bonId + "</tob:string>"
+ "<tob:string>BonStatus=" + "AannemerPlanning" + "</tob:string>"
+ "<tob:string>PlanDatum=" + l_date + "</tob:string>"
if (l_time != ""){
v_req = v_req + "<tob:string>PlanTijd=" + l_time + "</tob:string>"
}
var v_type = 0;
var v_resp = apiAX(v_API, v_req, v_type);
//if (v_type == 1 && v_resp != "")
// {
// oStream = new ActiveXObject("ADODB.Stream");
// oStream.Open();
// oStream.Type = 1; // adTypeBinary
// oStream.Write(v_resp); // responseText geeft encoding problemen!
// oStream.SaveToFile ("Log/test" + v_supplier_id + ".xml", 2);
// oStream.Close();
// }
return v_resp;
}