Upload_instruction_deissuance.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. function conversion()
  2. {
  3. var registrarCode = Project.Variables.code.Value("codeRegister");
  4. var url = "C:\\Users\\vendor_qafusi2\\Documents\\TestComplete 14 Projects\\EBAE Website\\Automation Testing File\\File upload\\Upload Deissuance\\deissuance.sti";
  5. var zip = "C:\\Users\\vendor_qafusi2\\Documents\\TestComplete 14 Projects\\EBAE Website\\Automation Testing File\\File upload\\Upload Deissuance\\deissuance.zip";
  6. var account = Project.Variables.getAccount1.Value("sid1");
  7. var securityCode = Project.Variables.code.Value("instrumenLocalCode");
  8. var certif8 = Project.Variables.certificate.Value("certif8");
  9. var today = new Date();
  10. var dd = String(today.getDate()).padStart(2, '0');
  11. var mm = String(today.getMonth() + 1).padStart(2, '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">'+certif8+'</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">80</Field>\n'+
  23. '<Field name="settlementDate">'+today+'</Field>\n'+
  24. '<Field name="issuanceType">DEISSUANCE</Field>\n'+
  25. '<Field name="certificateNumber">'+certif8+'</Field>\n'+
  26. '<Field name="shareRanges">281-360</Field>\n'+
  27. '<Field name="shareSeries">B</Field>\n'+
  28. '<Field name="reason">TRAD</Field>\n'+
  29. '</Record>\n'+
  30. '</Message>' ;
  31. if (aqFile.Create(url) == 0)
  32. {
  33. aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
  34. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  35. }
  36. else
  37. {
  38. aqFile.Delete(url);
  39. aqFile.Delete(zip);
  40. if (aqFile.Create(url) == 0)
  41. {
  42. aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
  43. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  44. }
  45. }
  46. }