123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- var Bizgaze;
- (function (Bizgaze) {
- let Apps;
- (function (Apps) {
- let Transact;
- (function (Transact) {
- let Components;
- (function (Components) {
- let Invoices;
- (function (Invoices) {
- class TcsDeclaration extends Unibase.Platform.Core.BaseComponent {
- jsFiles() {
- return ["platform/forms/components/formviewer/formviewer.js", 'libs/parsley/parsley.min.js', "platform/series/managers/seriesmanager.js", 'apps/transact/managers/invoicemanager.js'];
- }
- cssFiles() {
- return [];
- }
- html() {
- var html = '';
- return html;
- }
- loadhtml(Containerid) {
- 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>';
- $("." + Containerid).html(html);
- }
- load(Containerid) {
- }
- init(Containerid) {
- var jsfiles = ["platform/forms/components/formviewer/formviewer.js", 'libs/parsley/parsley.min.js', "platform/series/managers/seriesmanager.js", 'apps/transact/managers/invoicemanager.js'];
- TcsDeclaration.Instance().fileCacheHelper.loadJsFiles(jsfiles, function () {
- TcsDeclaration.Instance().loadhtml(Containerid);
- $("#btn_Close").click(function () {
- TcsDeclaration.Instance().navigationHelper.closePopUp();
- });
- var tenantname = "";
- Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/invoicemanager.js", function () {
- Bizgaze.Apps.Transact.Managers.InvoiceManager.Instance().GetTenants(Number(Unibase.Platform.Membership.Infos.Identity.getCurrentUser().tenantId)).then(function (res) {
- if (res.result != null) {
- tenantname = res.result.TenantName;
- $("#lblDistributorName1").text(tenantname.toString());
- $("#lblDistributorName2").text(tenantname.toString());
- }
- });
- });
- $("#userName1").text(Unibase.Platform.Membership.Infos.Identity.getCurrentUser().name);
- $("#lblDistributorName1").text(tenantname.toString());
- $("#lblDistributorName2").text(tenantname.toString());
- $("#userName2").text(Unibase.Platform.Membership.Infos.Identity.getCurrentUser().name);
- var TotalDate = new Date();
- var months = ["DECEMBER", "JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER"];
- var cyr = '';
- let fromdate = new Date(Unibase.Platform.Membership.Infos.Identity.getCurrentUser().partitionFromDate).getFullYear();
- let todate = new Date(Unibase.Platform.Membership.Infos.Identity.getCurrentUser().partitionToDate).getFullYear();
- cyr = fromdate + "-" + todate;
- $('#MonthAndYear1').text(cyr);
- $('#CurrentDate').text(Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDate1(new Date(), ""));
- $('#DeclarationMonthI_e_PreviousMonth').text(months[TotalDate.getMonth()]);
- var todayDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate();
- var serverdate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatServerDate(todayDate);
- var OnlyDate = serverdate.split("/");
- TcsDeclaration.Instance().Enable();
- $('#btnSubmit').click(function () {
- TcsDeclaration.Instance().save();
- });
- });
- }
- Enable() {
- var id = Unibase.Platform.Membership.Infos.Identity.getCurrentUser().partitionId;
- Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/invoicemanager.js", function () {
- Bizgaze.Apps.Transact.Managers.InvoiceManager.Instance().getTcsDeclaration(id).then(function (response) {
- if (response.result == null || response.result == "") {
- $("#btnSubmit").removeClass("disabled");
- }
- else {
- $("#btnSubmit").addClass("disabled");
- $("#isSelfDeclared").prop('checked', true);
- $("#isSelfDeclared").prop("disabled", true);
- }
- });
- });
- }
- save() {
- var date = Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate();
- var IsDeclared = $("#isSelfDeclared").prop('checked');
- if (IsDeclared == false) {
- MessageHelper.Instance().showError('Please Check Declaration', 'bizgaze_CreateErrorMessages');
- return false;
- }
- var data = {
- Declared: IsDeclared,
- UserId: Unibase.Platform.Membership.Infos.Identity.getCurrentUser().userId,
- DeclarationDate: new Date(),
- PartitionId: Unibase.Platform.Membership.Infos.Identity.getCurrentUser().partitionId
- };
- Bizgaze.Apps.Transact.Managers.InvoiceManager.Instance().saveTcsDeclaration(data).then(function (response) {
- MessageHelper.Instance().showSuccess(response.message, '');
- $("#isSelfDeclared").prop('checked', true);
- $("#isSelfDeclared").prop("disabled", true);
- $('#btnSubmit').prop('value', 'Submitted');
- $("#btnSubmit").addClass("disabled");
- });
- }
- static Instance() {
- if (this.instance === undefined) {
- this.instance = new TcsDeclaration();
- }
- return this.instance;
- }
- }
- Invoices.TcsDeclaration = TcsDeclaration;
- })(Invoices = Components.Invoices || (Components.Invoices = {}));
- })(Components = Transact.Components || (Transact.Components = {}));
- })(Transact = Apps.Transact || (Apps.Transact = {}));
- })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
- })(Bizgaze || (Bizgaze = {}));
|