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.

gstsubmission.min.js 13KB

1
  1. var Bizgaze;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){let i;(function(t){class i extends Unibase.Platform.Core.BaseComponent{jsFiles(){return["apps/integrations/gst/managers/gstmanager.js"]}cssFiles(){return[]}html(){const n=`<div id="gst_Otp" class="modal fade hide"><div class="modal-dialog"><div class="modal-content"><div class="modal-header mt-2 mb-2"><h5 class="modal-title pull-left">OTP</h5><button type="button" class="close pull-right" data-dismiss="modal" aria-hidden="true">&times;</button></div><div class="modal-body" id="div_modalbody"><div class="mb-10"><p class="lbl_Otp">Please Enter The OTP</p></div><div class="floating-label-form-group mb-2"><input class="form-control" id="txt_Otp" placeholder="Enter OTP" type="text"></div></div><div class="modal-footer mb-2" style="display:block"><button type="button" onclick="" class="btn btn-primary pull-right" id="btn_VerifyOtp">Ok</button></div></div></div></div>`;return $("#_bizgaze_modal").append(n),$(".bootbox-input").keypress(function(n){if(n.which!=8&&n.which!=0&&(n.which<48||n.which>57))return MessageHelper.Instance().showSuccess("Numbers only allowed","div_validationsummary"),!1}),n}load(){}saveHSNGSTRtoGSTPortal(n,t,i){var e=this,f;let r="#"+Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length-1],u=$(r).find("input.b2binvoices");f=$(r).find(".b2binvoices:checkbox:checked").map(function(){return $(this).val()}).get();console.log(f);$(r).find("#selectedinvoices_check").click(function(){var n=u.find("input.b2binvoices");n.prop("checked",!n.prop("checked"))});u.click(function(){$(this).is(":checked")?u.is(":checked")&&$("#selectedinvoices_check").prop("checked",!0):$("#selectedinvoices_check").prop("checked",!1)});bootbox.prompt("Please Enter OTP",function(r){r&&(e._saveHSNGSTRtoGSTPortal(n,r,t,i),$(".bootbox-input").keypress(function(n){if(n.which!=8&&n.which!=0&&(n.which<48||n.which>57))return MessageHelper.Instance().showSuccess("Numbers Only Allowed","div_validationsummary"),!1}))})}_saveHSNGSTRtoGSTPortal(t,i,r,u){var e=this,o=Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+Unibase.Themes.Providers.DetailHelper.installedAppId+"_gstintegratorid").Value,s=Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+Unibase.Themes.Providers.DetailHelper.installedAppId+"_returnperiod").Value,h=moment(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+Unibase.Themes.Providers.DetailHelper.installedAppId+"_fromdate").Value).format("YYYY-MM-DD"),f=Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+Unibase.Themes.Providers.DetailHelper.installedAppId+"_todate").Value,c=Unibase.Platform.Helpers.DateTimeHelper.Instance().formatServerDate(f),r,l;f=moment(c).format("YYYY-MM-DD");r=[];$(".invoiceschk_selected:checked").each(function(){var n=$(this).prop("checked");n&&r.push($(this).parents(".body-tr").find(".fromgstno").text())});r=r.filter((n,t)=>r.indexOf(n)==t).toString();l=moment.utc(new Date).local().format("YYYYMMDDHHmmss");const a=$(".invoiceschk_selected:checkbox:checked").map(function(){return $(this).closest(".body-tr").find(".gst-rate").text()}).get(),v=$(".invoiceschk_selected:checkbox:checked").map(function(){return $(this).closest(".body-tr").find(".gst-supplytype").text()}).get(),y=$(".invoiceschk_selected:checkbox:checked").map(function(){return $(this).closest(".body-tr").find(".gst-pos").text()}).get(),p=$(".invoiceschk_selected:checkbox:checked").map(function(){return $(this).closest(".body-tr").find(".gst-hsncodes").text()}).get(),w=$(".invoiceschk_selected:checkbox:checked").map(function(){return $(this).closest(".body-tr").find(".gst-uom").text()}).get();var b=i.replace(" ",""),k=[{TaxclassificationId:t,InvoiceId:[0],Rates:a,SupplyType:v,Pos:y,HSNCodes:p,InvoiceTypeId:u,UoM:w}],d={TaxClassificationData:k,RtPeriod:s,GSTIntegratorId:o,ToDate:f,FromDate:h,InvoiceTypeId:1,GstNo:r,Otp:b};e.fileCacheHelper.loadJsFile("apps/integrations/gst/managers/gstmanager.js",function(){n.Apps.Integrations.GST.Managers.GSTManager.Instance().saveGSTRToPortal(d).then(function(n){if(n.errors!=null)return MessageHelper.Instance().showError(n.message,"Unibase_ValidationSummary"),!1;alert(n.message);var t=Unibase.Themes.Compact.Components.Details.Instance();t._recordId=Unibase.Themes.Compact.Components.Details.Instance()._recordId;t._installedAppId=Unibase.Themes.Compact.Components.Details.Instance()._installedAppId;t.loadPortlets(t);Unibase.Platform.Helpers.NavigationHelper.IsListRefresh=!0})})}saveGSTRtoGSTPortal(n,t,i){var f=this,e;let r=$("#"+f.navigationHelper.getLastContainerId());if(!$("input.invoiceschk_selected").is(":checked")){const n=$(".gst-error-msg").last().attr("id");return MessageHelper.Instance().showError("Please Select One or More Records",n),null}let u=r.find("input.invoiceschk_selected");e=r.find(".invoiceschk_selected:checkbox:checked").map(function(){return $(this).val()}).get();t=$(r).find(".fromgstno").first().text()||$(r).find(".fromgstno").first().val();console.log(e);r.find("#selectedinvoices_check").click(function(){var n=u.find("input.invoiceschk_selected");n.prop("checked",!n.prop("checked"))});u.click(function(){$(this).is(":checked")?u.is(":checked")&&$("#selectedinvoices_check").prop("checked",!0):$("#selectedinvoices_check").prop("checked",!1)});bootbox.prompt("Please Enter OTP",function(r){r&&(f._saveGSTRtoGSTPortal(n,r,t,i),$(".bootbox-input").keypress(function(n){if(n.which!=8&&n.which!=0&&(n.which<48||n.which>57))return MessageHelper.Instance().showSuccess("Numbers only allowed","div_validationsummary"),!1}))})}DeleteGstrToGSTPortal(n,t){var u=this,f;let i="#"+Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length-1],r=$(i).find("input.invoiceschk_selected");f=$(i).find(".invoiceschk_selected:checkbox:checked").map(function(){return $(this).val()}).get();$(i).find("#selectedinvoices_check").click(function(){var n=r.find("input.invoiceschk_selected");n.prop("checked",!n.prop("checked"))});r.click(function(){$(this).is(":checked")?r.is(":checked")&&$("#selectedinvoices_check").prop("checked",!0):$("#selectedinvoices_check").prop("checked",!1)});bootbox.confirm("Are you sure you want to delete",function(i){i&&u._deleteGSTRtoGSTPortal(n,i,t)})}getSelectedInvoices(){$(".invoices_check")}generateOtp(t){var i=this;i.fileCacheHelper.loadJsFile("apps/integrations/gst/components/gstsubmission.js",null);i.fileCacheHelper.loadJsFile("apps/integrations/gst/managers/gstmanager.js",null);bootbox.confirm("Are you sure, you want to continue",function(r){if(r==!0){if(t==undefined||t=="")return alert("Please select Gst No"),!1;n.Apps.Integrations.GST.Managers.GSTManager.Instance().getGstDetails(t).then(function(r){if(r.status==Unibase.Data.Status.Success){var u=r.result[0],f=Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+Unibase.Themes.Providers.DetailHelper.installedAppId+"_returnperiod").Value,e=moment.utc(new Date).local().format("YYYYMMDDHHmmss"),o={username:u.gstusername,requestid:"Biz-"+e,gstin:t,retperiod:f};n.Apps.Integrations.GST.Managers.GSTManager.Instance().generateOtp(o).then(function(n){if(n.errors!=null)return i.showGSTErrorMsg(n.message),!1;alert(n.message)})}else MessageHelper.Instance().showSuccess(r.message,"")})}})}_gstShowLog(n){var f=this,t,e=Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+Unibase.Themes.Providers.DetailHelper.installedAppId+"_returnperiod").Value,o=Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+Unibase.Themes.Providers.DetailHelper.installedAppId+"_gstr1type").Value,s=Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+Unibase.Themes.Providers.DetailHelper.installedAppId+"_gstintegratorid").Value,h=Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+Unibase.Themes.Providers.DetailHelper.installedAppId+"_invoiceid").Value,u=Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+Unibase.Themes.Providers.DetailHelper.installedAppId+"_invoiceno").Value,i,r,c;if(t=Unibase.Platform.Analytics.Viewers.TableViewer.Instance().Filter.find(n=>n.ParameterName=="fromgstno"),(t==undefined||t=="")&&(t=Unibase.Platform.Analytics.Viewers.TemplateViewer.Instance().Filter.find(n=>n.ParameterName=="fromgstno")),t==undefined||t=="")return alert("Please select Gst No"),!1;t=t.ParameterValue;i=[];i.push("Invoiceno",i);r=[];r.push("TaxclassificationId",n);r.push("InvoiceId",i);c={TaxClassificationData:r,Invoiceid:h,Invoiceno:u,RtPeriod:e,GSTIntegratorid:s,GSTR1type:o,FromGSTNo:t,InvoiceTypeId:1,Selectedinvoiceno:u};f.fileCacheHelper.loadJsFile("apps/integrations/gst/managers/gstShowLog.js",function(){})}_saveGSTRtoGSTPortal(t,i,r){var f=this,o=Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+Unibase.Themes.Providers.DetailHelper.installedAppId+"_gstintegratorid").Value,s=Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+Unibase.Themes.Providers.DetailHelper.installedAppId+"_returnperiod").Value,h=moment(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+Unibase.Themes.Providers.DetailHelper.installedAppId+"_fromdate").Value).format("YYYY-MM-DD"),e=moment(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+Unibase.Themes.Providers.DetailHelper.installedAppId+"_todate").Value).format("YYYY-MM-DD"),b=Unibase.Platform.Helpers.DateTimeHelper.Instance().formatServerDate(e),k=moment.utc(new Date).local().format("YYYYMMDDHHmmss"),u=$(".invoiceschk_selected:checkbox:checked").map(function(){var n=this;return Number(n.value)}).get();isNaN(u.length)&&u;isNaN(u.length)&&(u.length=0);u.length==null&&(u.length=0);const c=$(".invoiceschk_selected:checkbox:checked").map(function(){return $(this).closest(".body-tr").find(".gst-rate").text()}).get(),l=$(".invoiceschk_selected:checkbox:checked").map(function(){return $(this).closest(".body-tr").find(".gst-supplytype").text()}).get(),a=$(".invoiceschk_selected:checkbox:checked").map(function(){return $(this).closest(".body-tr").find(".gst-pos").text()}).get(),v=$(".invoiceschk_selected:checkbox:checked").map(function(){return $(this).closest(".body-tr").find(".gst-hsncodes").text()}).get();var y=i.replace(" ",""),p=[{TaxclassificationId:t,InvoiceId:u,Rates:c,SupplyType:l,Pos:a,HSNCodes:v,InvoiceTypeId:1}],w={TaxClassificationData:p,RtPeriod:s,GSTIntegratorId:o,ToDate:e,FromDate:h,InvoiceTypeId:1,GstNo:r,Otp:y};f.fileCacheHelper.loadJsFile("apps/integrations/gst/managers/gstmanager.js",function(){n.Apps.Integrations.GST.Managers.GSTManager.Instance().saveGSTRToPortal(w).then(function(n){if(n.errors!=null)return f.showGSTErrorMsg(n.message),!1;MessageHelper.Instance().showSuccess(n.message,"");var t=Unibase.Themes.Compact.Components.Details.Instance();t._recordId=Unibase.Themes.Compact.Components.Details.Instance()._recordId;t._installedAppId=Unibase.Themes.Compact.Components.Details.Instance()._installedAppId;t.loadPortlets(t);Unibase.Platform.Helpers.NavigationHelper.IsListRefresh=!0})})}_deleteGSTRtoGSTPortal(t,i,r){var u=this,f=Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+Unibase.Themes.Providers.DetailHelper.installedAppId+"_gstintegratorid").Value,e=Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+Unibase.Themes.Providers.DetailHelper.installedAppId+"_returnperiod").Value,a=Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+Unibase.Themes.Providers.DetailHelper.installedAppId+"_fromdate").Value,v=Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+Unibase.Themes.Providers.DetailHelper.installedAppId+"_todate").Value,o=Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+Unibase.Themes.Providers.DetailHelper.installedAppId+"_gstinno").Value,y=moment.utc(new Date).local().format("YYYYMMDDHHmmss"),s=$(".invoiceschk_selected:checkbox:checked").map(function(){var n=this;return Number(n.value)}).get(),h={DeletedInvoiceIds:s},c=[{TaxclassificationId:t,InvoiceTypeId:r,DeleteInvoices:h}],l={TaxClassificationData:c,RtPeriod:e,GSTIntegratorId:f,ToDate:"'2022/08/01'",FromDate:"'2022/08/01'",InvoiceTypeId:1,GstNo:o,Otp:"575757"};u.fileCacheHelper.loadJsFile("apps/integrations/gst/managers/gstmanager.js",function(){n.Apps.Integrations.GST.Managers.GSTManager.Instance().saveGSTRToPortal(l).then(function(n){if(n.errors!=null)return u.showGSTErrorMsg(n.message),!1;MessageHelper.Instance().showSuccess(n.message,"");var t=Unibase.Themes.Compact.Components.Details.Instance();t._recordId=Unibase.Themes.Compact.Components.Details.Instance()._recordId;t._installedAppId=Unibase.Themes.Compact.Components.Details.Instance()._installedAppId;t.loadPortlets(t);Unibase.Platform.Helpers.NavigationHelper.IsListRefresh=!0})})}showGSTErrorMsg(n){const t=$(".gst-error-msg").last().attr("id");MessageHelper.Instance().showError(n,t)}static Instance(){return this.instance===undefined&&(this.instance=new i),this.instance}}t.GSTSubmission=i})(i=t.Components||(t.Components={}))})(i=t.GST||(t.GST={}))})(i=t.Integrations||(t.Integrations={}))})(t=n.Apps||(n.Apps={}))})(Bizgaze||(Bizgaze={}));