PATCH_095.js 1.3 KB

123456789101112131415161718192021222324252627282930
  1. function PATCH_095_FILE_UPLOAD(){
  2. var cbCode = Project.Variables.login_as_cb.Value("participantCode");
  3. let url = "C:\\Users\\vendor_qafusi4\\Documents\\S-INVEST GUI\\S-Invest GUI\\Data Source\\Data Upload\\12. Unit Transaction Subscription\\patch_095_upload_fund_unit_allocation.txt"
  4. var today = new Date();
  5. var dd = String(today.getDate()).padStart(2, '0');//date today
  6. var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
  7. var yyyy = today.getFullYear();
  8. today = yyyy+mm+dd;
  9. let template =
  10. 'transactionDate'+'|'+'transactiontype'+'|'+'cbCode'+'|'+'fundCode'+'|'+'numberOfUnits'+'|'+'NAVperUnit'+'|'+'grossTransactionAmount'+'|'+'transactionFee'+'|'+'netTransactionAmount\n'+
  11. ''+today+'|'+'1'+'|'+cbCode+'|'+'LG002MMSFD844600'+'|'+'379.2249'+'|'+'26105.880000'+'|'+'10000000.00'+'|'+'100000.00'+'|'+'9900000.00'+''
  12. ;
  13. if (aqFile.Create(url) == 0)
  14. {
  15. aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
  16. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  17. }
  18. else
  19. {
  20. aqFile.Delete(url);
  21. if (aqFile.Create(url) == 0)
  22. {
  23. aqFile.WriteToTextFile(url, template, aqFile.ctUTF8);
  24. Log.Message("File dibuat dan teks yang ditentukan berhasil ditulis.");
  25. }
  26. }
  27. }