Upload_instruction_conversion_demat.js.bak 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. function conversion()
  2. {
  3. var registrarCode = Project.Variables.code.Value("codeRegister");
  4. var url = "C:\\Users\\vendor_qafusi2\\Documents\\EBAE Upload\\Upload Conversion Demat\\conv_to_demat.conv";
  5. var zip = "C:\\Users\\vendor_qafusi2\\Documents\\EBAE Upload\\Upload Conversion Demat\\conv_to_demat.zip";
  6. var account = Project.Variables.getAccount1.Value("sid1");
  7. var securityCode = Project.Variables.code.Value("instrumenLocalCode");
  8. var certif4 = Project.Variables.certificate.Value("certif4");
  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">'+certif4+'</Field>\n'+
  18. ' <Field name="participantCode">'+registrarCode+'</Field>\n'+
  19. ' <Field name="account">'+account+'</Field>\n'+
  20. ' <Field name="securityCodeType">LOCAL</Field>\n'+
  21. ' <Field name="securityCode">'+securityCode+'</Field>\n'+
  22. ' <Field name="issuedQuantity">40</Field>\n'+
  23. ' <Field name="settlementDate">'+today+'</Field>\n'+
  24. ' <Field name="issuanceType">DEISSUANCE</Field>\n'+
  25. ' <Field name="certificateNumber">'+certif4+'</Field>\n'+
  26. ' <Field name="shareRanges">61-100</Field>\n'+
  27. ' <Field name="conversionType">DEMAT</Field>\n'+
  28. ' <Field name="cbestAccount">123456789</Field>\n'+
  29. ' <Field name="newCertificateNumber">'+certif4+'</Field>\n'+
  30. ' <Field name="newShareRanges">61-100</Field>\n'+
  31. ' </Record>\n'+
  32. '</Message>' ;
  33. if (aqFile.Create(url) == 0)
  34. {
  35. aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
  36. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  37. }
  38. else
  39. {
  40. aqFile.Delete(url);
  41. aqFile.Delete(zip);
  42. if (aqFile.Create(url) == 0)
  43. {
  44. aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
  45. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  46. }
  47. }
  48. }