Built files from Bizgaze WebServer
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

findandmatchreconciliation.min.js 27KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. var _pagesize=20,pageIndex=0,subtotal=0,outbyvalue=0,reconciledata=[],Bizgaze;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){class i extends Unibase.Platform.Core.BaseComponent{constructor(){super(...arguments);this._idscount=0;this._oldId="";this._Unchkidscount=0;this._checkidscount=0;this._ContainerId=""}cssFiles(){return["tenants/themes/compact/css/coupons.css"]}jsFiles(){return["platform/tag/managers/tagmanager.js","platform/apps/managers/appmanager.js","apps/transact/components/bankreconciliation/findandmatchreconciliation.js","platform/analytics/components/reportviewer/reportviewer.js","platform/analytics/components/templateviewer/templateviewer.js","platform/analytics/components/reportviewer/linkreport.js"]}html(t,i){const u=this,f=$(`#bankLedgerCard_${t}`),r=+f.find("#hf_brsjournalid").val();u.journalId=r;u.ledgerid=+f.find("#hf_brsledgerid").val();u.bankamount=+f.find("#hf_brsbankbalid").val();u.ledgeramount=+f.find("#hf_brsledgerbalid").val();u.journalno=f.find("#hf_brsjournalnumberid").val();u.bankReconcileId=+f.find("#hf_brsbankrecid").val();u.reconciliationDetailsId=+f.find("#hf_brsrecdetailsid").val();u.accountname=f.find("#hf_brsaccountname").val();u.journaldate=f.find("#hf_brsjournaldate").val();u.action=f.find("#hf_brsledgeractions").val();u.recdetailsid=t;subtotal=0;outbyvalue=0;reconciledata=[];n.Apps.Transact.Components.FindandMatch.Instance()._ContainerId=i;u.action=="spent"&&(u.bankamount=-1*Number(u.bankamount));n.Apps.Transact.Components.FindandMatch.Instance()._Bankamount=u.bankamount;Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/widgets/managers/interfaces/iwidgetmanager.js",null);Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/widgets/managers/widgetmanager.js",null);Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/core/helpers/propertyhelper/propertyhelper.js",null);Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/core/helpers/token/tokenhelper.js",null);Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/analytics/components/reportviewer/reportviewer.js",null);Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/analytics/components/reportviewer/_reportviewer.js",null);Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("tenants/themes/compact/js/navigation/navigationhelper.js",null);Unibase.Platform.Helpers.FileCacheHelper.Instance().loadCssFile("tenants/themes/compact/css/coupons.css",null);return`<div class="bg-white modal-header find-match-header pa-10 model_find_and_match_div"><strong class="text-dark">Find & Match</strong>
  2. </div>
  3. <div data-simplebar class="simple-scroll-bar modal-body find-match-body" id="CardViewer_modal_`+r+`">
  4. <span class="findandmatch_errormsg text-danger text-center" id="findandmatch_errormsg" ></span>
  5. <div class="row">
  6. <div class="cardbody rounded-4 col-6">
  7. <div class="div_TransactionReconciliation_`+r+`" id="div_TransactionReconciliation_`+r+`">
  8. <div id="div_TransactionReconciliation_details_`+r+`" class="card shadow-hover mb-0">
  9. <div class="card-header card-header-action border-bottom-0 px-20">
  10. <strong>
  11. <span class="biz-highlight-bg-color" id="hf-div_TransactionReconciliation_details_`+r+`">Transaction To Reconcile</span>
  12. </strong>
  13. </div>
  14. <div class="card-body py-0">
  15. <div class="row">
  16. <div class="col-md-12">
  17. <ul class="list-group list-group-flush px-0" id="div_TransactionReconciliation_details_`+r+`_col1">
  18. <li class="Twocolumn-listgroup-1-item Twocolumn-listgroup-1-addeditem li-0 px-0 py-2 detailProperty_`+r+` widget_details_item`+r+`_col1" style="border-top: 1px solid rgb(243, 243, 243); font-size: 14px;">
  19. <div class="d-flex justify-content-between align-items-center">
  20. <span class="col-5 pl-0">`+u.journalno+`</span>
  21. <span class="text-overflow text-right d-none d-md-block" title="ledgeramount">`+u.ledgeramount+`</span>
  22. </div>
  23. </li>
  24. <li class="Twocolumn-listgroup-1-item Twocolumn-listgroup-1-addeditem li-1 px-0 py-2 detailProperty_`+r+` widget_details_item`+r+`_col1" style="border-top: 1px solid rgb(243, 243, 243); font-size: 14px;">
  25. <div class="d-flex justify-content-between align-items-center">
  26. <span class="col-5 pl-0">`+u.accountname+`</span>
  27. <span class="text-overflow text-right text-danger d-none d-md-block" title="Spent">`+u.action+`</span>
  28. </div>
  29. </li>
  30. <li class="Twocolumn-listgroup-1-item Twocolumn-listgroup-1-addeditem li-1 px-0 py-2 detailProperty_`+r+` widget_details_item`+r+`_col1" style="border-top: 1px solid rgb(243, 243, 243); font-size: 14px;">
  31. <div class="d-flex justify-content-between align-items-center">
  32. <span class="col-5 pl-0">`+u.journaldate+`</span>
  33. <span class="text-overflow text-right text-danger d-none d-md-block" title="journaldate"></span>
  34. </div>
  35. </li>
  36. </ul>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. <div class="cardbody rounded-4 col-6">
  44. <div class="div_SelectedTransaction_`+r+`" id="div_SelectedTransaction_`+r+`">
  45. <div id="div_details_SelectedTransaction_`+r+`" class="card shadow-hover mb-0">
  46. <div class="card-header card-header-action border-bottom-0 px-20">
  47. <strong>
  48. <span class="biz-highlight-bg-color" id="hf-SelectedTransaction_`+r+`">Selected Transaction</span>
  49. </strong>
  50. </div>
  51. <div class="card-body py-0">
  52. <div class="row">
  53. <div class="col-md-12">
  54. <ul class="list-group list-group-flush px-0" id="div_details_`+r+`_col1">
  55. <li class="Twocolumn-listgroup-1-item Twocolumn-listgroup-1-addeditem li-0 px-0 py-2 detailProperty_`+r+` widget_details_item`+r+`_col1" style="border-top: 1px solid rgb(243, 243, 243); font-size: 14px;">
  56. <div class="d-flex justify-content-between align-items-center">
  57. <span class="col-5 pl-0">SubTotal</span>
  58. <span class="text-overflow text-right d-none d-md-block subtotal-Value" title="subtotal-Value" id="subtotal_`+r+`">`+0+`</span>
  59. </div>
  60. </li>
  61. <li class="Twocolumn-listgroup-1-item Twocolumn-listgroup-1-addeditem li-1 px-0 py-2 detailProperty_`+r+` widget_details_item`+r+`_col1" style="border-top: 1px solid rgb(243, 243, 243); font-size: 14px;">
  62. <div class="d-flex justify-content-between align-items-center">
  63. <span class="col-5 pl-0">As Per Bank Statement</span>
  64. <span class="text-overflow text-right d-none d-md-block" title="Personnel Costs">`+u.bankamount+`</span>
  65. </div>
  66. </li>
  67. <li class="Twocolumn-listgroup-1-item Twocolumn-listgroup-1-addeditem li-1 px-0 py-2 detailProperty_`+r+` widget_details_item`+r+`_col1" style="border-top: 1px solid rgb(243, 243, 243); font-size: 14px;">
  68. <div class="d-flex justify-content-between align-items-center">
  69. <span class="col-5 pl-0">Total Is Out By</span>
  70. <span class="text-overflow text-right text-danger d-none d-md-block outbyvalue_amount" title="Personnel Costs" id="outbyvalue_`+r+`"></span>
  71. </div>
  72. </li>
  73. </ul>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </br>
  82. <span class="spn_bankrecon_errormsg text-danger text-center" id="spn_cpnaprl_errormsg" ></span>
  83. <div class="card">
  84. <input type="text" id="txt_accountname_refno_Org_search" class="form-control text-control required" style="width:100%;" placeholder = "Search" data-placeholder="Search"/>
  85. <input type="hidden" id="hf_Coupon_Org_search" class="hf_txt_CouponSubmission_Org_search' form-control value-control" data-isdynamic="true"/>
  86. </div>
  87. <div class="card">
  88. <div class="table-wrap card simple-scroll-bar bg-white-s bg-white-removed templateviewer-body" style="height:100% !important">
  89. <div class="table-responsive tableFixHead dropdown-menu-scrollbar">
  90. <table class="table table-hover table-bordered mb-0 tblreconciledata" id="tblreconciledata">
  91. <thead>
  92. <tr>
  93. <th>Date</th>
  94. <th>Name</th>
  95. <th>Reference</th>
  96. <th>ChequeNo</th>
  97. <th>Spent</th>
  98. <th>Received</th>
  99. </tr>
  100. </thead>
  101. <tbody id="tblReconcile">
  102. <tr class="ReconciliationDetails-list-items"> </tr>
  103. </tbody>
  104. </table>
  105. </div>
  106. <div class="d-flex justify-content-center">
  107. <button class="btn btn-sm btn-outline-primary mt-15 mb-15 text-center btn_reconciliationlist_load_more__modal_bizgaze_BRS" id="btn_reconciliationlist_load_more__modal_bizgaze_BRS"><u>View All</u></button>
  108. </div>
  109. </div>
  110. </div></div>
  111. <div class="bg-white modal-footer find-match-footer pa-10">
  112. <a class="btn btn-light btn-sm btn-center mr-auto" id="btnClose">Close</a>
  113. <a class="btn btn-primary btn-center btn-sm text-white" id="btnSave">Save</a>
  114. <input type="hidden"id="bankreconciliationfromdate" />
  115. <input type="hidden"id="bankreconciliationtodate" />
  116. </div>`}load(t,i){const r=this;pageIndex=0;n.Apps.Transact.Components.FindandMatch.Instance()._oldId="";n.Apps.Transact.Components.FindandMatch.Instance()._idscount=0;n.Apps.Transact.Components.FindandMatch.Instance()._Unchkidscount=0;n.Apps.Transact.Components.FindandMatch.Instance()._checkidscount=0;Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/ledgers/ledgermanager.js",function(){n.Apps.Transact.Managers.LedgerManager.Instance().getBankReconcileById(r.bankReconcileId).then(function(u){u.result!=null&&($("#bankreconciliationfromdate").val(u.result.FromDate),$("#bankreconciliationtodate").val(u.result.ToDate),n.Apps.Transact.Components.FindandMatch.Instance().BankRecFromDate=u.result.FromDate,n.Apps.Transact.Components.FindandMatch.Instance().BankRecToDate=u.result.ToDate,n.Apps.Transact.Components.FindandMatch.Instance().getLedgerJournalEntryDetails(r.ledgerid,0,n.Apps.Transact.Components.FindandMatch.Instance()._Bankamount,r.ledgeramount,null,i,r.bankReconcileId,t))})});$("#btn_reconciliationlist_load_more__modal_bizgaze_BRS").click(function(){pageIndex++;var u=$("#txt_accountname_refno_Org_search").val();(u==""||u==null||u==undefined)&&(u="null");n.Apps.Transact.Components.FindandMatch.Instance().getLedgerJournalEntryDetails(r.ledgerid,pageIndex,n.Apps.Transact.Components.FindandMatch.Instance()._Bankamount,r.ledgeramount,u,i,r.bankReconcileId,t)});$("#btnClose").click(function(){r.navigationHelper.closePopUp()});$("#txt_accountname_refno_Org_search").on("input",function(){var u=$(this).val();(u==""||u==null||u==undefined)&&(u="null");pageIndex=0;n.Apps.Transact.Components.FindandMatch.Instance()._oldId="";n.Apps.Transact.Components.FindandMatch.Instance()._idscount=0;n.Apps.Transact.Components.FindandMatch.Instance()._Unchkidscount=0;n.Apps.Transact.Components.FindandMatch.Instance()._checkidscount=0;n.Apps.Transact.Components.FindandMatch.Instance().getLedgerJournalEntryDetails(r.ledgerid,pageIndex,r.bankamount,r.ledgeramount,u,i,r.bankReconcileId,t)});$("#btnSave").click(function(){n.Apps.Transact.Components.FindandMatch.Instance().saveAllselectedReconcilition(i,r.journalId,n.Apps.Transact.Components.FindandMatch.Instance()._Bankamount,reconciledata,r.ledgerid)})}init(){}getFindAndMatchDetails(){}getLedgerJournalEntryDetails(t,i,r,u,f,e,o,s){var w,v;if(t!=0){var h="",c="",l=Unibase.Platform.Helpers.NavigationHelper.commonFilter_FromDate,a=Unibase.Platform.Helpers.NavigationHelper.commonFilter_ToDate;let w=0;l!=null&&a!=null?(h=l.toString(),c=a.toString()):(h=Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()),"YYYY/MM/DD"),c=Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()),"YYYY/MM/DD"));$(".ReconciliationDetails-list-items").remove();f!==""&&f!=="null"&&$(".ReconciliationDetails-item-active").remove();var b=moment(h).format("YYYY-MM-DD"),k=moment(c).format("YYYY-MM-DD"),y=moment(n.Apps.Transact.Components.FindandMatch.Instance().BankRecFromDate).format("YYYY-MM-DD"),p=moment(n.Apps.Transact.Components.FindandMatch.Instance().BankRecToDate).format("YYYY-MM-DD");r=r;u=u;w=Number(u);v=!0;w=i==0?10:0;Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/ledgers/ledgermanager.js",function(){n.Apps.Transact.Managers.LedgerManager.Instance().getReconciliationData(t,y,p,v,i,f,w).then(function(t){var y,h;if(i==0&&$("#checkAll").prop("checked",!1),$("#btn_reconciliationlist_load_more__modal_bizgaze_BRS").addClass("hidden"),y=0,$("._btnreconciliation_div").addClass("hidden"),t.result._rows.length!=0){$("#btn_reconciliationlist_load_more__modal_bizgaze_BRS").removeClass("hidden");var rt=Unibase.Platform.Helpers.DateTimeHelper.Instance();for(y=t.result._totalRecords,w==0&&$("#btn_reconciliationlist_load_more__modal_bizgaze_BRS").addClass("hidden"),h=0;h<t.result._rows.length;h++){var u=t.result._rows[h],f=Number(u.Cells[0]),d=u.Cells[1],l=moment(u.Cells[2],"DD-MM-YYYY").format("DD/MM/YYYY");l=="Invalid date"&&(l=Unibase.Platform.Helpers.DateTimeHelper.Instance().serverDateformat(u.Cells[2]));var g=u.Cells[3],p=u.Cells[4],b=u.Cells[5],a="",ut=u.Cells[7],v=Number(u.Cells[13]),nt=Number(u.Cells[20]),tt=Number(u.Cells[21]);v==nt?a=u.Cells[14]:v==tt&&(a=u.Cells[9]);var it=u.Cells[19],c="",ft=Number(h),k=Number(f);c+='<tr class="ReconciliationDetails-list-items ReconciliationDetails-item-active value-row li-'+k+'"><input type="hidden"id="recledgerid" value="'+f+'" /><input type="hidden"id="bankreconcileid" value="'+o+'" /><input type="hidden"id="bankreconciliationdetailsid" value="'+s+'" /><input type="hidden"id="JournalEntryId" value="'+it+'" /><input type="hidden"id="bankbalanceamount" value="'+r+'" /><input type="hidden"id="ledgerid" value="'+v+'" />';c+=k==0?'<td id="JournalDate_"><div class="" > <input type="checkbox" id = "transactionDate_checkbox_" name = "transactionRadio" class="chkReconciliaionStatus " checked="checked" > <label class="custom-control-label" for= "transactionDate_checkbox_">'+l+"<\/label><\/div><\/td>":'<td id="JournalDate_'+f+'"><div class="" > <input type="checkbox" id = "transactionDate_checkbox_'+f+'" name = "transactionRadio" class="chkReconciliaionStatus " > <label class="custom-control-label" for= "transactionDate_checkbox_'+f+'" value=>'+l+"<\/label><\/div><\/td>";c+='<td id="AccountName_'+f+'">'+a+'<\/td><td id="JournalNo_'+f+'">'+d+'<\/td><td id="ChequeNo_'+f+'">'+g+'<\/td><td id="Credit_'+f+'">'+p+'<\/td><input type="hidden"id="spentamount" value="'+p+'" /><input type="hidden"id="receivedamount" value="'+b+'" /><td id="Debit_'+f+'">'+b+"<\/td>";c+="<\/tr>";$("#tblreconciledata tbody").append(c)}}$("input:checkbox").click(function(){var v=$(this).attr("id"),t=$(this).closest("tr"),c=$(t).find("#recledgerid").val(),l=$(t).find(".chkReconciliaionStatus").is(":checked"),s,h,r;l==!1&&($("#subtotal_"+Number(c)).text("0"),subtotal=0);var u=$(t).find("#recledgerid").val(),y=$(t).find("#ledgerid").val(),i=0,f=0,o=0,a=$(t).find("#spentamount").val();Number(a)!=0&&(s=$("#Credit_"+u).text(),i=-1*Number(s),f=i);h=$(t).find("#receivedamount").val();Number(h)!=0&&(r=$("#Debit_"+u).text(),i=Number(r),o=Number(r));n.Apps.Transact.Components.FindandMatch.Instance().savereconcile($(this).closest("tr"),i,e,Number(f),Number(o))})})})}}savereconcile(t,i,r,u,f){var h=$(t).find(".chkReconciliaionStatus").is(":checked"),s=0,o=$(t).find("#recledgerid").val(),c=$(t).find("#ledgerid").val(),l=$(t).find("#bankreconcileid").val(),a=$(t).find("#bankreconciliationdetailsid").val(),e=Number($(t).find("#bankbalanceamount").val()),v=$(t).find("#JournalEntryId").val(),y=Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate(),p=Unibase.Platform.Helpers.DateTimeHelper.Instance().formatServerLocalDate(y,"DD/MM/YYYY"),w;subtotal=Number(subtotal);h&&(s=1,Number(u)!=0?(subtotal=Number(subtotal)-Number(i),e=-1*e):Number(f)!=0&&(subtotal=Number(subtotal)+Number(i),e=1*e),Number(e)==Number(subtotal)?($(".subtotal-Value").text(subtotal),outbyvalue=e-subtotal,Number(outbyvalue==0)&&Number(u)!=0&&(n.Apps.Transact.Components.FindandMatch.Instance()._Bankamount=-1*n.Apps.Transact.Components.FindandMatch.Instance()._Bankamount),$(".outbyvalue_amount").text(outbyvalue),reconciledata.push({JournalId:o,ReconcileNo:s,ReconcileDate:p,LedgerId:c,ReconciliationDetailsId:a,BankReconcileId:l,JournalEntryId:v})):(subtotal=0,outbyvalue=0,$(".subtotal-Value").text(subtotal),$(".outbyvalue_amount").text(outbyvalue),$("#subtotal_"+o).text(subtotal),$("#outbyvalue_"+o).text(outbyvalue),MessageHelper.Instance().showError("Please selected valid amount","findandmatch_errormsg"),$(".chkReconciliaionStatus").prop("checked",!1),$("#transactionDate_checkbox_"+o).prop("checked",!1),n.Apps.Transact.Components.FindandMatch.Instance()._oldId!=""&&(n.Apps.Transact.Components.FindandMatch.Instance()._idscount=1,n.Apps.Transact.Components.FindandMatch.Instance()._checkidscount=0,n.Apps.Transact.Components.FindandMatch.Instance()._Unchkidscount=0)));w=reconciledata}confirmreconcile(t,i,r,u,f,e,o,s,h,c,l){var y;if(Number(t)!=0&&Number(u)==Number(f)){var p=Number(t),a=Number(r),w=Number(l),b=Number(h),k=Number(c),d=Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate(),g=Unibase.Platform.Helpers.DateTimeHelper.Instance().formatServerLocalDate(d,"DD/MM/YYYY"),v=[];v.push({JournalId:p,ReconcileNo:1,ReconcileDate:g,LedgerId:a,ReconciliationDetailsId:w,BankReconcileId:b,JournalEntryId:k});y=v;Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/ledgers/ledgermanager.js",function(){n.Apps.Transact.Managers.LedgerManager.Instance().saveReconcile(y).then(function(t){if(t.result!=null){MessageHelper.Instance().showSuccess(t.message,"findandmatch_errormsg");var r=$("."+i).attr("id"),u=r.match(/\d+/);n.Apps.Transact.Components.FindandMatch.Instance().RefreshReportsAndWidgets(Number(u[0]),r,a)}else MessageHelper.Instance().showError(t.message,"findandmatch_errormsg")})})}else MessageHelper.Instance().showError("selected amount is (Bank Amount:"+Number(u)+" Ledger Amount :"+Number(f)+") not matched go through the find and match or create new record","reconcile_errormsg")}RefreshReportsAndWidgets(t,i,r){Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getPortletWidget(t).then(function(t){if(t.result!=null){var u=Number(t.result.WidgetId),f=Number(t.result.PortletWidgetId);n.Apps.Transact.Components.FindandMatch.Instance().linkReport(u,f,i,r)}})}confirm_And_Action_Hide_and_Show(t,i,r,u,f,e,o,s,h,c,l){l.trim()=="actions"?$(".div_subdata_"+t).removeClass("hidden"):n.Apps.Transact.Components.FindandMatch.Instance().confirmreconcile(t,i,r,u,f,e,o,s,h,0,0)}linkReport(n,t,i,r){var u=this;Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getKPIWidget(n).then(function(n){var f=n.result,t;if(f!=null){let e=i;t=Unibase.Platform.Analytics.Components.ReportViewer.Instance();let n=[];n.push({Key:"ledgerid",Value:String(r),ExpOp:Unibase.Platform.Core.Enums.ExpressionOperator.Equals});u.inputParameters=n;t=Unibase.Platform.Analytics.Components.ReportViewer.Instance();t.inputParameters=u.inputParameters;Unibase.Platform.Analytics.Components.ReportViewer.Instance().getReportData(f.LinkReportId,e,null,null)}})}saveAllselectedReconcilition(t,i,r,u){const f=this;Number(r)>=Number(subtotal)?Number(r)==Number(subtotal)?($("#div_brs_"+i).addClass("hidden"),MessageHelper.Instance().showSuccess("amount matched sucessfully","findandmatch_errormsg"),subtotal=0,Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/ledgers/ledgermanager.js",function(){n.Apps.Transact.Managers.LedgerManager.Instance().saveReconcile(u).then(function(n){if(n.result!=null){const t=f.navigationHelper.getLastContainerId();$(`#reportRefreshBtn_${t}`).trigger("click");MessageHelper.Instance().showSuccess(n.message,"");f.navigationHelper.closePopUp()}else MessageHelper.Instance().showError(n.message,"findandmatch_errormsg")})})):alert("Amount Not Matched"):MessageHelper.Instance().showError("Amount is greater than the bank amount","findandmatch_errormsg")}_dynaminReportClose(){var n=Unibase.Themes.Compact.Components.Details.Instance(),t=$("._bizgaze_detail_container:visible").attr("id"),i=Unibase.Themes.Providers.DetailHelper.installedAppId,r=n.unibase_core_activeportletid;n.loadWidgets(i,r,"#"+t+"")}ledgerreconcile(t,i,r,u,f){var s;if(Number(t)!=0){var e=Number(t),h=Number(r),c=$("#txt_JournalDate_"+e).val(),l=Unibase.Platform.Helpers.DateTimeHelper.Instance().formatServerDate(c),a=Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate(),v=Unibase.Platform.Helpers.DateTimeHelper.Instance().formatServerLocalDate(a,"DD/MM/YYYY"),o=[];o.push({JournalId:e,ReconcileNo:1,ReconcileDate:v,LedgerId:h,JournalEntryId:0,JournalNo:f,JournalDate:l});s=o;Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/ledgers/ledgermanager.js",function(){n.Apps.Transact.Managers.LedgerManager.Instance().saveLedgerReconcile(s).then(function(n){if(n.result!=null){MessageHelper.Instance().showSuccess(n.message,"findandmatch_errormsg");var t=$("."+i).attr("id"),r="Reportid_"+t,u=$("#"+r).text();Unibase.Platform.Analytics.Managers.ReportManager.Instance().getReportById(Number(u)).then(function(n){n.result!=null&&Unibase.Platform.Analytics.Components.ReportViewer.Instance().getReportData(n.result.ReportId,i,null,null)})}else MessageHelper.Instance().showError(n.message,"findandmatch_errormsg")})})}}getDateDetails(n,t){n.stopPropagation();$("#txt_JournalDate_"+t).daterangepicker({locale:{format:"DD/MM/YYYY"},singleDatePicker:!0,showDropdowns:!0,minYear:1901,maxDate:new Date(2050,11,31)})}AutoReconcileByAllMatchedData(){var t=[];if($(".btn_BrsRecActions:not(#btn_Bankconfirm_0):visible").each(function(n,i){t.push($(i))}),t.length>=1)bootbox.confirm("Are you sure ! You want to reconcile all matched data ? ",function(i){var f,u;if(i){for(f=[],u=0;u<t.length;u++){var r=t[u],e=Number($(r).find("#hf_brsjournalid").val()),s=$(r).find("#hf_brscid").val(),o=Number($(r).find("#hf_brsledgerid").val()),h=Number($(r).find("#hf_brsrecdetailsid").val()),c=Number($(r).find("#hf_brsbankrecid").val()),l=Number($(r).find("#hf_brsbankbalid").val()),a=Number($(r).find("#hf_brsledgerbalid").val()),v=Number(0),y=Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate(),p=Unibase.Platform.Helpers.DateTimeHelper.Instance().formatServerLocalDate(y,"DD/MM/YYYY");Number(e)!=0&&Number(l)==Number(a)&&f.push({JournalId:e,ReconcileNo:1,ReconcileDate:p,LedgerId:o,ReconciliationDetailsId:h,BankReconcileId:c,JournalEntryId:v})}Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/ledgers/ledgermanager.js",function(){n.Apps.Transact.Managers.LedgerManager.Instance().saveReconcile(f).then(function(t){if(t.result!=null){MessageHelper.Instance().showSuccess(t.message,"findandmatch_errormsg");var i=$("."+s).attr("id"),r=i.match(/\d+/);n.Apps.Transact.Components.FindandMatch.Instance().RefreshReportsAndWidgets(Number(r[0]),i,o)}else{const n=$("._bizgaze_popup_container:visible").attr("id");$(`#div_errors_reportviewer_${n}`).addClass("form-error-message");MessageHelper.Instance().showError(t.message,`div_errors_reportviewer_${n}`)}})})}});else{const n=$("._bizgaze_popup_container:visible").attr("id");$(`#div_errors_reportviewer_${n}`).addClass("form-error-message");MessageHelper.Instance().showError("matched records not found",`div_errors_reportviewer_${n}`)}}unReconcile(t,i,r,u,f,e,o,s,h,c,l){var y;if(Number(c)!=0){var p=Number(t),a=Number(r),w=Number(l),b=Number(h),k=Number(c),d=Unibase.Platform.Helpers.DateTimeHelper.Instance().formatServerLocalDate("0001-01-01 00:00:00","DD/MM/YYYY"),v=[];v.push({JournalId:p,ReconcileNo:0,ReconcileDate:d,LedgerId:a,ReconciliationDetailsId:w,BankReconcileId:b,JournalEntryId:k});y=v;Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/ledgers/ledgermanager.js",function(){n.Apps.Transact.Managers.LedgerManager.Instance().saveReconcile(y).then(function(t){if(t.result!=null){MessageHelper.Instance().showSuccess(t.message,"findandmatch_errormsg");var r=$("."+i).attr("id"),u=r.match(/\d+/);n.Apps.Transact.Components.FindandMatch.Instance().RefreshReportsAndWidgets(Number(u[0]),r,a)}else MessageHelper.Instance().showError(t.message,"findandmatch_errormsg")})})}else MessageHelper.Instance().showError("selected amount is (Bank Amount:"+Number(u)+" Ledger Amount :"+Number(f)+") not matched go through the find and match or create new record","reconcile_errormsg")}static Instance(){return this._instance===undefined&&(this._instance=new i),this._instance}}t.FindandMatch=i})(i=t.Components||(t.Components={}))})(i=t.Transact||(t.Transact={}))})(t=n.Apps||(n.Apps={}))})(Bizgaze||(Bizgaze={}));