MARX#59862: Tobias 365 - Mareon

svn path=/Mareon/trunk/; revision=45194
This commit is contained in:
Marcel Bourseau
2019-12-11 11:10:59 +00:00
parent e7376be1cd
commit 0a469ebeda
3 changed files with 44 additions and 25 deletions

View File

@@ -14,7 +14,12 @@ function FCLT_Sync_START(){
F_PutSync(0);
}
function FCLT_Sync_END(){
if (AX_or_Tobias() == "A365"){
F_PutSync(2);
}
else{
F_PutSync(1);
}
}
// ----------------------------- AX functies -----------------------------------------

View File

@@ -527,10 +527,10 @@ function api2_AX365 (v_Url, v_API, v_req, v_type, v_soapAction)
{
//MARX#57502: AX Adapter robuuster maken: Waarschijnlijk timeout-error
__Log("api2_AX365 failed/timeout: " + e.description,1);
if (G_abort_http_error == 1)
{
MARXQUIT();
}
//if (G_abort_http_error == 1)
//{
// MARXQUIT();
//}
return "";
}
@@ -562,7 +562,7 @@ function api2_AX365 (v_Url, v_API, v_req, v_type, v_soapAction)
__Log(txt,1);
//Voor AX2012 moet Dispose dit niet worden aangeroepen, hangt dan!
//api2AX_Dispose(v_Url, xmlhttp);
return {};
return "";
}
}
else
@@ -588,27 +588,27 @@ function api2_AX365 (v_Url, v_API, v_req, v_type, v_soapAction)
return txt;
}
else{
__Log("api2_AX365: Token problem, maximum van 3 pogingen zijn allemaal mislukt" ,1);
if (G_abort_http_error == 1)
{
MARXQUIT();
}
__Log("api2_AX365: Token problem, maximum van 3 pogingen zijn allemaal mislukt" ,1);
//if (G_abort_http_error == 1)
//{
// MARXQUIT();
//}
return ""
}
}
else{
if (G_abort_http_error == 1)
{
MARXQUIT();
}
//if (G_abort_http_error == 1)
//{
// MARXQUIT();
//}
return ""
}
}
if (G_abort_http_error == 1)
{
MARXQUIT();
}
//if (G_abort_http_error == 1)
//{
// MARXQUIT();
//}
return ""
}
}

View File

@@ -414,7 +414,7 @@ function A365_Xtractor2AX(v_resp, i, v_deelxml, v_factuur_key)
node_attachment[0].appendChild(newEle);
__Log("XML element added to XML",3);
}
}
}
}
var XMLResult = "<?xml version=\"1.0\"?>" + v_deelxml.xml;
@@ -432,11 +432,25 @@ function A365_Xtractor2AX(v_resp, i, v_deelxml, v_factuur_key)
var v_soapAction = "PreInvoiceService/addPreInvoiceFromXtractor";
var v_resp = apiAX(v_API, v_req, v_type, v_soapAction);
//if (v_resp.search("<response>true</response>") != -1) {
// WriteText2File(G_ax_succeededfolder, xtractFile, "xml", v_req, 1, 1);
//} else {
// WriteText2File(G_ax_rejectedfolder, xtractFile, "xml", v_req, 1, 1);
//}
return v_resp;
var l_marx_api = "ACTION_REF_KEY";
var l_import_action = "";
var l_xml = "";
var l_extra_omschr = "";
if (v_resp.search("<response>true</response>") != -1) {
l_import_action = "FIN_FACTUUR_POST_SUCCESS";
l_extra_omschr = "";
__Log("AX365 factuurverwerking succesvol",3);
} else {
l_import_action = "FIN_FACTUUR_POST_FAIL";
l_extra_omschr = v_resp.substr(0, 4000);
__Log("AX365 factuurverwerking NIET succesvol",1);
}
if (l_import_action != ""){
l_xml = "<action><action_code>" + l_import_action + "</action_code>" + "<ref_key>" + v_factuur_key + "</ref_key>" + "<extra_omschr>" + l_extra_omschr + "</extra_omschr></action>";
l_xml = "<xml>" + l_xml + "</xml>";
api_F_PutXML(l_xml, l_marx_api);
}
return v_resp;
}