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.

canceleinvoice.component.js 6.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. var Bizgaze;
  2. (function (Bizgaze) {
  3. let Apps;
  4. (function (Apps) {
  5. let Transact;
  6. (function (Transact) {
  7. let Controls;
  8. (function (Controls) {
  9. let EInvoice;
  10. (function (EInvoice) {
  11. class CancelEInvoice extends Unibase.Platform.Core.BaseComponent {
  12. constructor() {
  13. super(...arguments);
  14. this.g_invoiceid = 0;
  15. }
  16. init(formpropertyid, prop, callback) {
  17. let instance = this;
  18. let jsFiles = ["apps/transact/enums/enum.js", "platform/permission/enums/permission.js", "platform/core/helpers/numberhelper/numberhelper.js", "libs/jquery/pagination/jquery.pagination.js"];
  19. instance.loadControlSettings(prop.ControlJsonText, prop.FormPropertyId);
  20. instance.loadPropertySettings(prop.PropertySettings, prop.FormPropertyId);
  21. }
  22. loadControl(containerid, prop) {
  23. let instance = this;
  24. instance.g_ContainerId = containerid;
  25. }
  26. loadControlSettings(controlsettingjson, formpropertyid) {
  27. debugger;
  28. let instance = this;
  29. instance.g_invoiceid = Number($(".hdn_invoiceid").val());
  30. $("#btnDynamicSave").addClass('hidden');
  31. $("#formFooter").append(`<button type="button" id="btn_CancelEinvoice" style="cursor:pointer" class="btn btn-primary CancelEInvoiceButton btn-sm" >CancelE-Invoice</button>`);
  32. instance.bindevents();
  33. $(".hdn_invoiceid").val(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_invoiceid").Value);
  34. }
  35. bindevents() {
  36. $('#btn_CancelEinvoice').click(function (e) {
  37. bootbox.confirm("Are You Sure You want to Continue", function (result) {
  38. if (result) {
  39. $(`#btnDynamicSave`).click();
  40. }
  41. });
  42. });
  43. }
  44. Refresh() {
  45. var instance = this;
  46. let detailContainer = "#" + Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
  47. var InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
  48. var irn = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_irn").Value;
  49. var signedqrcode = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_signedqrcode").Value;
  50. if (signedqrcode == null || signedqrcode == "") {
  51. $(".DetailSetting_" + InstalledAppId + "_Refresh").removeClass("hidden");
  52. }
  53. else
  54. $(".DetailSetting_" + InstalledAppId + "_Refresh").addClass("hidden");
  55. $(detailContainer).find('.DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_Refresh').click(function () {
  56. Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/invoicemanager.js", function () {
  57. var postdata = {
  58. EInvoice: Unibase.Themes.Providers.DetailHelper.recordId,
  59. };
  60. Bizgaze.Apps.Transact.Managers.InvoiceManager.Instance().RefreshEInvoice(irn).then(function (response) {
  61. if (response.errors == null) {
  62. instance.navigationHelper.loadDetail(Unibase.Themes.Providers.DetailHelper.recordId, Unibase.Themes.Providers.DetailHelper.installedAppId, null);
  63. MessageHelper.Instance().showSuccess(response.message, 'div_message');
  64. }
  65. else {
  66. MessageHelper.Instance().showError(response.message, 'div_message');
  67. }
  68. });
  69. });
  70. });
  71. }
  72. RefreshAll() {
  73. Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/invoicemanager.js", function () {
  74. Bizgaze.Apps.Transact.Managers.InvoiceManager.Instance().RefreshEInvoice("0").then(function (response) {
  75. if (response.errors == null) {
  76. var installedappid = Unibase.Themes.Compact.Components.List.Instance().InstalledAppId;
  77. Unibase.Themes.Compact.Components.Nav.Instance().loadList(installedappid);
  78. MessageHelper.Instance().showSuccess(response.message, 'div_message');
  79. }
  80. else {
  81. MessageHelper.Instance().showError(response.message, 'div_message');
  82. }
  83. });
  84. });
  85. }
  86. loadPropertySettings(propertysettings, formpropertyid) {
  87. let instance = this;
  88. }
  89. bindEditFormDetails(formpropertyid, propval, DocPropertyName) {
  90. return null;
  91. }
  92. static Instance() {
  93. if (this.instance === undefined) {
  94. this.instance = new CancelEInvoice();
  95. }
  96. return this.instance;
  97. }
  98. }
  99. EInvoice.CancelEInvoice = CancelEInvoice;
  100. })(EInvoice = Controls.EInvoice || (Controls.EInvoice = {}));
  101. })(Controls = Transact.Controls || (Transact.Controls = {}));
  102. })(Transact = Apps.Transact || (Apps.Transact = {}));
  103. })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
  104. })(Bizgaze || (Bizgaze = {}));