You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@fineract.apache.org by Ippez Robert <ip...@gmail.com> on 2017/05/15 09:42:43 UTC

Search Function for GL Accounts

Hi Dev,
Could someone please help me of which resource function i should use to
search for GL Accounts and return GL Code, GL Name for those GL Accounts
where manual entry is enabled.

Ideally, a user enters a GL Code in a text input field and on hitting enter
key (or pressing a search button), it calls for a function named
searchGLAccounts(). Now my challenge is how this searchGLAccounts()
function should be. Here is my sample code

*                      scope.searchGLAccounts = function () {*
* scope.actualGLAccounts = [];*
* scope.searchResults = [];*
* var searchString = scope.searchText;*
* if(searchString != null){*
* searchString = searchString.replace(/(^"|"$)/g, '');*
* var n = searchString.localeCompare(scope.searchText);*
* if(n!=0)*
* {*
* var exactMatch=false;*
* }*
* }*
* resourceFactory.accountCoaResource.get({glCode: searchString, template:
'true'}, function (data) {*
* var result = data;*
* var glaccount = {};*
* glaccount.glAccountId = result.glAccountId;*
* glaccount.name <http://glaccount.name> = result.name
<http://result.name>;*
*                    glaccount.glCode = result.glCode;*
* scope.actualGlAccount.push(glaccount);*
* scope.glaccounts = scope.actualGlAccount.slice(0,1);*
* });*
* }*

Your help on this will be appreciated higly.
Thanks
Regards


-- 
Ippez Roberts

Tel: +256788725408/789643284
Skype ID: ippez.robert1
Email: ippezrobert@gmail.com