Chart of Accounts (SOLVED)

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
mohd.documents
Posts: 58
Joined: Thu Sep 13, 2012 7:06 pm

Chart of Accounts (SOLVED)

Post by mohd.documents »

Hi,
I have a business object (Ac.Chart) and in the attributes there is a "Parent" , the type is "Account" witch is the name of the account itself (Assets, Liabilities, Income ....etc).
OK for example: I created -Assets- without parent, and I created -Fixed assets- with parent -Assets-
Until here there is no problem,

I created two queries, the parent is (Chart) and the child is (ChartDetails) and from expansions of rows I selected the query (ChartDetails).

In the child query (ChartDetails) and in the textual view of matching criteria I tried every rule that i know to make the parent only shows its children.
I hope that someone could help me with the right rule to solve this problem.

Regards
Mohd
Last edited by mohd.documents on Wed Jan 29, 2020 7:28 am, edited 1 time in total.
PointsWell
Posts: 1458
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Chart of Accounts ..

Post by PointsWell »

You don't need any rules.

Create a query called ChartHierarchy

Code: Select all

Find ChartDetails where ChartDetails.Parent =Chart
Then on query listing the highest levels allow row expansion and display the query ChartHierarchy
mohd.documents
Posts: 58
Joined: Thu Sep 13, 2012 7:06 pm

Re: Chart of Accounts ..

Post by mohd.documents »

@PointsWell
I have only one BO so I can not call (ChartDetails) from the code you provided, also I am a lit bit confused where to use the code in the parent query or child query?

Notes: I use the same BO for parent and child, the relationship type is the same BO

Appreciate your help.
mohd.documents
Posts: 58
Joined: Thu Sep 13, 2012 7:06 pm

Re: Chart of Accounts ..

Post by mohd.documents »

If any one made chart of account as tree, please guide us to the best way to accomplish this.
Thanks
PointsWell
Posts: 1458
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Chart of Accounts ..

Post by PointsWell »

You need two queries.

HeaderQuery

Code: Select all

FIND Ac WHERE Ac.Parent IS UNDEFINED
Set row expansion on this query to display a query select ChildQuery

ChildQuery

Code: Select all

Find Ac  where Ac.Parent =ThisAc
That's it.
BLOMASKY
Posts: 1472
Joined: Wed Sep 30, 2015 10:08 pm
Location: Ocala FL

Re: Chart of Accounts ..

Post by BLOMASKY »

I am not sure I would have a parent for the chart of accounts. Instead, how about 2 BOs. One called chartOfAccounts and it would have an attribute called "type" which is a peer relationship to the "accountType table. This gives you a lot of options. Can filter just on one AccountType, can sort and print by account type.

Using Aware, I tend to think of Parent Child where the child can NOT exist without the parent. I.e. Purchase Lines with Purchase headers. or Payroll transactions to employees.

I think of Peer relationship to catagorize or filter or sort. Also, with a chart of accounts, you will want more info in account type. I.e. is balance sheet or income & expense account.

You made it extra tough by trying to make the account a parent of account. There is no good reason to have only 1 BO. You can not post to "Assets", just accounts under assets.


Bruce
PointsWell
Posts: 1458
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Chart of Accounts ..

Post by PointsWell »

BLOMASKY wrote:I am not sure I would have a parent for the chart of accounts. Instead, how about 2 BOs. One called chartOfAccounts and it would have an attribute called "type" which is a peer relationship to the "accountType table. This gives you a lot of options. Can filter just on one AccountType, can sort and print by account type.

Using Aware, I tend to think of Parent Child where the child can NOT exist without the parent. I.e. Purchase Lines with Purchase headers. or Payroll transactions to employees.

I think of Peer relationship to catagorize or filter or sort. Also, with a chart of accounts, you will want more info in account type. I.e. is balance sheet or income & expense account.

You made it extra tough by trying to make the account a parent of account. There is no good reason to have only 1 BO. You can not post to "Assets", just accounts under assets.

Bruce
Respectfully I disagree Bruce. Charts of account are purely hierarchical structures with 4 roots

Asset
Liability
Revenue
Cost

Every account has to be related to this eg

Assets
-Real Estate
-Equipment and Machinery

Real Estate has child records potentially
Asset
- Real Estate
- - Office One
- - Office Two

Office One cannot exist distinct of Real Estate and Real Estate cannot exist distinct from Assets. Top level Accounts cannot have transactions associated with them but that is easy to filter out FIND Account WHERE Account.Parent IS DEFINED

What the OP will find is that he will need to update records in the hierarchy to obtain balances.
Last edited by PointsWell on Wed Jan 29, 2020 6:34 am, edited 1 time in total.
mohd.documents
Posts: 58
Joined: Thu Sep 13, 2012 7:06 pm

Re: Chart of Accounts ..

Post by mohd.documents »

Dear PointsWell,
That solved the problem :D

Thank you so much for your help.
Post Reply