Upload_Transfer_121.js.bak 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. function transfer121()
  2. {
  3. var registrarCode = Project.Variables.code.Value("codeRegister");
  4. var url = "C:\\Users\\vendor_qafusi2\\Documents\\EBAE Upload\\Upload Transfer 121\\transfer.str";
  5. var zip = "C:\\Users\\vendor_qafusi2\\Documents\\EBAE Upload\\Upload Transfer 121\\transfer.zip";
  6. var account1 = Aliases.browser.pageEBaePtKustodianSentralEfekIn.cell79.innerText;
  7. var account2 = Aliases.browser.pageEBaePtKustodianSentralEfekIn.cell70.innerText;
  8. var securityCode = Project.Variables.code.Value("instrumenLocalCode");
  9. var today = new Date();
  10. var dd = String(today.getDate()).padStart(2, '0');
  11. var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
  12. var yyyy = today.getFullYear();
  13. today = yyyy + mm + dd;
  14. var template =
  15. '<Message>\n'+
  16. '<Record name="data">\n'+
  17. '<Field name="externalReference">ECN013</Field>\n'+
  18. '<Field name="participantCode">'+registrarCode+'</Field>\n'+
  19. '<Field name="sourceAccount">'+account1+'</Field>\n'+
  20. '<Field name="targetAccount">'+account2+'</Field>\n'+
  21. '<Field name="securityCodeType">ISIN</Field>\n'+
  22. '<Field name="securityCode">'+securityCode+'</Field>\n'+
  23. '<Field name="numberOfSecurities">11</Field>\n'+
  24. '<Field name="settlementDate">'+today+'</Field>\n'+
  25. '<Field name="description">Testing</Field>\n'+
  26. '<List name="CertificateList">\n'+
  27. '<Field name="Certificate">ECN013</Field>\n'+
  28. '</List>\n'+
  29. '<Field name="reason">TRAD</Field>\n'+
  30. '</Record>\n'+
  31. '</Message>' ;
  32. if (aqFile.Create(url) == 0)
  33. {
  34. aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
  35. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  36. }
  37. else
  38. {
  39. aqFile.Delete(url);
  40. aqFile.Delete(zip);
  41. if (aqFile.Create(url) == 0)
  42. {
  43. aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
  44. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  45. }
  46. }
  47. }