var resultCode
var bankCheck
var amount
var amountOther
var amountFull


oleObject = new ActiveXObject("SBRFSRV.Server")
ws = WScript.CreateObject('WScript.Shell')

amount = 10000
amountOther = 50000
amountFull = amount + amountOther

oleObject.clear()
oleObject.SParam ("Amount", amountFull)
oleObject.SParam ("AmountOther", amountOther)
resultCode = oleObject.NFun(4027)

bankCheck = oleObject.GParamString("Cheque1251")
resultCheck = "ERRCODE: " + resultCode + "\r\n" + bankCheck
showTextInNotepad(resultCheck)
oleObject.clear()

function showTextInNotepad(text)
{
  filename = (new Date()).valueOf() + "upos_check.txt"
  fso = WScript.CreateObject('Scripting.FileSystemObject')
  file = fso.CreateTextFile(filename)
  file.Write(text)
  file.Close()
  WScript.CreateObject('WScript.Shell').Run("notepad " + filename)
  WScript.Sleep(2000)
  fso.DeleteFile(filename)
}