var __awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},_pagesize=10,pageIndex=0,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{constructor(){super(...arguments);this.Installedappid=0}cssFiles(){return[""]}jsFiles(){return["apps/transact/components/Wallets/payoutrequestsubmissionapproval.js","apps/transact/managers/wallets/walletmanager.js","tenants/themes/default/components/details/details.js","apps/transact/managers/inventory/itemmanager.js","tenants/themes/default/notificationrefresh.js","apps/paybacks/components/secondaryqrcodedetails.js","libs/bizgaze/helpers/messages/messagehelper.js",]}init(t){var r=this,i;n.Apps.Transact.Components.Wallets.PayoutRequestSubmissionApproval.Instance().render(t);n.Apps.Transact.Components.Wallets.PayoutRequestSubmissionApproval.Instance().LoadPayoutRequestSubmissionStages();n.Apps.Transact.Components.Wallets.PayoutRequestSubmissionApproval.Instance().getInstalledapp();$("#txt_CouponSubmission_Org_search").change(function(){$(".CpnSubmission").remove();pageIndex=0;var t=Number($("select#txt_CouponSubmission_Org_search option:selected").val());t!=0&&n.Apps.Transact.Components.Wallets.PayoutRequestSubmissionApproval.Instance().getPayoutRequestSubmissionApproval(t,0)});$("#checkAll").change(function(){$("input:checkbox").prop("checked",$(this).prop("checked"))});$("#btn_list_load_more__modal_bizgaze_srpl").click(function(){pageIndex++;var t=Number($("select#txt_CouponSubmission_Org_search option:selected").val());t!=0&&n.Apps.Transact.Components.Wallets.PayoutRequestSubmissionApproval.Instance().getPayoutRequestSubmissionApproval(t,pageIndex)});i="";$("#btnsubmissions").click(function(){$("select#txt_CouponSubmission_Org_search option:selected").text()=="Successfully Generated"&&n.Apps.Transact.Components.Wallets.PayoutRequestSubmissionApproval.Instance().ApprovedByFinanceStage();$("select#txt_CouponSubmission_Org_search option:selected").text()=="In-Progress"&&(i="authenticsucessfullygenerated",n.Apps.Transact.Components.Wallets.PayoutRequestSubmissionApproval.Instance().SuccessfullyGenerateStage(i));$("select#txt_CouponSubmission_Org_search option:selected").text()=="Payment In-Progress"&&(i="authenticapprovedbyfinance",n.Apps.Transact.Components.Wallets.PayoutRequestSubmissionApproval.Instance().SuccessfullyGenerateStage(i))})}html(){return``}load(){return __awaiter(this,void 0,void 0,function*(){var n=this})}loadhtml(){var n=this;return``}render(n){var t=`
Submission No
Contact Name
Contact Type
Stage Name
Redeem Value
Created Date
`;$("#"+n).html(t)}getInstalledapp(){var i=this;let t="Bizgaze_Extension_Transact_PayoutRequest_App_PayoutRequest";Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/apps/managers/appmanager.js",function(){Unibase.Platform.Apps.Managers.AppManager.Instance().getInstallAppId(t).then(function(t){var i=t.result;n.Apps.Transact.Components.Wallets.PayoutRequestSubmissionApproval.Instance().Installedappid=i.InstalledAppId})})}getPayoutRequestSubmissionApproval(t,i){t!=0&&Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/wallets/walletmanager.js",function(){n.Apps.Transact.Managers.WalletManager.Instance().getPayoutRequestSubmissionApprovalData(t,i).then(function(n){var r=0,u,s,k;if($("._btnsubmissions_div").addClass("hidden"),n.result._rows.length!=0){var d=Unibase.Platform.Helpers.DateTimeHelper.Instance();let i=n.result._rows[0].Cells[4];for(i=="Successfully Generated"?$(".checkAll").removeClass("hidden"):i=="In-Progress"?$(".checkAll").removeClass("hidden"):i=="Payment In-Progress"?$(".checkAll").removeClass("hidden"):$(".checkAll").addClass("hidden"),r=n.result._totalRecords,u=0;u
<\/div>
'+y+' <\/a><\/span><\/div>
'+e+'<\/div>
'+o+'<\/div>
'+w+'<\/div>
'+p+'<\/div>
'+b+'<\/div>';c+="<\/div><\/div><\/div>";$(".Couponsubmissiondiv:last").after("
<\/div>");$("#AddCouponsubmissiondiv_"+t).append(c)}}if($("select#txt_CouponSubmission_Org_search option:selected").text()=="Successfully Generated"||$("select#txt_CouponSubmission_Org_search option:selected").text()=="Payment In-Progress"?($("#btnsubmissions").text("Approved By Finance"),$(".CheckCouponSubmissionNumber").removeClass("hidden"),$("._btnsubmissions_div").removeClass("hidden")):$("select#txt_CouponSubmission_Org_search option:selected").text()=="In-Progress"&&($("#btnsubmissions").text("Verify"),$(".CheckCouponSubmissionNumber").removeClass("hidden"),$("._btnsubmissions_div").removeClass("hidden")),$("#conta").removeClass("hidden"),r>_pagesize?($("#gridPager2").show(),$("#cpntotalrecords").show()):$("#gridPager2").hide(),r>_pagesize){var l=r,a=0,h=0,v=(1+i)*10;l>0&&(a=1,h=l);l>v&&(h=v);!0&&(a+=v-10);k=a+" - "+h+" of "+r;$("#lblcpnTotals").text(k);h==r?$("#btn_list_load_more__modal_bizgaze_srpl").addClass("hidden"):$("#btn_list_load_more__modal_bizgaze_srpl").removeClass("hidden")}else $("#lblcpnTotals").text(r)})})}cspValidation(){var t=0,n=Unibase.Themes.Providers.DetailHelper.installedAppId,i=Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(t=>t.Key=="hf_"+n+"_stagename").Value,r=Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(t=>t.Key=="hf_"+n+"_stageid").Value;$("#li_DetailSetting_"+n+"_Verify").addClass("hidden");i=="In-Progress"&&($("#li_DetailSetting_"+n+"_Verify").removeClass("hidden"),Unibase.Platform.Apps.Managers.StageManager.Instance().getStages(n).then(function(n){for(let i of n.result)i.StageName=="Successfully Generated"&&(t=i.StageId)}));$(".DetailSetting_"+n+"_Verify").unbind().click(function(){Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/core/infos/status.js",function(){});var i=Unibase.Themes.Providers.DetailHelper.recordId,n=Unibase.Themes.Providers.DetailHelper.installedAppId;Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("tenants/themes/compact/components/details/details.js",function(){Unibase.Themes.Compact.Components.Details.Instance().changeStage(t,n)})})}LoadPayoutRequestSubmissionStages(){var t="authenticsucessfullygenerated";Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/wallets/walletmanager.js",function(){n.Apps.Transact.Managers.WalletManager.Instance().getPayoutRequestSubmissionStages(t).then(function(t){for(var r=t.result,i=0;i'+t.result[i].StageName+"<\/option>"),n.Apps.Transact.Components.Wallets.PayoutRequestSubmissionApproval.Instance().getPayoutRequestSubmissionApproval(r[i].StageId,0)):$("#txt_CouponSubmission_Org_search").append('