Upload_instruction_issuance.js.bak 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. function issuance()
  2. {
  3. var registrarCode = Project.Variables.code.Value("codeRegister");
  4. var url = "C:\\Users\\vendor_qafusi2\\Documents\\EBAE Upload\\Upload Issuance\\issuance.sti";
  5. var zip = "C:\\Users\\vendor_qafusi2\\Documents\\EBAE Upload\\Upload Issuance\\issuance.zip";
  6. var account = Project.Variables.getAccount1.Value("sid1");
  7. var securityCode = Project.Variables.code.Value("instrumenLocalCode");
  8. var certif2 = Project.Variables.certificate.Value("certif2");
  9. var certif3 = Project.Variables.certificate.Value("certif3");
  10. var certif4 = Project.Variables.certificate.Value("certif4");
  11. var certif5 = Project.Variables.certificate.Value("certif5");
  12. var certif6 = Project.Variables.certificate.Value("certif6");
  13. var certif7 = Project.Variables.certificate.Value("certif7");
  14. var certif8 = Project.Variables.certificate.Value("certif8");
  15. var certif9 = Project.Variables.certificate.Value("certif9");
  16. var certif10 = Project.Variables.certificate.Value("certif10");
  17. var certif11 = Project.Variables.certificate.Value("certif11");
  18. var today = new Date();
  19. var dd = String(today.getDate()).padStart(2, '0');
  20. var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
  21. var yyyy = today.getFullYear();
  22. today = yyyy + mm + dd;
  23. var template =
  24. '<Message>\n'+
  25. '<Record name="data">\n'+
  26. '<Field name="externalReference">'+certif2+'</Field>\n'+
  27. '<Field name="participantCode">'+registrarCode+'</Field>\n'+
  28. '<Field name="account">'+account+'</Field>\n'+
  29. '<Field name="securityCodeType">LOCAL</Field>\n'+
  30. '<Field name="securityCode">'+securityCode+'</Field>\n'+
  31. '<Field name="issuedQuantity">20</Field>\n'+
  32. '<Field name="settlementDate">'+today+'</Field>\n'+
  33. '<Field name="issuanceType">ISSUANCE</Field>\n'+
  34. '<Field name="certificateNumber">'+certif2+'</Field>\n'+
  35. '<Field name="shareRanges">11-30</Field>\n'+
  36. '<Field name="shareSeries">B</Field>\n'+
  37. '<Field name="reason">ISSU</Field>\n'+
  38. '<Field name="otherMemberCode">9X000</Field>\n'+
  39. '</Record>\n'+
  40. '<Record name="data">\n'+
  41. '<Field name="externalReference">'+certif3+'</Field>\n'+
  42. '<Field name="participantCode">'+registrarCode+'</Field>\n'+
  43. '<Field name="account">'+account+'</Field>\n'+
  44. '<Field name="securityCodeType">LOCAL</Field>\n'+
  45. '<Field name="securityCode">'+securityCode+'</Field>\n'+
  46. '<Field name="issuedQuantity">30</Field>\n'+
  47. '<Field name="settlementDate">'+today+'</Field>\n'+
  48. '<Field name="issuanceType">ISSUANCE</Field>\n'+
  49. '<Field name="certificateNumber">'+certif3+'</Field>\n'+
  50. '<Field name="shareRanges">31-60</Field>\n'+
  51. '<Field name="shareSeries">B</Field>\n'+
  52. '<Field name="reason">ISSU</Field>\n'+
  53. '<Field name="otherMemberCode">9X000</Field>\n'+
  54. '</Record>\n'+
  55. '<Record name="data">\n'+
  56. '<Field name="externalReference">'+certif4+'</Field>\n'+
  57. '<Field name="participantCode">'+registrarCode+'</Field>\n'+
  58. '<Field name="account">'+account+'</Field>\n'+
  59. '<Field name="securityCodeType">LOCAL</Field>\n'+
  60. '<Field name="securityCode">'+securityCode+'</Field>\n'+
  61. '<Field name="issuedQuantity">40</Field>\n'+
  62. '<Field name="settlementDate">'+today+'</Field>\n'+
  63. '<Field name="issuanceType">ISSUANCE</Field>\n'+
  64. '<Field name="certificateNumber">'+certif4+'</Field>\n'+
  65. '<Field name="shareRanges">61-100</Field>\n'+
  66. '<Field name="shareSeries">B</Field>\n'+
  67. '<Field name="reason">ISSU</Field>\n'+
  68. '<Field name="otherMemberCode">9X000</Field>\n'+
  69. '</Record>\n'+
  70. '<Record name="data">\n'+
  71. '<Field name="externalReference">'+certif5+'</Field>\n'+
  72. '<Field name="participantCode">'+registrarCode+'</Field>\n'+
  73. '<Field name="account">'+account+'</Field>\n'+
  74. '<Field name="securityCodeType">LOCAL</Field>\n'+
  75. '<Field name="securityCode">'+securityCode+'</Field>\n'+
  76. '<Field name="issuedQuantity">50</Field>\n'+
  77. '<Field name="settlementDate">'+today+'</Field>\n'+
  78. '<Field name="issuanceType">ISSUANCE</Field>\n'+
  79. '<Field name="certificateNumber">'+certif5+'</Field>\n'+
  80. '<Field name="shareRanges">101-150</Field>\n'+
  81. '<Field name="shareSeries">B</Field>\n'+
  82. '<Field name="reason">ISSU</Field>\n'+
  83. '<Field name="otherMemberCode">9X000</Field>\n'+
  84. '</Record>\n'+
  85. '<Record name="data">\n'+
  86. '<Field name="externalReference">'+certif6+'</Field>\n'+
  87. '<Field name="participantCode">'+registrarCode+'</Field>\n'+
  88. '<Field name="account">'+account+'</Field>\n'+
  89. '<Field name="securityCodeType">LOCAL</Field>\n'+
  90. '<Field name="securityCode">'+securityCode+'</Field>\n'+
  91. '<Field name="issuedQuantity">60</Field>\n'+
  92. '<Field name="settlementDate">'+today+'</Field>\n'+
  93. '<Field name="issuanceType">ISSUANCE</Field>\n'+
  94. '<Field name="certificateNumber">'+certif6+'</Field>\n'+
  95. '<Field name="shareRanges">151-210</Field>\n'+
  96. '<Field name="shareSeries">B</Field>\n'+
  97. '<Field name="reason">ISSU</Field>\n'+
  98. '<Field name="otherMemberCode">9X000</Field>\n'+
  99. '</Record>\n'+
  100. '<Record name="data">\n'+
  101. '<Field name="externalReference">'+certif7+'</Field>\n'+
  102. '<Field name="participantCode">'+registrarCode+'</Field>\n'+
  103. '<Field name="account">'+account+'</Field>\n'+
  104. '<Field name="securityCodeType">LOCAL</Field>\n'+
  105. '<Field name="securityCode">'+securityCode+'</Field>\n'+
  106. '<Field name="issuedQuantity">70</Field>\n'+
  107. '<Field name="settlementDate">'+today+'</Field>\n'+
  108. '<Field name="issuanceType">ISSUANCE</Field>\n'+
  109. '<Field name="certificateNumber">'+certif7+'</Field>\n'+
  110. '<Field name="shareRanges">211-280</Field>\n'+
  111. '<Field name="shareSeries">B</Field>\n'+
  112. '<Field name="reason">ISSU</Field>\n'+
  113. '<Field name="otherMemberCode">9X000</Field>\n'+
  114. '</Record>\n'+
  115. '<Record name="data">\n'+
  116. '<Field name="externalReference">'+certif8+'</Field>\n'+
  117. '<Field name="participantCode">'+registrarCode+'</Field>\n'+
  118. '<Field name="account">'+account+'</Field>\n'+
  119. '<Field name="securityCodeType">LOCAL</Field>\n'+
  120. '<Field name="securityCode">'+securityCode+'</Field>\n'+
  121. '<Field name="issuedQuantity">80</Field>\n'+
  122. '<Field name="settlementDate">'+today+'</Field>\n'+
  123. '<Field name="issuanceType">ISSUANCE</Field>\n'+
  124. '<Field name="certificateNumber">'+certif8+'</Field>\n'+
  125. '<Field name="shareRanges">281-360</Field>\n'+
  126. '<Field name="shareSeries">B</Field>\n'+
  127. '<Field name="reason">ISSU</Field>\n'+
  128. '<Field name="otherMemberCode">9X000</Field>\n'+
  129. '</Record>\n'+
  130. '<Record name="data">\n'+
  131. '<Field name="externalReference">'+certif9+'</Field>\n'+
  132. '<Field name="participantCode">'+registrarCode+'</Field>\n'+
  133. '<Field name="account">'+account+'</Field>\n'+
  134. '<Field name="securityCodeType">LOCAL</Field>\n'+
  135. '<Field name="securityCode">'+securityCode+'</Field>\n'+
  136. '<Field name="issuedQuantity">90</Field>\n'+
  137. '<Field name="settlementDate">'+today+'</Field>\n'+
  138. '<Field name="issuanceType">ISSUANCE</Field>\n'+
  139. '<Field name="certificateNumber">'+certif9+'</Field>\n'+
  140. '<Field name="shareRanges">361-450</Field>\n'+
  141. '<Field name="shareSeries">B</Field>\n'+
  142. '<Field name="reason">ISSU</Field>\n'+
  143. '<Field name="otherMemberCode">9X000</Field>\n'+
  144. '</Record>\n'+
  145. '<Record name="data">\n'+
  146. '<Field name="externalReference">'+certif10+'</Field>\n'+
  147. '<Field name="participantCode">'+registrarCode+'</Field>\n'+
  148. '<Field name="account">'+account+'</Field>\n'+
  149. '<Field name="securityCodeType">LOCAL</Field>\n'+
  150. '<Field name="securityCode">'+securityCode+'</Field>\n'+
  151. '<Field name="issuedQuantity">100</Field>\n'+
  152. '<Field name="settlementDate">'+today+'</Field>\n'+
  153. '<Field name="issuanceType">ISSUANCE</Field>\n'+
  154. '<Field name="certificateNumber">'+certif10+'</Field>\n'+
  155. '<Field name="shareRanges">451-550</Field>\n'+
  156. '<Field name="shareSeries">B</Field>\n'+
  157. '<Field name="reason">ISSU</Field>\n'+
  158. '<Field name="otherMemberCode">9X000</Field>\n'+
  159. '</Record>\n'+
  160. '<Record name="data">\n'+
  161. '<Field name="externalReference">'+certif11+'</Field>\n'+
  162. '<Field name="participantCode">'+registrarCode+'</Field>\n'+
  163. '<Field name="account">'+account+'</Field>\n'+
  164. '<Field name="securityCodeType">LOCAL</Field>\n'+
  165. '<Field name="securityCode">'+securityCode+'</Field>\n'+
  166. '<Field name="issuedQuantity">110</Field>\n'+
  167. '<Field name="settlementDate">'+today+'</Field>\n'+
  168. '<Field name="issuanceType">ISSUANCE</Field>\n'+
  169. '<Field name="certificateNumber">'+certif11+'</Field>\n'+
  170. '<Field name="shareRanges">551-660</Field>\n'+
  171. '<Field name="shareSeries">B</Field>\n'+
  172. '<Field name="reason">ISSU</Field>\n'+
  173. '<Field name="otherMemberCode">9X000</Field>\n'+
  174. '</Record>\n'+
  175. '</Message>' ;
  176. if (aqFile.Create(url) == 0)
  177. {
  178. aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
  179. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  180. }
  181. else
  182. {
  183. aqFile.Delete(url);
  184. aqFile.Delete(zip);
  185. if (aqFile.Create(url) == 0)
  186. {
  187. aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
  188. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  189. }
  190. }
  191. }