![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm working on a dual entry bookkeeping system, and want to track transactions (not the db kind) occuring on accounts. I group these transactions in 'entries', to add common attributes and so on, but that's probably not relevant for this discussion. Thing is, I'd like to structure my chart of accounts as a hierarchy, e.g. Expenses / Cars / Volvo / Gas, and whenever i tank up the Volvo, I'd also like the expenses total to change. To make this happen, I'm thinking a view that duplicate transactions for all of the accounts' ancestors might do the trick? Updating multiple locations certainly isn't an option. Which data structure would you suggest for my chart of accounts? I assume that being able to efficiently select all ancestors for a node is fairly important? Perhaps there are even better structures than a tree for grouping accounts? This is the kind of thing views are used for, right, and performance shouldn't be too bad? I'm using postgres 8.1.something. On a final note; how should I go about being 100% sure the transactions in an 'entry' sum up to zero? (yup, this belongs on the application level, but nm that for now) Any replies appreciated, Isak |
#3
| |||
| |||
|
#4
| |||
| |||
|
#5
| |||
| |||
|
#6
| |||
| |||
|
|
As an accountant, I use the term transaction for items posted to the general ledger. |
#7
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |