Topic: bank accounts

As per the bank accounts wiki page, I have created a liability GL account for a credit card, and am trying to link a bank account to it.  When I do this, I get the error

The GL account selected is already in use. Select another GL account.

I got the same problem when trying to add a 2nd bank account, but I was able to work around the issue by changing the existing petty cash bank account.

Seems like it should be straightforward, but I am clearly missing something?

Re: bank accounts

bobloblian wrote:

I got the same problem when trying to add a 2nd bank account, but I was able to work around the issue by changing the existing petty cash bank account.

Hm... no.  primary bank account is 1060, add a second GL account 1061.

Make a journal entry and move some money out of 1060 and in to 1061.

Go under Banking and General Ledger=>bank accounts=>edit petty cash=>change account name to savings=>change bank account GL code to 1061.

go under Banking and General Ledger=>Banking Reports=>Bank Statement=>get empty report.

check the general ledger reports, can see the transaction in GL Account Transactions and List Journal Entries.

Re: bank accounts

Wiki-ed it.

Re: bank accounts

sorry apmuthu, I think you misunderstood.  that was not a solution, but the steps I took to produce the problem

I still cannot add another bank account, if I try it tells me the GL account is already in use even though no other bank account is using the GL account number I am trying to link.

Changing the existing bank account to a different GL account produces an empty report when you try to get a bank statement.

5 (edited by apmuthu 02/14/2015 06:12:36 am)

Re: bank accounts

Please provide the before and after sql backups differences so that it can be matched against any other means of inclusion.
Added screenshots on my take.
Removed Wiki inclusion.

Although Credit Card Account used to make payments to suppliers is actually a liability account, it may need to be treated as a checking account (Asset) in FA to be usable.

Post's attachments

CreditCard_Accounts.zip 35.7 kb, 7 downloads since 2015-02-14 

You don't have the permssions to download the attachments of this post.

Re: bank accounts

Hi Apmuthu,

Thanks once again for your assistance.  Soon I will owe you a lot of beers...

I did solve it.  The trick is you can't create a bank account unless the GL account is empty when you start.  Since I was trying to turn existing GL accounts that already had transactions in them into bank accounts, it failed.

Sorry for the noise...

Re: bank accounts

@:bobloblian: Your kind of persistence and feedback is what makes FA what it is. The info has been wikied.

@joe: Any logic in this condition needs to be wikied so that when we re-visit it in FA 2.4 we can make better workflows.

Re: bank accounts

I guess we can make a better eror string like 'The GL account selected is already in use or has transactions. Select another empty GL account.'

Joe

Re: bank accounts

@joe: The error string would be quite explanatory, but what was the need to check if there were transactions prior to it's assignment to the Bank Account? Is it not sufficient to check if it was just already allotted to some other Account?

Re: bank accounts

It is more clean if the account is empty. Much easier to check the bank account against the GL account.

Joe

Re: bank accounts

Lines 36 to 41 in gl/manage/bank_accounts.php:

    if ($Mode=='ADD_ITEM' && (gl_account_in_bank_accounts(get_post('account_code')) 
            || key_in_foreign_table(get_post('account_code'), 'gl_trans', 'account'))) {
        $input_error = 1;
        display_error(_("The GL account selected is already in use. Select another GL account."));
        set_focus('account_code');
    }

Line 39 above can have the error message modified as @joe stated or the if statement modified to be more tolerant like:

    if ($Mode=='ADD_ITEM' && (gl_account_in_bank_accounts(get_post('account_code')) )) {
        $input_error = 1;
        display_error(_("The GL account selected is already in use. Select another GL account."));
        set_focus('account_code');
    }

Re: bank accounts

@apmuthu.

The key_in_foreign_table checks that there are no transactions on the GL account.

Just to ensure that the transactions on he bank account are mirrored on the GL account without having other transactions.

Joe.

Re: bank accounts

For the sake of completing the whole story from the point of view of a guy who read the wiki page then tried to do what the program would let him do:

I had already created the GL acct (1061) and made journal entries for my 2nd bank account before I found I could make it as a bank account.  When I tried to add it, I could not.  but there was an existing bank account called petty cash (gl acct 1065).  I edited that bank account to use gl acct 1061 instead, but when I ran a bank statement report, it gave me nothing.  Today, I can get a report, but it seems to only report on journal entries I have made since yesterday, so it isn't a complete report of activity in gl acct 1061.  Given that the program let me do this I would (and did) think something was broken had I not been looking for some problem

Based on apmuthu's response, I created another gl acct 1062, and I was able to make a bank account tied to this gl acct.  I have made no transactions on this gl acct, but today I cannot delete it, I get this error:

Cannot delete this bank account because transactions have been created using this account.

But there really are no transactions in it.  if I run a bank statement report, it is empty, and there are no journal transactions on gl acct 1062.  So not sure if that is by design, seems like I should be able to delete it.

Though I cannot delete the account, I can modify it to have a different GL account.  This differs from the original petty cash bank account for gl acct 1065 that I modified to gl acct 1061.  I can no longer change the gl acct for that account, which given that the  bank account actually does show transactions now, it makes sense.

While I cannot delete the bank account for glacct 1062, I can successfully inactivate it.

So I guess the way forward is to not delete the bank account for gl acct 1062, use journal entries to move everything from gl acct 1061 to 1062, and deactivate the bank account for gl acct 1061 so it is not listed.  Rinse and repeat for the Visa...

so; summary of suggestions:
-The error message should read as Joe suggests; I would have understood that.
-A user should not be able to modify an existing bank account to use a gl acct that has transactions in it for the same reason he cannot create it.  Same error should be displayed
-If there is a legitimate reason that a bank account cannot be deleted after it is created even when empty, a note should be made on the wiki page warning that it is a non-reversible action, and perhaps a popup warning in the program as well.
-if there are conditions where a bank account can be deleted, it would be useful to have them mentioned in the error message, or have the error message contain a link to a wiki page with explanation.
-On the wiki's getting started page, it mentions setting up bank accounts as part of the POS system, it might be a good idea to have mention that one should also set up bank accounts for each real bank account and visa account.

I want to express gratitude; I am finding this program to be pretty awesome.  Thanks for writing it, and thanks for taking the time to engage me in discussion on these boards...

14 (edited by apmuthu 02/17/2015 07:26:35 am)

Re: bank accounts

@bobloblian: Just check if the wiki is worded as desired:

http://frontaccounting.com/fawiki/index … nkAccounts

Re: bank accounts

@apmuthu
Based on the assumption that what is happening on my install is happening on everybody else's install, I would suggest this text:

At the moment (FA v2.3), the GL Account should not have any transactions for it to be used as a Bank Account. Once assigned to a Bank account (or a Credit Card Account), the GL Account cannot be deleted within FrontAccounting.

read like this:

At the moment (FA v2.3) the following conditions are true:
1. you cannot create a bank account using a Bank Account GL Code where the GL account has existing transactions.  You must begin with an empty GL account
2. When editing an existing Bank Account, it is possible to change the Bank Account GL Code to use a GL account that does have existing transactions, but Reports=>Bank Statements will not include any of those pre-existing transactions.
3. Once created, a bank account cannot be deleted.

Re: bank accounts

Hope this suffices:

http://frontaccounting.com/fawiki/index … nkAccounts

Re: bank accounts

you are awesome, thank you