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.

tcsdeclaration.js 8.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. var Bizgaze;
  2. (function (Bizgaze) {
  3. let Apps;
  4. (function (Apps) {
  5. let Transact;
  6. (function (Transact) {
  7. let Components;
  8. (function (Components) {
  9. let Invoices;
  10. (function (Invoices) {
  11. class TcsDeclaration extends Unibase.Platform.Core.BaseComponent {
  12. jsFiles() {
  13. return ["platform/forms/components/formviewer/formviewer.js", 'libs/parsley/parsley.min.js', "platform/series/managers/seriesmanager.js", 'apps/transact/managers/invoicemanager.js'];
  14. }
  15. cssFiles() {
  16. return [];
  17. }
  18. html() {
  19. var html = '';
  20. return html;
  21. }
  22. loadhtml(Containerid) {
  23. var html = '<form data-validate="parsley" data-isdynamic="false"><div class="card"><div class="card-header"><h3 class="text-center" style ="color:deepskyblue"><u>TCS - Declaration</u></h3 ></div><div style="overflow-x:hidden;" class="d modal-body bg-light"><div class="bg-white mb-10"><div id="bizgaze_CreateErrorMessages" class="clear"></div><div class="col-md-12" style ="height:300px; border:1px solid pink"><h4><p>I, <b><span id="userName1"></span></b> on behalf of <b><span id="lblDistributorName1"></span></b> hereby, declare that <b><span id="lblDistributorName2"></span></b> turnover has crossed the threshold of 10Cr INR, for the year of <b><span id= "MonthAndYear1"></span></b><br/><br/><br/> Name: <b><span id="userName2"></span></b><br/> Date: <b><span id="CurrentDate"></span></b><br/><br/></p></h4><span><b>Note: </b> TCS-declaration for a year can be done when turnover crossed the threshold of 10Cr INR<br/><br/><input type="checkbox" style ="width:30px;height:14px;" id="isSelfDeclared"> <span></span> Yes, I declare <span id="DeclarationMonthI_e_PreviousMonth" class="hidden"></span> <br/><br/></span><div class="text-center"><a href="javascript:;" id="btnSubmit" class="btn btn-primary btn-md">Submit</a></div></div></div></div></form>';
  24. $("." + Containerid).html(html);
  25. }
  26. load(Containerid) {
  27. }
  28. init(Containerid) {
  29. var jsfiles = ["platform/forms/components/formviewer/formviewer.js", 'libs/parsley/parsley.min.js', "platform/series/managers/seriesmanager.js", 'apps/transact/managers/invoicemanager.js'];
  30. TcsDeclaration.Instance().fileCacheHelper.loadJsFiles(jsfiles, function () {
  31. TcsDeclaration.Instance().loadhtml(Containerid);
  32. $("#btn_Close").click(function () {
  33. TcsDeclaration.Instance().navigationHelper.closePopUp();
  34. });
  35. var tenantname = "";
  36. Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/invoicemanager.js", function () {
  37. Bizgaze.Apps.Transact.Managers.InvoiceManager.Instance().GetTenants(Number(Unibase.Platform.Membership.Infos.Identity.getCurrentUser().tenantId)).then(function (res) {
  38. if (res.result != null) {
  39. tenantname = res.result.TenantName;
  40. $("#lblDistributorName1").text(tenantname.toString());
  41. $("#lblDistributorName2").text(tenantname.toString());
  42. }
  43. });
  44. });
  45. $("#userName1").text(Unibase.Platform.Membership.Infos.Identity.getCurrentUser().name);
  46. $("#lblDistributorName1").text(tenantname.toString());
  47. $("#lblDistributorName2").text(tenantname.toString());
  48. $("#userName2").text(Unibase.Platform.Membership.Infos.Identity.getCurrentUser().name);
  49. var TotalDate = new Date();
  50. var months = ["DECEMBER", "JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER"];
  51. var cyr = '';
  52. let fromdate = new Date(Unibase.Platform.Membership.Infos.Identity.getCurrentUser().partitionFromDate).getFullYear();
  53. let todate = new Date(Unibase.Platform.Membership.Infos.Identity.getCurrentUser().partitionToDate).getFullYear();
  54. cyr = fromdate + "-" + todate;
  55. $('#MonthAndYear1').text(cyr);
  56. $('#CurrentDate').text(Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDate1(new Date(), ""));
  57. $('#DeclarationMonthI_e_PreviousMonth').text(months[TotalDate.getMonth()]);
  58. var todayDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate();
  59. var serverdate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatServerDate(todayDate);
  60. var OnlyDate = serverdate.split("/");
  61. TcsDeclaration.Instance().Enable();
  62. $('#btnSubmit').click(function () {
  63. TcsDeclaration.Instance().save();
  64. });
  65. });
  66. }
  67. Enable() {
  68. var id = Unibase.Platform.Membership.Infos.Identity.getCurrentUser().partitionId;
  69. Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/invoicemanager.js", function () {
  70. Bizgaze.Apps.Transact.Managers.InvoiceManager.Instance().getTcsDeclaration(id).then(function (response) {
  71. if (response.result == null || response.result == "") {
  72. $("#btnSubmit").removeClass("disabled");
  73. }
  74. else {
  75. $("#btnSubmit").addClass("disabled");
  76. $("#isSelfDeclared").prop('checked', true);
  77. $("#isSelfDeclared").prop("disabled", true);
  78. }
  79. });
  80. });
  81. }
  82. save() {
  83. var date = Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate();
  84. var IsDeclared = $("#isSelfDeclared").prop('checked');
  85. if (IsDeclared == false) {
  86. MessageHelper.Instance().showError('Please Check Declaration', 'bizgaze_CreateErrorMessages');
  87. return false;
  88. }
  89. var data = {
  90. Declared: IsDeclared,
  91. UserId: Unibase.Platform.Membership.Infos.Identity.getCurrentUser().userId,
  92. DeclarationDate: new Date(),
  93. PartitionId: Unibase.Platform.Membership.Infos.Identity.getCurrentUser().partitionId
  94. };
  95. Bizgaze.Apps.Transact.Managers.InvoiceManager.Instance().saveTcsDeclaration(data).then(function (response) {
  96. MessageHelper.Instance().showSuccess(response.message, '');
  97. $("#isSelfDeclared").prop('checked', true);
  98. $("#isSelfDeclared").prop("disabled", true);
  99. $('#btnSubmit').prop('value', 'Submitted');
  100. $("#btnSubmit").addClass("disabled");
  101. });
  102. }
  103. static Instance() {
  104. if (this.instance === undefined) {
  105. this.instance = new TcsDeclaration();
  106. }
  107. return this.instance;
  108. }
  109. }
  110. Invoices.TcsDeclaration = TcsDeclaration;
  111. })(Invoices = Components.Invoices || (Components.Invoices = {}));
  112. })(Components = Transact.Components || (Transact.Components = {}));
  113. })(Transact = Apps.Transact || (Apps.Transact = {}));
  114. })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
  115. })(Bizgaze || (Bizgaze = {}));