Built files from Bizgaze WebServer
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.

bankbranchdetails.js 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3. return new (P || (P = Promise))(function (resolve, reject) {
  4. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8. });
  9. };
  10. var Bizgaze;
  11. (function (Bizgaze) {
  12. let Apps;
  13. (function (Apps) {
  14. let CRM;
  15. (function (CRM) {
  16. let Controls;
  17. (function (Controls) {
  18. class BankBranchDetails extends Unibase.Platform.Core.BaseComponent {
  19. init(Id) {
  20. var instance = this;
  21. instance.fileCacheHelper.loadJsFile('apps/crm/companies/managers/companymanager.js', function () {
  22. Bizgaze.Apps.CRM.Companies.Managers.CompanyManager.Instance().getBankBranchDetails(Id).then(function (response) {
  23. var data = response;
  24. $(".labelSection_BankDetails").empty();
  25. var html = '<div class="container"><strong>Bank Details</strong>' +
  26. '<div class="card"><div class="card-body">' + 'Bank Name : ' + response.result.BankName + '<br>' + 'IFSC : ' + response.result.IFSCCode + '<br>' + 'Branch Address : ' + response.result.BranchAddress + '<br>' + 'City Name : ' + response.result.CityName + '<br></div>' +
  27. '</div></div>';
  28. $(".labelSection_BankDetails").append(html);
  29. });
  30. });
  31. }
  32. refreshportlets() {
  33. var instance = this;
  34. var _recordId = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_recordid").Value);
  35. var detailobj = Unibase.Themes.Compact.Components.Details.Instance();
  36. detailobj._recordId = Unibase.Themes.Providers.DetailHelper.recordId;
  37. detailobj._installedAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
  38. detailobj._containerId = $("._bizgaze_detail_container:visible").attr("id");
  39. var idetailObj = detailobj;
  40. detailobj.loadPortlets(idetailObj);
  41. }
  42. Validate() {
  43. var instance = this;
  44. var InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
  45. var newstageid = 0;
  46. var showindex;
  47. instance.fileCacheHelper.loadJsFile('tenants/themes/compact/components/details/details.js', function () {
  48. instance.fileCacheHelper.loadJsFile('apps/crm/contacts/managers/contactmanager.js', function () {
  49. Unibase.Platform.Apps.Managers.StageManager.Instance().getStages(InstalledAppId).then(function (response) {
  50. var index = 100;
  51. for (let x of response.result) {
  52. if (x.StageName == "Submitted to RM" || x.StageName == "LP Submitted to RM") {
  53. newstageid = x.StageId;
  54. }
  55. }
  56. var stagename = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_stagename").Value;
  57. if (stagename == "Customer Initiated" || stagename == "Contact Initiated") {
  58. $("._bizgaze_detail_container:visible").find("#li_DetailSetting_" + InstalledAppId + "_SubmitForApproval").removeClass('hidden');
  59. $("._bizgaze_detail_container:visible").find("#li_DetailSetting_" + InstalledAppId + "_SubmitForLoyality").removeClass('hidden');
  60. $("._bizgaze_detail_container:visible").find("#li_DetailSetting_" + InstalledAppId + "_UpgradetoE-Coupon").addClass('hidden');
  61. }
  62. else if (stagename == "Contact Activated for LP") {
  63. $("._bizgaze_detail_container:visible").find("#li_DetailSetting_" + InstalledAppId + "_SubmitForApproval").addClass('hidden');
  64. $("._bizgaze_detail_container:visible").find("#li_DetailSetting_" + InstalledAppId + "_SubmitForLoyality").addClass('hidden');
  65. $("._bizgaze_detail_container:visible").find("#li_DetailSetting_" + InstalledAppId + "_UpgradetoE-Coupon").removeClass('hidden');
  66. $("._bizgaze_detail_container:visible").find("#li_DetailSetting_" + InstalledAppId + "_UpgradetoE-Coupon").removeClass('hidden');
  67. $("._bizgaze_detail_container:visible").find("#li_DetailSetting_" + InstalledAppId + "_SubmitforE-CouponAndLoyalty").addClass('hidden');
  68. }
  69. else {
  70. $("._bizgaze_detail_container:visible").find("#li_DetailSetting_" + InstalledAppId + "_SubmitForApproval").addClass('hidden');
  71. $("._bizgaze_detail_container:visible").find("#li_DetailSetting_" + InstalledAppId + "_SubmitForLoyality").addClass('hidden');
  72. $("._bizgaze_detail_container:visible").find("#li_DetailSetting_" + InstalledAppId + "_UpgradetoE-Coupon").addClass('hidden');
  73. $("._bizgaze_detail_container:visible").find("#li_DetailSetting_" + InstalledAppId + "_SubmitforE-CouponAndLoyalty").addClass('hidden');
  74. }
  75. var recordid = Unibase.Themes.Providers.DetailHelper.recordId;
  76. $("#DetailSetting_" + InstalledAppId + "_SubmitforE-CouponAndLoyalty").unbind().click(function () {
  77. var data = response;
  78. var stgeid = response.result.filter(function (o) { return o.StageName === "Documents Submited"; })[0].StageId;
  79. Bizgaze.Apps.CRM.Controls.BankBranchDetails.Instance().contactsAddrNStageValidation(stgeid, recordid);
  80. });
  81. $("#DetailSetting_" + InstalledAppId + "_UpgradetoE-Coupon").unbind().click(function () {
  82. var stgeid = response.result.filter(function (o) { return o.StageName === "Documents Submited"; })[0].StageId;
  83. Bizgaze.Apps.CRM.Controls.BankBranchDetails.Instance().contactsAddrNStageValidation(stgeid, recordid);
  84. });
  85. $("#DetailSetting_" + InstalledAppId + "_SubmitForApproval").unbind().click(function () {
  86. Bizgaze.Apps.CRM.Controls.BankBranchDetails.Instance().addressvalidate(newstageid, recordid);
  87. });
  88. $("#DetailSetting_" + InstalledAppId + "_SubmitForLoyality").unbind().click(function () {
  89. return __awaiter(this, void 0, void 0, function* () {
  90. var installedappid = Unibase.Themes.Providers.DetailHelper.installedAppId;
  91. yield Bizgaze.Apps.CRM.Controls.BankBranchDetails.Instance().addressvalidate(newstageid, recordid);
  92. });
  93. });
  94. });
  95. });
  96. });
  97. }
  98. contactstagechange(newstageid, installedappid) {
  99. return __awaiter(this, void 0, void 0, function* () {
  100. var instance = this;
  101. yield Unibase.Themes.Compact.Components.Details.Instance().changeStage(newstageid, installedappid);
  102. instance.navigationHelper.hideLoading();
  103. });
  104. }
  105. addressvalidate(stgeid, recordid) {
  106. debugger;
  107. var instance = this;
  108. Bizgaze.Apps.Crm.Contacts.Managers.ContactManager.Instance().getAddressByContactId(recordid).then(function (res) {
  109. if (res.result != "") {
  110. Bizgaze.Apps.CRM.Controls.BankBranchDetails.Instance().StageChange(stgeid);
  111. }
  112. else {
  113. bootbox.confirm({
  114. message: "Please Create Address",
  115. closeButton: false,
  116. callback: function (result) {
  117. if (result) {
  118. }
  119. }
  120. });
  121. }
  122. instance.navigationHelper.hideLoading();
  123. });
  124. }
  125. contactsAddrNStageValidation(stgeid, recordid) {
  126. Bizgaze.Apps.Crm.Contacts.Managers.ContactManager.Instance().getAddressByContactId(recordid).then(function (res) {
  127. if (res.result != "") {
  128. Bizgaze.Apps.CRM.Controls.BankBranchDetails.Instance().StageChangeByDocumentGroupValidation(stgeid);
  129. }
  130. else {
  131. bootbox.confirm({
  132. message: "Please Create Address",
  133. closeButton: false,
  134. callback: function (result) {
  135. if (result) {
  136. }
  137. }
  138. });
  139. }
  140. });
  141. }
  142. ContactValidate() {
  143. var InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
  144. var newstageid = 0;
  145. var stagename = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_stagestatusname").Value;
  146. if (stagename == "Lead") {
  147. $(".li_DetailSetting_" + InstalledAppId + "_SubmitForApproval").removeClass('hidden');
  148. }
  149. else {
  150. $(".li_DetailSetting_" + InstalledAppId + "_SubmitForApproval").addClass('hidden');
  151. }
  152. }
  153. StageChange(stageid) {
  154. var instance = this;
  155. instance.fileCacheHelper.loadJsFile('platform/core/infos/status.js', function () { });
  156. var recordid = Unibase.Themes.Providers.DetailHelper.recordId;
  157. var installedappid = Unibase.Themes.Providers.DetailHelper.installedAppId;
  158. debugger;
  159. instance.fileCacheHelper.loadJsFile('platform/files/managers/filemanager.js', function () {
  160. debugger;
  161. Unibase.Platform.Files.Managers.FileManager.Instance().validateDocument(recordid, installedappid).then(function (response) {
  162. if (response.status == Unibase.Data.Status.Error) {
  163. bootbox.confirm({
  164. message: response.message,
  165. closeButton: false,
  166. callback: function (result) {
  167. if (result) {
  168. }
  169. }
  170. });
  171. }
  172. else {
  173. instance.fileCacheHelper.loadJsFile('tenants/themes/compact/components/details/details.js', function () {
  174. Unibase.Themes.Compact.Components.Details.Instance().changeStage(stageid, installedappid);
  175. });
  176. }
  177. });
  178. });
  179. }
  180. StageChangeByDocumentGroupValidation(stageid) {
  181. var instance = this;
  182. instance.fileCacheHelper.loadJsFile('platform/core/infos/status.js', function () { });
  183. instance.fileCacheHelper.loadJsFile('platform/files/managers/filemanager.js', function () {
  184. debugger;
  185. var recordid = Unibase.Themes.Providers.DetailHelper.recordId;
  186. var installedappid = Unibase.Themes.Providers.DetailHelper.installedAppId;
  187. Unibase.Platform.Files.Managers.FileManager.Instance().validateDocumentByGroup(recordid, installedappid).then(function (response) {
  188. if (response.status == Unibase.Data.Status.Error) {
  189. var msg = response.message + " has files less than required count.";
  190. bootbox.confirm({
  191. message: msg,
  192. closeButton: false,
  193. callback: function (result) {
  194. if (result) {
  195. }
  196. }
  197. });
  198. }
  199. else {
  200. instance.fileCacheHelper.loadJsFile('tenants/themes/compact/components/details/details.js', function () {
  201. Unibase.Themes.Compact.Components.Details.Instance().changeStage(stageid, installedappid);
  202. });
  203. }
  204. });
  205. });
  206. }
  207. static Instance() {
  208. if (this._instance === undefined)
  209. this._instance = new BankBranchDetails();
  210. return this._instance;
  211. }
  212. }
  213. Controls.BankBranchDetails = BankBranchDetails;
  214. })(Controls = CRM.Controls || (CRM.Controls = {}));
  215. })(CRM = Apps.CRM || (Apps.CRM = {}));
  216. })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
  217. })(Bizgaze || (Bizgaze = {}));