Sambapos and scripting : Jscript, V8, Clearscript

Hi community !

8 years ago I had to code some scripting to generate a special code for the Bolivian tax systems on bills. Their system has changed again and we need to emit electronic bills now connecting to their servers. Why not…

We are in 2023 and I was wondering if their have been some on upgrades on scripting with Sambapos.
When inside Sambapos 5.6.0 I call in :
function GetScriptEngineInfo(){
var s;
s = “”; // Build string with necessary info.
s += ScriptEngine() + " Version ";
s += ScriptEngineMajorVersion() + “.”;
s += ScriptEngineMinorVersion() + “.”;
s += ScriptEngineBuildVersion();
return(s);
}
I get “Jscript Engine 5.8.16384” which is the same version as in Sambapos 5.3.0
so I’d say we are a little bit stuck in the past here…

I am not saying that I won’t be able to make it with Jscript but since Sambapos uses Clearscript and Clearscript is able to handle V8 engine why not take advantage of it ? That would allow us theoretically to use the whole node ecosystem which opens quite a lot of possibilities in terms of integrations and code reusability (besides avoiding me the shame of having to share prehistoric Microsoft Jscript code on github). I am available to help on this, at least for testing and creating code samples.

For those who stumble on this thread looking for Jscript resources here are some links I found.
Jscript helpers:
https://forum.sambapos.com/t/jscript-helpers-and-functions/11966
some more examples with helpers (Emre):
https://forum.sambapos.com/t/v5-feature-compilation/4136/5
using scripts with rules example (not tested):
https://forum.sambapos.com/t/data-export-xml-into-script-to-web/12309/17
using ActiveXObject (oh my god):
https://forum.sambapos.com/t/eftpos-integration/6952/31
Jscript Language Reference (2015):
https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/scripting-articles/hbxc2t98(v=vs.84)

all the best

2 Likes

@VehbiEmiroglu maybe can answer some of this.