You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

206 lines
7.0 KiB

  1. function LoadCompliance(dbResult, complianceTable, complianceType) {
  2. var dataToSend = { MethodName: 'complainceList', dbResult: JSON.stringify(dbResult), complianceTable: JSON.stringify(complianceTable), complianceType: complianceType };
  3. $.ajax({
  4. type: "POST",
  5. data: dataToSend,
  6. async: true,
  7. success: function (response) {
  8. var data = jQuery.parseJSON(response);
  9. var c = data.ErrorCode;
  10. var a = c.split('|');
  11. var errorCode = a[0];
  12. var agentRefId = a[1];
  13. ShowCddiData(errorCode, agentRefId, data.Msg, data.Id);
  14. },
  15. fail: function () {
  16. alert("Error fetching data");
  17. }
  18. });
  19. }
  20. function LoadOfacList(dbResult, ofacTable, receiverFullName) {
  21. var dataToSend = { MethodName: 'ofacList', dbResult: JSON.stringify(dbResult), ofacTable: JSON.stringify(ofacTable), receiverFullName: receiverFullName };
  22. $.ajax({
  23. type: "POST",
  24. data: dataToSend,
  25. async: true,
  26. success: function (response) {
  27. },
  28. fail: function () {
  29. alert("Error fetching data");
  30. }
  31. });
  32. }
  33. function ShowDuplicateTxn(tranDetail, duplicateTran, receiverFullName) {
  34. var dataToSend = { MethodName: 'showDuplicateTransaction', dbResult: JSON.stringify(tranDetail), ofacTable: JSON.stringify(duplicateTran) };
  35. $.ajax({
  36. type: "POST",
  37. data: dataToSend,
  38. async: true,
  39. success: function (response) {
  40. },
  41. fail: function () {
  42. alert("Error fetching data");
  43. }
  44. });
  45. }
  46. function ManageMessage(mes, invoicePrintMode) {
  47. alert("Manage");
  48. debugger;
  49. if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
  50. is_mobile = true;
  51. }
  52. window.returnValue = mes + '-:::-' + invoicePrintMode;
  53. if (is_mobile) {
  54. var s = GetBrowserDetails();
  55. if (s.osName == 'iPad' || s.osName == 'iPhone') {
  56. if (s.browserVersion != '0') {
  57. isSafari = true;
  58. isChrome = false;
  59. }
  60. else {
  61. isSafari = false;
  62. isChrome = true;
  63. }
  64. }
  65. if (isSafari) {
  66. window.opener.document.getElementById("confirmHidden").value = mes + '-:::-' + invoicePrintMode;
  67. window.opener.parent.focus();
  68. }
  69. if (isChrome) {
  70. window.opener.document.getElementById("confirmHiddenChrome").value = mes + '-:::-' + invoicePrintMode;
  71. window.opener.document.getElementById("ContentPlaceHolder1_txtPayMsg").focus();
  72. }
  73. window.close();
  74. return true;
  75. }
  76. if (isChrome) {
  77. debugger;
  78. window.opener.focus();
  79. window.opener.PostMessageToParent(window.returnValue);
  80. }
  81. else if (isSafari) {
  82. window.opener.document.getElementById("confirmHidden").value = mes + '-:::-' + invoicePrintMode;
  83. }
  84. window.close();
  85. }
  86. function GetAdditionalCDDIForm(isOnlyVisaStatusQuestionnaire) {
  87. //debugger;
  88. var customerId = $("#" + mId + "hdnCustomerId").val();
  89. $('#additionalCDDI').show();
  90. $('#calc').attr('disabled', true);
  91. $('.infoDiv').css('pointer-events', 'none');
  92. $('.notDisable').css('pointer-events', 'auto');
  93. var dataToSend = { MethodName: 'getAdditionalCDDI', customerId: customerId, IsOnlyVisaStatusQuestionnaire: isOnlyVisaStatusQuestionnaire };
  94. $.ajax({
  95. type: "POST",
  96. data: dataToSend,
  97. async: true,
  98. success: function (response) {
  99. var table = $('#tblComplianceQsn');
  100. table.find("tbody tr").remove();
  101. var result = jQuery.parseJSON(response); //response;
  102. var count = 1;
  103. $.each(result, function (i, d) {
  104. var isRequired = '';
  105. if (d['isRequired'] === 'requiredCompliance')
  106. isRequired = '<span class="ErrMsg">*</span>';
  107. var row = '<tr>';
  108. row += '<td style="display:none">' + d['ID'] + '</td>';
  109. row += '<td>' + count + '</td>';
  110. row += '<td>' + d['QSN'] + ' ' + isRequired + '</td>';
  111. row += '<td width="500px"><input type="text" placeholder="' + d['PlaceHolder'] + '" value="' + d['ANSWER_TEXT'] + '" id="complianceQuestionnare_' + d['ID'] + '" class="form-control ' + d['isRequired'] + '"/></td>';
  112. row += '</tr>';
  113. table.append(row);
  114. count++;
  115. });
  116. },
  117. fail: function () {
  118. $('#calc').attr('disabled', false);
  119. alert("Error fetching data");
  120. }
  121. });
  122. }
  123. function ShowCddiData(errorCode, agentRefId, msg, documentRequired) {
  124. var isOnlyVisaStatusQuestionnaire = 'N';
  125. if (errorCode === "undefined" || errorCode === null || errorCode === "") {
  126. return;
  127. }
  128. else {
  129. // res = id.split('-:::-');
  130. if (errorCode === '1') {
  131. errMsgArr = msg.split('\n');
  132. for (i = 0; i < errMsgArr.length; i++) {
  133. alert(errMsgArr[i]);
  134. }
  135. }
  136. else if (errorCode === '102' || errorCode === '103') {
  137. // alert(res[2]);
  138. alert(' Please fill up the Additional Customer Due Diligence Information (CDDI)');
  139. $('#divHideForVisa').show();
  140. $('#divHideForVisa1').show();
  141. if (errorCode === '102') {
  142. $('#divHideForVisa').hide();
  143. $('#divHideForVisa1').hide();
  144. isOnlyVisaStatusQuestionnaire = 'Y';
  145. }
  146. $("#" + mId + "hddIsAdditionalCDDI").val('Y');
  147. $("#" + mId + "hddAgentRefId").val(agentRefId);
  148. // additional document popup
  149. $("#" + mId + "hdnIsAdditionalDocumentRequired").val(documentRequired);
  150. if (documentRequired === 'Y') { //IS DOCUMENT DEQUIRED
  151. $("#modalAdditionalDocumentRequired").modal('show');
  152. }
  153. GetAdditionalCDDIForm(isOnlyVisaStatusQuestionnaire);
  154. }
  155. else {
  156. // window.location.replace("/AgentNew/SendTxn/SendIntlReceipt.aspx?controlNo=" + res[2] + "&invoicePrint=" + res[3]);
  157. }
  158. }
  159. };
  160. function GetXMLData() { // json data
  161. var tableRows = $('#tblComplianceQsn tr');
  162. var tableData = [];
  163. tableRows.each(function () {
  164. var rowData = {
  165. id: this.cells[0].innerHTML,
  166. answer: $('#complianceQuestionnare_' + this.cells[0].innerHTML).val(),
  167. };
  168. tableData.push(rowData);
  169. });
  170. // console.log(tableData);
  171. return (JSON.stringify(tableData, null, 4));
  172. }
  173. function PopUpWindow(url, param) {
  174. var isChrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
  175. if (param == undefined || param == "") {
  176. param = "dialogHeight:500px;dialogWidth:600px;dialogLeft:300;dialogTop:100;center:yes";
  177. }
  178. if (isChrome) {
  179. window.open(url, "_blank", param);
  180. } else {
  181. return window.showModalDialog(url, window.self, param);
  182. }
  183. //return window.showModalDialog(url, window.self, param); //changed instead of showModalDialog()
  184. }