Built files from Bizgaze WebServer
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

makepayment.js 8.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. var SPRL;
  2. (function (SPRL) {
  3. let Apps;
  4. (function (Apps) {
  5. let Sap;
  6. (function (Sap) {
  7. let Components;
  8. (function (Components) {
  9. class MakePayment extends Unibase.Platform.Core.BaseComponent {
  10. cssFiles() {
  11. return [];
  12. }
  13. jsFiles() {
  14. return [""];
  15. }
  16. html(id, containerid) {
  17. return "";
  18. }
  19. load(id, containerid, callback) {
  20. }
  21. init() {
  22. }
  23. loadhtml() {
  24. return '';
  25. }
  26. listPayment() {
  27. debugger;
  28. var invoiceids = $('.invoiceschk_selected:checkbox:checked').map(function () {
  29. var instance = this;
  30. return Number(instance.value);
  31. }).get();
  32. if (isNaN(invoiceids.length))
  33. invoiceids;
  34. if (isNaN(invoiceids.length))
  35. invoiceids.length = 0;
  36. if (invoiceids.length == null) {
  37. invoiceids.length = 0;
  38. }
  39. let InvoiceIds = invoiceids.join();
  40. var invoiceNo = 101;
  41. var AMT = 100;
  42. var d = new Date();
  43. var datestring = d.getDate() + " " + (d.getMonth() + 1) + " " + d.getFullYear() + " " +
  44. d.getHours() + " " + d.getMinutes() + " " + d.getSeconds();
  45. var rid = datestring.replace(/\s/g, '');
  46. var invoiceDetails = {
  47. RID: rid,
  48. InvoiceNo: InvoiceIds,
  49. CRN: Number(rid) - 1,
  50. AMT: AMT
  51. };
  52. Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/sprl/managers/salesinvoice/sprlpaymentmanager.js", function () {
  53. SPRL.Apps.Sap.Managers.SprlPaymentManager.Instance().makePayment(invoiceDetails).then(function (response) {
  54. if (response.result != null) {
  55. debugger;
  56. var PaymentRequest = response.result.PaymentRequest;
  57. var PaymentEnquiry = response.result.PaymentEnquiry;
  58. Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/core/helpers/cookies/cookiehelper.js", function () {
  59. var prcoockie = "";
  60. Unibase.Platform.Helpers.CookieHelper.Instance().setCookie(12345, PaymentRequest, 1);
  61. var url = window.location.origin + '/apps/sprl/components/salesinvoice/paymentrequest.html';
  62. window.open(url, "_blank");
  63. });
  64. }
  65. });
  66. });
  67. }
  68. makePayment() {
  69. debugger;
  70. var instance = this;
  71. var InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
  72. $(".DetailSetting_" + InstalledAppId + "_MakePayment").click(function () {
  73. var invoiceNo = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_invoiceno").Value;
  74. var AMT = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_totalamount").Value;
  75. var d = new Date();
  76. var datestring = d.getDate() + " " + (d.getMonth() + 1) + " " + d.getFullYear() + " " +
  77. d.getHours() + " " + d.getMinutes() + " " + d.getSeconds();
  78. var rid = datestring.replace(/\s/g, '');
  79. var invoiceDetails = {
  80. RID: rid,
  81. InvoiceNo: invoiceNo,
  82. CRN: Number(rid) - 1,
  83. AMT: AMT
  84. };
  85. var instance = this;
  86. Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/sprl/managers/salesinvoice/sprlpaymentmanager.js", function () {
  87. SPRL.Apps.Sap.Managers.SprlPaymentManager.Instance().makePayment(invoiceDetails).then(function (response) {
  88. if (response.result != null) {
  89. debugger;
  90. var PaymentRequest = response.result.PaymentRequest;
  91. var PaymentEnquiry = response.result.PaymentEnquiry;
  92. Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/core/helpers/cookies/cookiehelper.js", function () {
  93. var prcoockie = "";
  94. Unibase.Platform.Helpers.CookieHelper.Instance().setCookie(12345, PaymentRequest, 1);
  95. var url = window.location.origin + '/apps/sprl/components/salesinvoice/paymentrequest.html';
  96. window.open(url, "_blank");
  97. });
  98. }
  99. });
  100. });
  101. });
  102. }
  103. PaymentStatus(Param) {
  104. var key = "axisbank12345678";
  105. var iParam = Param;
  106. var resultObj = {
  107. Key: key,
  108. i: iParam,
  109. };
  110. Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/sprl/managers/salesinvoice/sprlpaymentmanager.js", function () {
  111. SPRL.Apps.Sap.Managers.SprlPaymentManager.Instance().getPaymentStatus(resultObj).then(function (response) {
  112. if (response.result != null) {
  113. debugger;
  114. var plaintextArr = response.result.split('&');
  115. var dict = {};
  116. for (var i = 0; i <= plaintextArr.length - 1; i++) {
  117. var res = plaintextArr[i].split('=');
  118. dict[res[0]] = res[1];
  119. }
  120. debugger;
  121. var rid = dict + ".RID";
  122. var rmk = dict + ".RMK";
  123. var paymentDetails = {
  124. RID: rid,
  125. RMK: rmk,
  126. };
  127. SPRL.Apps.Sap.Managers.SprlPaymentManager.Instance().updatePaymentStatus(dict).then(function (response) {
  128. if (response.result != null) {
  129. debugger;
  130. }
  131. });
  132. Unibase.Platform.Helpers.CookieHelper.Instance().setCookie(123, response.result, 1);
  133. var url = window.location.origin + '/apps/sprl/components/salesinvoice/paymentstatus.html';
  134. window.open(url, "_self");
  135. }
  136. });
  137. });
  138. }
  139. static Instance() {
  140. if (this.instance === undefined) {
  141. this.instance = new MakePayment();
  142. }
  143. return this.instance;
  144. }
  145. }
  146. Components.MakePayment = MakePayment;
  147. })(Components = Sap.Components || (Sap.Components = {}));
  148. })(Sap = Apps.Sap || (Apps.Sap = {}));
  149. })(Apps = SPRL.Apps || (SPRL.Apps = {}));
  150. })(SPRL || (SPRL = {}));