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

View File

@@ -414,7 +414,7 @@ function A365_Xtractor2AX(v_resp, i, v_deelxml, v_factuur_key)
node_attachment[0].appendChild(newEle); node_attachment[0].appendChild(newEle);
__Log("XML element added to XML",3); __Log("XML element added to XML",3);
} }
} }
} }
var XMLResult = "<?xml version=\"1.0\"?>" + v_deelxml.xml; 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_soapAction = "PreInvoiceService/addPreInvoiceFromXtractor";
var v_resp = apiAX(v_API, v_req, v_type, v_soapAction); var v_resp = apiAX(v_API, v_req, v_type, v_soapAction);
//if (v_resp.search("<response>true</response>") != -1) { var l_marx_api = "ACTION_REF_KEY";
// WriteText2File(G_ax_succeededfolder, xtractFile, "xml", v_req, 1, 1); var l_import_action = "";
//} else { var l_xml = "";
// WriteText2File(G_ax_rejectedfolder, xtractFile, "xml", v_req, 1, 1); var l_extra_omschr = "";
//}
return v_resp;
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;
} }