This commit is contained in:
2023-03-11 17:30:20 +00:00
commit b6c4e025bc
5124 changed files with 1153349 additions and 0 deletions
@@ -0,0 +1,131 @@
var bnkreconciliationdetailsid = 0;
var bnkreconcileid = 0;
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let Transact;
(function (Transact) {
let Components;
(function (Components) {
let BankReconciliation;
(function (BankReconciliation) {
class BankReconcile extends Unibase.Platform.Core.BaseComponent {
jsFiles() {
return ["apps/transact/components/bankreconciliation/bankreconcile.js", "apps/transact/components/bankreconciliation/findandmatchreconciliation.js"];
}
cssFiles() {
return [];
}
html() {
return "";
}
load() {
}
init(AppName, BankreconcileId, ledgerid, ledgername, closingbal, credit, debit, refno, reconciliationdetailsid, bankaction, banktransactiondate) {
var instance = this;
this.fileCacheHelper.loadJsFile("platform/apps/managers/appmanager.js", null);
this.fileCacheHelper.loadJsFile("platform/forms/managers/formmanager.js", null);
instance.getAppConfigurationByUniqueId(AppName, BankreconcileId, ledgerid, ledgername, closingbal, credit, debit, refno, reconciliationdetailsid, bankaction, banktransactiondate);
}
getAppConfigurationByUniqueId(AppName, BankreconcileId, ledgerid, ledgername, closingbal, credit, debit, refno, reconciliationdetailsid, bankaction, banktransactiondate) {
bnkreconcileid = BankreconcileId;
bnkreconciliationdetailsid = reconciliationdetailsid;
var instance = this;
var AppUniqueId = "";
var FormUniqueId = "";
var AppConfigurationId = 0;
if (AppName.trim() == "Vouchers") {
AppUniqueId = "Bizgaze_Extension_Transact_Vouchers_App_Vouchers";
FormUniqueId = "Bizgaze_Extension_Transact_Vouchers_App_Vouchers_CreateForm";
}
else if (AppName.trim() == "Payments") {
AppUniqueId = "Bizgaze_Extension_Transact_Payments_App_Payments";
FormUniqueId = "Bizgaze_Extension_Transact_Payments_App_Payments_CreateForm";
}
else if (AppName.trim() == "Receipts") {
AppUniqueId = "Bizgaze_Extension_Transact_Receipts_App_Receipts";
FormUniqueId = "Bizgaze_Extension_Transact_Receipt_App_Receipt_CreateForm";
}
Unibase.Platform.Apps.Managers.AppManager.Instance().getInstallAppId(AppUniqueId.trim()).then(function (response) {
var installedappid = response.result.InstalledAppId;
Unibase.Platform.Apps.Managers.AppManager.Instance().getFormAppConfigurations(Number(installedappid)).then(function (response) {
if (response.result != null) {
var d = response.result;
for (var i = 0; i < response.result.length; i++) {
if (response.result[i].AppConfigType == 1 && response.result[i].SettingUrlType == 1) {
AppConfigurationId = Number(response.result[i].AppConfigurationId);
Unibase.Platform.Forms.Managers.FormManager.Instance().getFormbyUniqueId(FormUniqueId.trim()).then(function (response) {
if (response.result != null) {
if (response.result.FormUniqueId.trim() == "Bizgaze_Extension_Transact_Vouchers_App_Vouchers_CreateForm") {
var d = {
ledgerid: ledgerid,
ledgername: ledgername,
closingbal: closingbal,
credit: credit,
debit: debit,
refno: refno,
bankaction: bankaction,
installedappid: installedappid,
transactiondate: banktransactiondate,
};
var loadobj = {
CallBack: function (response) {
debugger;
Bizgaze.Apps.Transact.Controls.Voucher.Instance().bindVoucherEntriesAccount(response);
},
Parameters: d,
};
var successobj = {
CallBack: function (response) {
if (response != null) {
const containerId = instance.navigationHelper.getLastContainerId();
Bizgaze.Apps.Transact.Components.FindandMatch.Instance().confirmreconcile(response, containerId, ledgerid, 0, 0, '', '', '', bnkreconcileid, 0, bnkreconciliationdetailsid);
}
},
Parameters: d,
};
var formviewerObj = {
FormId: response.result.FormId,
AppConfigurationId: 0,
Pk_Value: 0,
PortletWidgetId: 0,
OnSuccess: successobj,
OnFail: null,
OnLoad: loadobj,
};
Unibase.Platform.Forms.Components.FormViewer.Instance().init(formviewerObj);
}
else {
var formviewerObj = {
FormId: response.result.FormId,
AppConfigurationId: 0,
Pk_Value: 0,
PortletWidgetId: 0,
OnSuccess: successobj,
OnFail: null,
OnLoad: null,
};
Unibase.Platform.Forms.Components.FormViewer.Instance().init(formviewerObj);
}
}
});
}
}
}
});
});
}
static Instance() {
if (this.instance === undefined) {
this.instance = new BankReconcile();
}
return this.instance;
}
}
BankReconciliation.BankReconcile = BankReconcile;
})(BankReconciliation = Components.BankReconciliation || (Components.BankReconciliation = {}));
})(Components = Transact.Components || (Transact.Components = {}));
})(Transact = Apps.Transact || (Apps.Transact = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
@@ -0,0 +1 @@
{"version":3,"file":"bankreconcile.js","sourceRoot":"","sources":["bankreconcile.ts"],"names":[],"mappings":"AAIA,IAAI,0BAA0B,GAAG,CAAC,CAAC;AACnC,IAAI,cAAc,GAAG,CAAC,CAAC;AACvB,IAAU,OAAO,CAgIhB;AAhID,WAAU,OAAO;IACb,IAAiB,IAAI,CA8HpB;IA9HD,WAAiB,IAAI;QACjB,IAAiB,QAAQ,CA4HxB;QA5HD,WAAiB,QAAQ;YACrB,IAAiB,UAAU,CA0H1B;YA1HD,WAAiB,UAAU;gBACvB,IAAiB,kBAAkB,CAwHlC;gBAxHD,WAAiB,kBAAkB;oBAC/B,MAAa,aAAc,SAAQ,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa;wBAElE,OAAO;4BACH,OAAO,CAAC,8DAA8D,EAAC,2EAA2E,CAAC,CAAC;wBACxJ,CAAC;wBACD,QAAQ;4BACJ,OAAO,EAAE,CAAC;wBACd,CAAC;wBACD,IAAI;4BACA,OAAO,EAAE,CAAC;wBACd,CAAC;wBACD,IAAI;wBAEJ,CAAC;wBACD,IAAI,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,uBAAuB,EAAC,UAAU;4BACrH,IAAI,QAAQ,GAAG,IAAI,CAAC;4BACpB,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,sCAAsC,EAAE,IAAI,CAAC,CAAC;4BAC9E,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,wCAAwC,EAAE,IAAI,CAAC,CAAC;4BAChF,QAAQ,CAAC,6BAA6B,CAAC,OAAO,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AC,CAAC;6CACN;yCACJ;qCACJ;gCACL,CAAC,CAAC,CAAC;4BAEP,CAAC,CAAC,CAAC;wBACP,CAAC;wBAED,MAAM,CAAC,QAAQ;4BACX,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;gCAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;6BACvC;4BACD,OAAO,IAAI,CAAC,QAAQ,CAAC;wBACzB,CAAC;qBACJ;oBAtHY,gCAAa,gBAsHzB,CAAA;gBACL,CAAC,EAxHgB,kBAAkB,GAAlB,6BAAkB,KAAlB,6BAAkB,QAwHlC;YACL,CAAC,EA1HgB,UAAU,GAAV,mBAAU,KAAV,mBAAU,QA0H1B;QACL,CAAC,EA5HgB,QAAQ,GAAR,aAAQ,KAAR,aAAQ,QA4HxB;IACL,CAAC,EA9HgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QA8HpB;AACL,CAAC,EAhIS,OAAO,KAAP,OAAO,QAgIhB"}
@@ -0,0 +1 @@
var bnkreconciliationdetailsid=0,bnkreconcileid=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{jsFiles(){return["apps/transact/components/bankreconciliation/bankreconcile.js","apps/transact/components/bankreconciliation/findandmatchreconciliation.js"]}cssFiles(){return[]}html(){return""}load(){}init(n,t,i,r,u,f,e,o,s,h){var c=this;this.fileCacheHelper.loadJsFile("platform/apps/managers/appmanager.js",null);this.fileCacheHelper.loadJsFile("platform/forms/managers/formmanager.js",null);c.getAppConfigurationByUniqueId(n,t,i,r,u,f,e,o,s,h)}getAppConfigurationByUniqueId(t,i,r,u,f,e,o,s,h,c){bnkreconcileid=i;bnkreconciliationdetailsid=h;var y=this,l="",a="",v=0;t.trim()=="Vouchers"?(l="Bizgaze_Extension_Transact_Vouchers_App_Vouchers",a="Bizgaze_Extension_Transact_Vouchers_App_Vouchers_CreateForm"):t.trim()=="Payments"?(l="Bizgaze_Extension_Transact_Payments_App_Payments",a="Bizgaze_Extension_Transact_Payments_App_Payments_CreateForm"):t.trim()=="Receipts"&&(l="Bizgaze_Extension_Transact_Receipts_App_Receipts",a="Bizgaze_Extension_Transact_Receipt_App_Receipt_CreateForm");Unibase.Platform.Apps.Managers.AppManager.Instance().getInstallAppId(l.trim()).then(function(t){var i=t.result.InstalledAppId;Unibase.Platform.Apps.Managers.AppManager.Instance().getFormAppConfigurations(Number(i)).then(function(t){var l,h;if(t.result!=null)for(l=t.result,h=0;h<t.result.length;h++)t.result[h].AppConfigType==1&&t.result[h].SettingUrlType==1&&(v=Number(t.result[h].AppConfigurationId),Unibase.Platform.Forms.Managers.FormManager.Instance().getFormbyUniqueId(a.trim()).then(function(t){var h;if(t.result!=null)if(t.result.FormUniqueId.trim()=="Bizgaze_Extension_Transact_Vouchers_App_Vouchers_CreateForm"){var l={ledgerid:r,ledgername:u,closingbal:f,credit:e,debit:o,refno:s,bankaction:c,installedappid:i},v={CallBack:function(t){n.Apps.Transact.Controls.Voucher.Instance().bindVoucherEntriesAccount(t)},Parameters:l},a={CallBack:function(t){t!=null&&n.Apps.Transact.Components.FindandMatch.Instance().confirmreconcile(t,"_bizgaze_popup_container",r,0,0,"","","",bnkreconcileid,0,bnkreconciliationdetailsid)},Parameters:l},h={FormId:t.result.FormId,AppConfigurationId:0,Pk_Value:0,PortletWidgetId:0,OnSuccess:a,OnFail:null,OnLoad:v};Unibase.Platform.Forms.Components.FormViewer.Instance().init(h)}else h={FormId:t.result.FormId,AppConfigurationId:0,Pk_Value:0,PortletWidgetId:0,OnSuccess:a,OnFail:null,OnLoad:null},Unibase.Platform.Forms.Components.FormViewer.Instance().init(h)}))})})}static Instance(){return this.instance===undefined&&(this.instance=new i),this.instance}}t.BankReconcile=i})(i=t.BankReconciliation||(t.BankReconciliation={}))})(i=t.Components||(t.Components={}))})(i=t.Transact||(t.Transact={}))})(t=n.Apps||(n.Apps={}))})(Bizgaze||(Bizgaze={}));
@@ -0,0 +1,700 @@
var _pagesize = 20;
var pageIndex = 0;
var subtotal = 0;
var outbyvalue = 0;
var reconciledata = [];
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let Transact;
(function (Transact) {
let Components;
(function (Components) {
class FindandMatch 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(recdetailsid, containerid) {
const instance = this;
const ledgerCard = $(`#bankLedgerCard_${recdetailsid}`);
const id = +ledgerCard.find('#hf_brsjournalid').val();
instance.journalId = id;
instance.ledgerid = +ledgerCard.find('#hf_brsledgerid').val();
instance.bankamount = +ledgerCard.find('#hf_brsbankbalid').val();
instance.ledgeramount = +ledgerCard.find('#hf_brsledgerbalid').val();
instance.journalno = ledgerCard.find('#hf_brsjournalnumberid').val();
instance.bankReconcileId = +ledgerCard.find('#hf_brsbankrecid').val();
instance.reconciliationDetailsId = +ledgerCard.find('#hf_brsrecdetailsid').val();
instance.accountname = ledgerCard.find('#hf_brsaccountname').val();
instance.journaldate = ledgerCard.find('#hf_brsjournaldate').val();
instance.action = ledgerCard.find('#hf_brsledgeractions').val();
instance.recdetailsid = recdetailsid;
subtotal = 0;
outbyvalue = 0;
reconciledata = [];
Bizgaze.Apps.Transact.Components.FindandMatch.Instance()._ContainerId = containerid;
if (instance.action == "spent") {
instance.bankamount = -1 * Number(instance.bankamount);
}
Bizgaze.Apps.Transact.Components.FindandMatch.Instance()._Bankamount = instance.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);
let html = `<div class="bg-white modal-header find-match-header pa-10 model_find_and_match_div"><strong class="text-dark">Find & Match</strong>
</div>
<div data-simplebar class="simple-scroll-bar modal-body find-match-body" id="CardViewer_modal_` + id + `">
<span class="findandmatch_errormsg text-danger text-center" id="findandmatch_errormsg" ></span>
<div class="row">
<div class="cardbody rounded-4 col-6">
<div class="div_TransactionReconciliation_` + id + `" id="div_TransactionReconciliation_` + id + `">
<div id="div_TransactionReconciliation_details_` + id + `" class="card shadow-hover mb-0">
<div class="card-header card-header-action border-bottom-0 px-20">
<strong>
<span class="biz-highlight-bg-color" id="hf-div_TransactionReconciliation_details_` + id + `">Transaction To Reconcile</span>
</strong>
</div>
<div class="card-body py-0">
<div class="row">
<div class="col-md-12">
<ul class="list-group list-group-flush px-0" id="div_TransactionReconciliation_details_` + id + `_col1">
<li class="Twocolumn-listgroup-1-item Twocolumn-listgroup-1-addeditem li-0 px-0 py-2 detailProperty_` + id + ` widget_details_item` + id + `_col1" style="border-top: 1px solid rgb(243, 243, 243); font-size: 14px;">
<div class="d-flex justify-content-between align-items-center">
<span class="col-5 pl-0">` + instance.journalno + `</span>
<span class="text-overflow text-right d-none d-md-block" title="ledgeramount">` + instance.ledgeramount + `</span>
</div>
</li>
<li class="Twocolumn-listgroup-1-item Twocolumn-listgroup-1-addeditem li-1 px-0 py-2 detailProperty_` + id + ` widget_details_item` + id + `_col1" style="border-top: 1px solid rgb(243, 243, 243); font-size: 14px;">
<div class="d-flex justify-content-between align-items-center">
<span class="col-5 pl-0">` + instance.accountname + `</span>
<span class="text-overflow text-right text-danger d-none d-md-block" title="Spent">` + instance.action + `</span>
</div>
</li>
<li class="Twocolumn-listgroup-1-item Twocolumn-listgroup-1-addeditem li-1 px-0 py-2 detailProperty_` + id + ` widget_details_item` + id + `_col1" style="border-top: 1px solid rgb(243, 243, 243); font-size: 14px;">
<div class="d-flex justify-content-between align-items-center">
<span class="col-5 pl-0">` + instance.journaldate + `</span>
<span class="text-overflow text-right text-danger d-none d-md-block" title="journaldate"></span>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="cardbody rounded-4 col-6">
<div class="div_SelectedTransaction_` + id + `" id="div_SelectedTransaction_` + id + `">
<div id="div_details_SelectedTransaction_` + id + `" class="card shadow-hover mb-0">
<div class="card-header card-header-action border-bottom-0 px-20">
<strong>
<span class="biz-highlight-bg-color" id="hf-SelectedTransaction_` + id + `">Selected Transaction</span>
</strong>
</div>
<div class="card-body py-0">
<div class="row">
<div class="col-md-12">
<ul class="list-group list-group-flush px-0" id="div_details_` + id + `_col1">
<li class="Twocolumn-listgroup-1-item Twocolumn-listgroup-1-addeditem li-0 px-0 py-2 detailProperty_` + id + ` widget_details_item` + id + `_col1" style="border-top: 1px solid rgb(243, 243, 243); font-size: 14px;">
<div class="d-flex justify-content-between align-items-center">
<span class="col-5 pl-0">SubTotal</span>
<span class="text-overflow text-right d-none d-md-block subtotal-Value" title="subtotal-Value" id="subtotal_` + id + `">` + 0 + `</span>
</div>
</li>
<li class="Twocolumn-listgroup-1-item Twocolumn-listgroup-1-addeditem li-1 px-0 py-2 detailProperty_` + id + ` widget_details_item` + id + `_col1" style="border-top: 1px solid rgb(243, 243, 243); font-size: 14px;">
<div class="d-flex justify-content-between align-items-center">
<span class="col-5 pl-0">As Per Bank Statement</span>
<span class="text-overflow text-right d-none d-md-block" title="Personnel Costs">` + instance.bankamount + `</span>
</div>
</li>
<li class="Twocolumn-listgroup-1-item Twocolumn-listgroup-1-addeditem li-1 px-0 py-2 detailProperty_` + id + ` widget_details_item` + id + `_col1" style="border-top: 1px solid rgb(243, 243, 243); font-size: 14px;">
<div class="d-flex justify-content-between align-items-center">
<span class="col-5 pl-0">Total Is Out By</span>
<span class="text-overflow text-right text-danger d-none d-md-block outbyvalue_amount" title="Personnel Costs" id="outbyvalue_` + id + `"></span>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</br>
<span class="spn_bankrecon_errormsg text-danger text-center" id="spn_cpnaprl_errormsg" ></span>
<div class="card">
<input type="text" id="txt_accountname_refno_Org_search" class="form-control text-control required" style="width:100%;" placeholder = "Search" data-placeholder="Search"/>
<input type="hidden" id="hf_Coupon_Org_search" class="hf_txt_CouponSubmission_Org_search' form-control value-control" data-isdynamic="true"/>
</div>
<div class="card">
<div class="table-wrap card simple-scroll-bar bg-white-s bg-white-removed templateviewer-body" style="height:100% !important">
<div class="table-responsive tableFixHead dropdown-menu-scrollbar">
<table class="table table-hover table-bordered mb-0 tblreconciledata" id="tblreconciledata">
<thead>
<tr>
<th>Date</th>
<th>Name</th>
<th>Reference</th>
<th>ChequeNo</th>
<th>Spent</th>
<th>Received</th>
</tr>
</thead>
<tbody id="tblReconcile">
<tr class="ReconciliationDetails-list-items"> </tr>
</tbody>
</table>
</div>
<div class="d-flex justify-content-center">
<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>
</div>
</div>
</div></div>
<div class="bg-white modal-footer find-match-footer pa-10">
<a class="btn btn-light btn-sm btn-center mr-auto" id="btnClose">Close</a>
<a class="btn btn-primary btn-center btn-sm text-white" id="btnSave">Save</a>
<input type="hidden"id="bankreconciliationfromdate" />
<input type="hidden"id="bankreconciliationtodate" />
</div>`;
return html;
}
load(recdetailsid, containerid, callback) {
const instance = this;
pageIndex = 0;
Bizgaze.Apps.Transact.Components.FindandMatch.Instance()._oldId = "";
Bizgaze.Apps.Transact.Components.FindandMatch.Instance()._idscount = 0;
Bizgaze.Apps.Transact.Components.FindandMatch.Instance()._Unchkidscount = 0;
Bizgaze.Apps.Transact.Components.FindandMatch.Instance()._checkidscount = 0;
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/ledgers/ledgermanager.js", function () {
Bizgaze.Apps.Transact.Managers.LedgerManager.Instance().getBankReconcileById(instance.bankReconcileId).then(function (response) {
if (response.result != null) {
$("#bankreconciliationfromdate").val(response.result.FromDate);
$("#bankreconciliationtodate").val(response.result.ToDate);
Bizgaze.Apps.Transact.Components.FindandMatch.Instance().BankRecFromDate = response.result.FromDate;
Bizgaze.Apps.Transact.Components.FindandMatch.Instance().BankRecToDate = response.result.ToDate;
Bizgaze.Apps.Transact.Components.FindandMatch.Instance().getLedgerJournalEntryDetails(instance.ledgerid, 0, Bizgaze.Apps.Transact.Components.FindandMatch.Instance()._Bankamount, instance.ledgeramount, null, containerid, instance.bankReconcileId, recdetailsid);
}
});
});
$('#btn_reconciliationlist_load_more__modal_bizgaze_BRS').click(function () {
pageIndex++;
var term = $("#txt_accountname_refno_Org_search").val();
if (term == "" || term == null || term == undefined) {
term = "null";
}
Bizgaze.Apps.Transact.Components.FindandMatch.Instance().getLedgerJournalEntryDetails(instance.ledgerid, pageIndex, Bizgaze.Apps.Transact.Components.FindandMatch.Instance()._Bankamount, instance.ledgeramount, term, containerid, instance.bankReconcileId, recdetailsid, true);
});
$("#btnClose").click(function () {
instance.navigationHelper.closePopUp();
});
$("#txt_accountname_refno_Org_search").on("input", function () {
var term = $(this).val();
if (term == "" || term == null || term == undefined) {
term = "null";
}
pageIndex = 0;
Bizgaze.Apps.Transact.Components.FindandMatch.Instance()._oldId = "";
Bizgaze.Apps.Transact.Components.FindandMatch.Instance()._idscount = 0;
Bizgaze.Apps.Transact.Components.FindandMatch.Instance()._Unchkidscount = 0;
Bizgaze.Apps.Transact.Components.FindandMatch.Instance()._checkidscount = 0;
Bizgaze.Apps.Transact.Components.FindandMatch.Instance().getLedgerJournalEntryDetails(instance.ledgerid, pageIndex, instance.bankamount, instance.ledgeramount, term, containerid, instance.bankReconcileId, recdetailsid);
});
$("#btnSave").click(function () {
Bizgaze.Apps.Transact.Components.FindandMatch.Instance().saveAllselectedReconcilition(containerid, instance.journalId, Bizgaze.Apps.Transact.Components.FindandMatch.Instance()._Bankamount, reconciledata, instance.ledgerid);
});
}
init() {
}
getFindAndMatchDetails(id) {
var html = '';
}
getLedgerJournalEntryDetails(ledgerid, page, BankAmount, journalAmount, term, containerid, BankReconcileId, ReconciliationDetailsId, isViewAll) {
if (ledgerid != 0) {
var fromDate = "";
var toDate = "";
var cf_fromDate = Unibase.Platform.Helpers.NavigationHelper.commonFilter_FromDate;
var cf_toDate = Unibase.Platform.Helpers.NavigationHelper.commonFilter_ToDate;
let row = 0;
if (cf_fromDate != null && cf_toDate != null) {
fromDate = cf_fromDate.toString();
toDate = cf_toDate.toString();
}
else {
fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
}
$(".ReconciliationDetails-list-items").remove();
if (term !== "" && term !== "null") {
$(".ReconciliationDetails-item-active").remove();
}
var Fdate = moment(fromDate).format("YYYY-MM-DD");
var Tdate = moment(toDate).format("YYYY-MM-DD");
var BRCFromDate = moment(Bizgaze.Apps.Transact.Components.FindandMatch.Instance().BankRecFromDate).format("YYYY-MM-DD");
var BRCToDate = moment(Bizgaze.Apps.Transact.Components.FindandMatch.Instance().BankRecToDate).format("YYYY-MM-DD");
BankAmount = BankAmount;
journalAmount = journalAmount;
var UpdateAmount = Number(journalAmount);
var showPortalGroupWise = true;
if (page == 0) {
row = 5;
}
else {
row = 0;
}
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/ledgers/ledgermanager.js", function () {
Bizgaze.Apps.Transact.Managers.LedgerManager.Instance().getReconciliationData(ledgerid, BRCFromDate, BRCToDate, showPortalGroupWise, page, term, row).then(function (response) {
if (page == 0) {
$("#checkAll").prop('checked', false);
}
$("#btn_reconciliationlist_load_more__modal_bizgaze_BRS").addClass("hidden");
var totalRecords = 0;
$('._btnreconciliation_div').addClass('hidden');
if (response.result._rows.length != 0) {
$("#btn_reconciliationlist_load_more__modal_bizgaze_BRS").removeClass("hidden");
var _datetimehelper = Unibase.Platform.Helpers.DateTimeHelper.Instance();
var Stagestatusname = '';
var finalhtml = '';
totalRecords = response.result._totalRecords;
if (row <= 5 && Number(totalRecords) <= 5) {
$("#btn_reconciliationlist_load_more__modal_bizgaze_BRS").addClass("hidden");
}
if (row == 0 && Number(totalRecords) == 0) {
$("#btn_reconciliationlist_load_more__modal_bizgaze_BRS").addClass("hidden");
}
for (var i = 0; i < response.result._rows.length; i++) {
var data = response.result._rows[i];
var JournalId = Number(data.Cells[0]);
var JournalNo = data.Cells[1];
var JournalDate = moment(data.Cells[2], "DD-MM-YYYY").format("DD/MM/YYYY");
if (JournalDate == "Invalid date") {
JournalDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().serverDateformat(data.Cells[2]);
}
var ChequeNo = data.Cells[3];
var Credit = data.Cells[4];
var Debit = data.Cells[5];
var AccountName = "";
var JournalStatusId = data.Cells[7];
var LedgerID = Number(data.Cells[13]);
var FirstLedgerID = Number(data.Cells[20]);
var SecLedgerID = Number(data.Cells[21]);
if (LedgerID == FirstLedgerID) {
AccountName = data.Cells[14];
}
else if (LedgerID == SecLedgerID) {
AccountName = data.Cells[9];
}
var JournalEntryID = data.Cells[19];
var html = '';
var index = Number(i);
var j = Number(JournalId);
html += '<tr class="ReconciliationDetails-list-items ReconciliationDetails-item-active value-row li-' + j + '">' +
'<input type="hidden"id="recledgerid" value="' + JournalId + '" />' +
'<input type="hidden"id="bankreconcileid" value="' + BankReconcileId + '" />' +
'<input type="hidden"id="bankreconciliationdetailsid" value="' + ReconciliationDetailsId + '" />' +
'<input type="hidden"id="JournalEntryId" value="' + JournalEntryID + '" />' +
'<input type="hidden"id="bankbalanceamount" value="' + BankAmount + '" />' +
'<input type="hidden"id="ledgerid" value="' + LedgerID + '" />';
if (j == 0) {
html += '<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_">' + JournalDate + '</label></div></td>';
}
else {
html += '<td id="JournalDate_' + JournalId + '"><div class="" > <input type="checkbox" id = "transactionDate_checkbox_' + JournalId + '" name = "transactionRadio" class="chkReconciliaionStatus " > <label class="custom-control-label" for= "transactionDate_checkbox_' + JournalId + '" value=>' + JournalDate + '</label></div></td>';
}
html += '<td id="AccountName_' + JournalId + '">' + AccountName + '</td>' +
'<td id="JournalNo_' + JournalId + '">' + JournalNo + '</td>' +
'<td id="ChequeNo_' + JournalId + '">' + ChequeNo + '</td>' +
'<td id="Credit_' + JournalId + '">' + Credit + '</td>' +
'<input type="hidden"id="spentamount" value="' + Credit + '" />' +
'<input type="hidden"id="receivedamount" value="' + Debit + '" />' +
'<td id="Debit_' + JournalId + '">' + Debit + '</td>';
html += '</tr>';
$("#tblreconciledata tbody").append(html);
}
}
if (isViewAll) {
$("#btn_reconciliationlist_load_more__modal_bizgaze_BRS").addClass("hidden");
}
$('input:checkbox').click(function () {
var id = $(this).attr('id');
var element = $(this).closest("tr");
var jid = $(element).find("#recledgerid").val();
var isselected = $(element).find('.chkReconciliaionStatus').is(':checked');
if (isselected == false) {
$("#subtotal_" + Number(jid)).text("0");
subtotal = 0;
}
var jId = $(element).find("#recledgerid").val();
var LId = $(element).find("#ledgerid").val();
var amount = 0;
var Sp_amount = 0;
var Rd_amount = 0;
var spentamount = $(element).find("#spentamount").val();
if (Number(spentamount) != 0) {
var Credit = $("#Credit_" + jId).text();
amount = -1 * Number(Credit);
Sp_amount = amount;
}
var receivedamount = $(element).find("#receivedamount").val();
if (Number(receivedamount) != 0) {
var Debit = $("#Debit_" + jId).text();
amount = Number(Debit);
Rd_amount = Number(Debit);
}
Bizgaze.Apps.Transact.Components.FindandMatch.Instance().savereconcile($(this).closest("tr"), amount, containerid, Number(Sp_amount), Number(Rd_amount));
});
});
});
}
}
savereconcile(element, selectedamount, containerid, SP_Amt, Rd_amt) {
var Reconcile = new Array();
var isSelected = $(element).find('.chkReconciliaionStatus').is(':checked');
var reconcileno = 0;
var journalId = $(element).find("#recledgerid").val();
var LedgerId = $(element).find("#ledgerid").val();
var bankreconcileid = $(element).find("#bankreconcileid").val();
var bankreconciliationdetailsid = $(element).find("#bankreconciliationdetailsid").val();
var bankamount = Number($(element).find("#bankbalanceamount").val());
var JournalEntryId = $(element).find("#JournalEntryId").val();
var todayDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate();
var serverdate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatServerLocalDate(todayDate, "DD/MM/YYYY");
subtotal = Number(subtotal);
if (isSelected) {
reconcileno = 1;
if (Number(SP_Amt) != 0) {
subtotal = Number(subtotal) - (Number(selectedamount));
bankamount = -1 * bankamount;
}
else if (Number(Rd_amt) != 0) {
subtotal = Number(subtotal) + Number(selectedamount);
bankamount = 1 * bankamount;
}
if (Number(bankamount) == Number(subtotal)) {
$(".subtotal-Value").text(subtotal);
outbyvalue = bankamount - subtotal;
if (Number(outbyvalue == 0) && Number(SP_Amt) != 0) {
Bizgaze.Apps.Transact.Components.FindandMatch.Instance()._Bankamount = -1 * Bizgaze.Apps.Transact.Components.FindandMatch.Instance()._Bankamount;
}
$(".outbyvalue_amount").text(outbyvalue);
reconciledata.push({
JournalId: journalId,
ReconcileNo: reconcileno,
ReconcileDate: serverdate,
LedgerId: LedgerId,
ReconciliationDetailsId: bankreconciliationdetailsid,
BankReconcileId: bankreconcileid,
JournalEntryId: JournalEntryId
});
}
else {
subtotal = 0;
outbyvalue = 0;
$(".subtotal-Value").text(subtotal);
$(".outbyvalue_amount").text(outbyvalue);
$("#subtotal_" + journalId).text(subtotal);
$("#outbyvalue_" + journalId).text(outbyvalue);
MessageHelper.Instance().showError('Please selected valid amount', 'findandmatch_errormsg');
$(".chkReconciliaionStatus").prop('checked', false);
$("#transactionDate_checkbox_" + journalId).prop('checked', false);
if (Bizgaze.Apps.Transact.Components.FindandMatch.Instance()._oldId != "") {
Bizgaze.Apps.Transact.Components.FindandMatch.Instance()._idscount = 1;
Bizgaze.Apps.Transact.Components.FindandMatch.Instance()._checkidscount = 0;
Bizgaze.Apps.Transact.Components.FindandMatch.Instance()._Unchkidscount = 0;
}
}
}
var postData = reconciledata;
}
confirmreconcile(id, containerid, ledgerid, bankamount, ledgeramount, journalno, accountname, journaldate, BankReconcileId, JournalentryId, ReconcileDetailsId) {
if (Number(id) != 0 && Number(bankamount) == Number(ledgeramount)) {
var journalId = Number(id);
var LedgerId = Number(ledgerid);
var bankreconciliationdetailsid = Number(ReconcileDetailsId);
var bankreconcileid = Number(BankReconcileId);
var JEntryId = Number(JournalentryId);
var todayDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate();
var serverdate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatServerLocalDate(todayDate, "DD/MM/YYYY");
var Reconcile = new Array();
var reconcileno = 1;
Reconcile.push({
JournalId: journalId,
ReconcileNo: reconcileno,
ReconcileDate: serverdate,
LedgerId: LedgerId,
ReconciliationDetailsId: bankreconciliationdetailsid,
BankReconcileId: bankreconcileid,
JournalEntryId: JEntryId
});
var postData = Reconcile;
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/ledgers/ledgermanager.js", function () {
Bizgaze.Apps.Transact.Managers.LedgerManager.Instance().saveReconcile(postData).then(function (response) {
if (response.result != null) {
MessageHelper.Instance().showSuccess(response.message, '');
$(`#reportRefreshBtn_${containerid}`).trigger('click');
}
else {
MessageHelper.Instance().showError(response.message, 'findandmatch_errormsg');
}
});
});
}
else {
MessageHelper.Instance().showError("selected amount is (Bank Amount:" + Number(bankamount) + " Ledger Amount :" + Number(ledgeramount) + ") not matched go through the find and match or create new record", 'reconcile_errormsg');
}
}
RefreshReportsAndWidgets(Portletwidgetid, cid, ledgerid) {
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getPortletWidget(Portletwidgetid).then(function (widresponse) {
if (widresponse.result != null) {
var WidgetID = Number(widresponse.result.WidgetId);
var portletwidgetid = Number(widresponse.result.PortletWidgetId);
Bizgaze.Apps.Transact.Components.FindandMatch.Instance().linkReport(WidgetID, portletwidgetid, cid, ledgerid);
}
});
}
confirm_And_Action_Hide_and_Show(id, containerid, ledgerid, bankamount, ledgeramount, journalno, accountname, journaldate, BankFormatId, action, Value) {
if (Value.trim() == 'actions') {
$(".div_subdata_" + id).removeClass("hidden");
}
else {
Bizgaze.Apps.Transact.Components.FindandMatch.Instance().confirmreconcile(id, containerid, ledgerid, bankamount, ledgeramount, journalno, accountname, journaldate, BankFormatId, 0, 0);
}
}
linkReport(widgetid, portletwidgetid, cid, ledgerid) {
var instance = this;
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getKPIWidget(widgetid).then(function (response) {
var res = response.result;
if (res != null) {
let containerid = cid;
var rv_obj = Unibase.Platform.Analytics.Components.ReportViewer.Instance();
let ReplaceText = [];
ReplaceText.push({
Key: "ledgerid",
Value: String(ledgerid),
ExpOp: Unibase.Platform.Core.Enums.ExpressionOperator.Equals,
});
instance.inputParameters = ReplaceText;
var rv_obj = Unibase.Platform.Analytics.Components.ReportViewer.Instance();
rv_obj.inputParameters = instance.inputParameters;
Unibase.Platform.Analytics.Components.ReportViewer.Instance().getReportData(res.LinkReportId, containerid, null, null);
}
});
}
saveAllselectedReconcilition(containerid, journalId, bankamount, postData, LedgerId) {
const instance = this;
if (Number(bankamount) >= Number(subtotal)) {
if (Number(bankamount) == Number(subtotal)) {
$("#div_brs_" + journalId).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 () {
Bizgaze.Apps.Transact.Managers.LedgerManager.Instance().saveReconcile(postData).then(function (response) {
if (response.result != null) {
instance.navigationHelper.closePopUp();
MessageHelper.Instance().showSuccess(response.message, '');
const reconcileContainerId = instance.navigationHelper.getLastContainerId();
$(`#reportRefreshBtn_${reconcileContainerId}`).trigger('click');
}
else {
MessageHelper.Instance().showError(response.message, 'findandmatch_errormsg');
}
});
});
}
else {
alert("Amount Not Matched");
}
}
else {
MessageHelper.Instance().showError("Amount is greater than the bank amount", 'findandmatch_errormsg');
}
}
_dynaminReportClose() {
var detail_instance = Unibase.Themes.Compact.Components.Details.Instance();
var containerid = $("._bizgaze_detail_container:visible").attr("id");
var _installedAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
var portletid = detail_instance.unibase_core_activeportletid;
detail_instance.loadWidgets(_installedAppId, portletid, "#" + containerid + "");
}
ledgerreconcile(id, containerid, ledgerid, ledgeramount, journalno) {
if (Number(id) != 0) {
var journalId = Number(id);
var LedgerId = Number(ledgerid);
var ReconcileDate = $("#txt_RecconileDate_" + journalId).val();
var JDate = $("#txt_JournalDate_" + journalId).val();
var JournalDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatServerDate(JDate);
var todayDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate();
var serverdate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatServerDate(ReconcileDate);
var Reconcile = new Array();
var reconcileno = 1;
Reconcile.push({
JournalId: journalId,
ReconcileNo: reconcileno,
ReconcileDate: serverdate,
LedgerId: LedgerId,
JournalEntryId: 0,
JournalNo: journalno,
JournalDate: JournalDate
});
var postData = Reconcile;
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/ledgers/ledgermanager.js", function () {
Bizgaze.Apps.Transact.Managers.LedgerManager.Instance().saveLedgerReconcile(postData).then(function (response) {
if (response.result != null) {
MessageHelper.Instance().showSuccess(response.message, 'findandmatch_errormsg');
var cid = $('.' + containerid).attr("id");
var _ReportUniqueid = "Reportid_" + cid;
var _Reportid = $("#" + _ReportUniqueid).text();
Unibase.Platform.Analytics.Managers.ReportManager.Instance().getReportById(Number(_Reportid)).then(function (refresponse) {
if (refresponse.result != null) {
Unibase.Platform.Analytics.Components.ReportViewer.Instance().getReportData(refresponse.result.ReportId, containerid, null, null);
}
});
}
else {
MessageHelper.Instance().showError(response.message, 'findandmatch_errormsg');
}
});
});
}
}
getDateDetails(e, id) {
e.stopPropagation();
$("#txt_RecconileDate_" + id).daterangepicker({
locale: {
format: 'DD/MM/YYYY',
},
singleDatePicker: true,
showDropdowns: true,
minYear: 1901,
maxDate: new Date(2050, 11, 31)
});
}
AutoReconcileByAllMatchedData() {
var MatchedDate = [];
$(".btn_BrsRecActions:not(#btn_Bankconfirm_0):visible").each(function (i, e) {
MatchedDate.push($(e));
});
if (MatchedDate.length >= 1) {
bootbox.confirm("Are you sure ! You want to reconcile all matched data ? ", function (result) {
if (result) {
var Reconcile = new Array();
for (var i = 0; i < MatchedDate.length; i++) {
var confirmdata = MatchedDate[i];
var journalId = Number($(confirmdata).find('#hf_brsjournalid').val());
var cId = $(confirmdata).find('#hf_brscid').val();
var LedgerId = Number($(confirmdata).find('#hf_brsledgerid').val());
var bankreconciliationdetailsid = Number($(confirmdata).find('#hf_brsrecdetailsid').val());
var bankreconcileid = Number($(confirmdata).find('#hf_brsbankrecid').val());
var bankamount = Number($(confirmdata).find('#hf_brsbankbalid').val());
var ledgeramount = Number($(confirmdata).find('#hf_brsledgerbalid').val());
var JEntryId = Number(0);
var todayDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate();
var serverdate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatServerLocalDate(todayDate, "DD/MM/YYYY");
var reconcileno = 1;
if (Number(journalId) != 0 && Number(bankamount) == Number(ledgeramount)) {
Reconcile.push({
JournalId: journalId,
ReconcileNo: reconcileno,
ReconcileDate: serverdate,
LedgerId: LedgerId,
ReconciliationDetailsId: bankreconciliationdetailsid,
BankReconcileId: bankreconcileid,
JournalEntryId: JEntryId
});
}
}
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/ledgers/ledgermanager.js", function () {
Bizgaze.Apps.Transact.Managers.LedgerManager.Instance().saveReconcile(Reconcile).then(function (response) {
if (response.result != null) {
MessageHelper.Instance().showSuccess(response.message, 'findandmatch_errormsg');
var cid = $('.' + cId).attr("id");
var number = cid.match(/\d+/);
Bizgaze.Apps.Transact.Components.FindandMatch.Instance().RefreshReportsAndWidgets(Number(number[0]), cid, LedgerId);
}
else {
const containerId = $('._bizgaze_popup_container:visible').attr('id');
$(`#div_errors_reportviewer_${containerId}`).addClass('form-error-message');
MessageHelper.Instance().showError(response.message, `div_errors_reportviewer_${containerId}`);
}
});
});
}
});
}
else {
const containerId = $('._bizgaze_popup_container:visible').attr('id');
$(`#div_errors_reportviewer_${containerId}`).addClass('form-error-message');
MessageHelper.Instance().showError('matched records not found', `div_errors_reportviewer_${containerId}`);
}
}
unReconcile(id, containerid, ledgerid, bankamount, ledgeramount, journalno, accountname, journaldate, BankReconcileId, JournalentryId, ReconcileDetailsId) {
if (Number(JournalentryId) != 0) {
var journalId = Number(id);
var LedgerId = Number(ledgerid);
var bankreconciliationdetailsid = Number(ReconcileDetailsId);
var bankreconcileid = Number(BankReconcileId);
var JEntryId = Number(JournalentryId);
var todayDate = "0001-01-01 00:00:00";
var serverdate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatServerLocalDate(todayDate, "DD/MM/YYYY");
var Reconcile = new Array();
var reconcileno = 0;
Reconcile.push({
JournalId: journalId,
ReconcileNo: reconcileno,
ReconcileDate: serverdate,
LedgerId: LedgerId,
ReconciliationDetailsId: bankreconciliationdetailsid,
BankReconcileId: bankreconcileid,
JournalEntryId: JEntryId
});
var postData = Reconcile;
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/ledgers/ledgermanager.js", function () {
Bizgaze.Apps.Transact.Managers.LedgerManager.Instance().saveReconcile(postData).then(function (response) {
if (response.result != null) {
MessageHelper.Instance().showSuccess(response.message, 'findandmatch_errormsg');
var cid = $('.' + containerid).attr("id");
var number = cid.match(/\d+/);
Bizgaze.Apps.Transact.Components.FindandMatch.Instance().RefreshReportsAndWidgets(Number(number[0]), cid, LedgerId);
}
else {
MessageHelper.Instance().showError(response.message, 'findandmatch_errormsg');
}
});
});
}
else {
MessageHelper.Instance().showError("selected amount is (Bank Amount:" + Number(bankamount) + " Ledger Amount :" + Number(ledgeramount) + ") not matched go through the find and match or create new record", 'reconcile_errormsg');
}
}
static Instance() {
if (this._instance === undefined)
this._instance = new FindandMatch();
return this._instance;
}
}
Components.FindandMatch = FindandMatch;
})(Components = Transact.Components || (Transact.Components = {}));
})(Transact = Apps.Transact || (Apps.Transact = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long