PATCH_016.js.bak 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. function xdata(param) {
  2. var randyi = "";
  3. for (ii = 0; ii<= 3; ii++ ) {
  4. randy = Math.floor(Math.random() * (9 - 0));
  5. randyi = randyi + randy.toString();
  6. }
  7. var ktp = "";
  8. for (i = 0; i<= 7; i++ ) {
  9. Rand = Math.floor(Math.random() * (9 - 0));
  10. ktp = ktp + Rand.toString();
  11. }
  12. this.getdata = function datacollection() {
  13. data = [ktp, randyi]
  14. }
  15. }
  16. const dataset = new xdata();
  17. function PATCH_013_GET_FUND_NAME() {
  18. dataset.getdata();
  19. let fund = Aliases.browser.page1011261948080.textnode.shadowroot.textnode7.shadowroot.textbox.Text;
  20. let url = "C:\\Users\\vendor_qafusi4\\Documents\\S-INVEST GUI\\S-Invest GUI\\Data Source\\Data Input\\02. Fund Data Management\\patch_012_fund_registration.txt";
  21. var shortname = 'TF'+data[1];
  22. var descripsi = 'Testing Fund '+aqConvert.DateTimeToFormatStr(aqDateTime.Today(), "%Y%m%d");
  23. var today = new Date();
  24. var closing = new Date();
  25. var dd = String(today.getDate()).padStart(2, '0');//date today
  26. var dd2 = String(today.getDate() + 2).padStart(2, '0');// 2 Hari kemudian
  27. var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
  28. var yyyy = today.getFullYear();
  29. today = yyyy+'-'+mm+'-'+dd;
  30. closing = yyyy+'-'+mm+'-'+dd2;
  31. let template =
  32. 'fundName'+','+'description'+','+'effectiveDate'+','+'closingDate'+','+'ShortNameFund\n'
  33. ''+fund+','+descripsi+','+today+','+closing+','+shortname+''
  34. ;
  35. if (aqFile.Create(url) == 0)
  36. {
  37. aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
  38. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  39. }
  40. else
  41. {
  42. aqFile.Delete(url);
  43. if (aqFile.Create(url) == 0)
  44. {
  45. aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
  46. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  47. }
  48. }
  49. }