PATCH_089.js.bak 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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<= 12; 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 xdata2(param1) {
  18. var randy2 = "";
  19. for (ii = 0; ii<= 3; ii++ ) {
  20. randy3 = Math.floor(Math.random() * (9 - 0));
  21. randy2 = randy2 + randy3.toString();
  22. }
  23. var npwp = "";
  24. for (i = 0; i<= 15; i++ ) {
  25. Rand3 = Math.floor(Math.random() * (9 - 0));
  26. npwp = npwp + Rand3.toString();
  27. }
  28. this.getdata = function datacollection() {
  29. data2 = [npwp, randy2]
  30. }
  31. }
  32. const dataset1 = new xdata2();
  33. function checkCode() {
  34. for (i = 0; i <= 10; i++){
  35. if (Aliases.PTW.dlg.btnOK.Exists) {
  36. Aliases.PTW.dlg.btnOK.ClickButton();
  37. let wizardControl2_1 = Aliases.PTW.Wizard2.WizardControl2;
  38. let panel = wizardControl2_1.panel2;
  39. panel.panelLeft.panelStepLabels.CondicoLabel3.Click(29, 11);
  40. Delay(2000)
  41. condicoPlainTextBox.SetText(generateCode());
  42. Delay(2000)
  43. wizardControl2_1.kryptonGroupButtons.tableLayoutPanel2.flowLayoutPanel2.tableLayoutPanel1.btnFinish.ClickButton();
  44. Delay(15000)
  45. }else {
  46. break;
  47. }
  48. }
  49. }
  50. function generateCode(randyi) {
  51. var randyi = "";
  52. for (ii = 0; ii<= 3; ii++ ) {
  53. randy = Math.floor(Math.random() * (9 - 0));
  54. randyi = randyi + randy.toString();
  55. }
  56. randyi = "T"+randyi;
  57. return randyi;
  58. }
  59. function PATCH_001_SA_PART_I(){
  60. Rand1 = Math.floor(Math.random() * (9 - 0));
  61. dataset.getdata();
  62. dataset1.getdata();
  63. }
  64. function PATCH_089_UPLOAD_SUBSCRIPTION() {
  65. let url = "C:\\Users\\vendor_qafusi4\\Documents\\S-INVEST GUI\\S-Invest GUI\\Data Source\\Data Upload\\12. Unit Transaction Subscription\\patch_089_upload_subscription_transaction.txt";
  66. var saCode = Project.Variables.login_as_sa.Value("participantCodeSA");
  67. var reference = 'Testing Subscription '+aqConvert.DateTimeToFormatStr(aqDateTime.Today(), "%Y%m%d");
  68. var today = new Date();
  69. var dd = String(today.getDate()).padStart(2, '0');//date today
  70. var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
  71. var yyyy = today.getFullYear();
  72. today = yyyy+mm+dd;
  73. let template =
  74. 'transactionDate'+'|'+'transactionType'+'|'+'saCode'+'|'+'investorFundUnitA/CNo.'+'|'+'fundCode'+'|'+'amount(Nominal)'+'|'+'amount(Unit)'+'|'+'amount(AllUnits)'+'|'+'fee(Nominal)'+'|'+'fee(Unit)'+'|'+'fee(%)'+'|'+'redmPaymentA/CSequentialCode'+'|'+'redmPaymentBankBICCode'+'|'+'redmPaymentBankBIMemberCode'+'|'+'redmPaymentA/CNo.'+'|'+'paymentDate'+'|'+'transferType'+'|'+'taReferenceNo.\n'+
  75. ''+today+'|'+'1'+'|'+saCode+'|'+'TMS69000CKUF0120'+'|'+'LG002MMSFD844600'+'|'+'10000000.00'+'|'+''+'|'+''+'|'+'100000.00'+'|'+''+'|'+''+'|'+''+'|'+''+'|'+''+'|'+''+'|'+''+'|'+''+'|'+reference+''
  76. ;
  77. if (aqFile.Create(url) == 0)
  78. {
  79. aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
  80. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  81. }
  82. else
  83. {
  84. aqFile.Delete(url);
  85. if (aqFile.Create(url) == 0)
  86. {
  87. aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
  88. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  89. }
  90. }
  91. }