essaytee
Need a good one-liner.
- Local time
- Today, 17:39
- Joined
- Oct 20, 2008
- Messages
- 544
Back tracking a little. Isn't that what the design stage is all about?
Upon researching how to handle currency exchange it became apparent that in effect currency exchange is similar to share trading and therefore the schema would be the same.
Share Trading concept : Value = share price * number of shares
Foreign Exchange concept: Value = exchange rate * amount
Generally then : Value = Unit Price * Quantity
As a result, I've decided to record everything (normal transactions, share trading etc.) by use of unit price and quantity within the Posting table.
From an application standpoint, when entering normal transactions there will be no reference to a quantity, it will default to 1. There should be no need to display it. On the other hand, if it's a share transaction or foreign currency exchange then quantity plays a role and depending upon whether it is a share trade or exchange rate scenario will dictate the labels used for quantity and unit price.
Here's my updated schema:
I've added further fields to the Accounts table but that doesn't mean they all have to be filled in. Not all accounts will be shares and therefore the Share ID (fk) will not be entered.
Some concepts in the early stages.
I've included a yes/no field "Account_Container". The idea is that a container merely holds other accounts within it but it itself cannot have transactions. A typical scenario is that of a broking account holding many shares (each share is a separate account).
The Account Container concept could also be considered a form of Account Type and therefore accounted for within the Account Type field.
"Account_Parent_ID" is a FK to the Account_ID within the same table. Two scenarios come to mind .
1. Create an Expense Account, Motor Car. Create other expense accounts, Petrol, Maintenance, Insurance etc. but for these accounts enter the Account_ID of Motor Car into the field, Account_Parent_ID. The user may elect to consider that the top level expense account of Motor Car can not be directed transacted, only it's sub-entries and this would be done by setting the Account_Container in the Motor Car account. I wouldn't but this is optional.
2. Create a Broking Account, "Etrade" and make it a Container only account. The purpose of this account is merely to hold actual share accounts. Create various share accounts making sure to enter the Account_ID of Etrade into the Account_Parent_ID fields.
The process of selling shares is still the same though I have removed the now redundant "tbl_Post_Shares_Traded" table as this information can be accounted for within the posting table. I have also removed reference to 'buy and sell' as this can be determined from the amount posted.
I've referenced currency exchange above but I haven't yet thoroughly run it through the schema. Also still to consider 'end of day' prices for shares.
This of course is still a work in progress.
Steve.
Upon researching how to handle currency exchange it became apparent that in effect currency exchange is similar to share trading and therefore the schema would be the same.
Share Trading concept : Value = share price * number of shares
Foreign Exchange concept: Value = exchange rate * amount
Generally then : Value = Unit Price * Quantity
As a result, I've decided to record everything (normal transactions, share trading etc.) by use of unit price and quantity within the Posting table.
From an application standpoint, when entering normal transactions there will be no reference to a quantity, it will default to 1. There should be no need to display it. On the other hand, if it's a share transaction or foreign currency exchange then quantity plays a role and depending upon whether it is a share trade or exchange rate scenario will dictate the labels used for quantity and unit price.
Here's my updated schema:
I've added further fields to the Accounts table but that doesn't mean they all have to be filled in. Not all accounts will be shares and therefore the Share ID (fk) will not be entered.
Some concepts in the early stages.
I've included a yes/no field "Account_Container". The idea is that a container merely holds other accounts within it but it itself cannot have transactions. A typical scenario is that of a broking account holding many shares (each share is a separate account).
The Account Container concept could also be considered a form of Account Type and therefore accounted for within the Account Type field.
"Account_Parent_ID" is a FK to the Account_ID within the same table. Two scenarios come to mind .
1. Create an Expense Account, Motor Car. Create other expense accounts, Petrol, Maintenance, Insurance etc. but for these accounts enter the Account_ID of Motor Car into the field, Account_Parent_ID. The user may elect to consider that the top level expense account of Motor Car can not be directed transacted, only it's sub-entries and this would be done by setting the Account_Container in the Motor Car account. I wouldn't but this is optional.
2. Create a Broking Account, "Etrade" and make it a Container only account. The purpose of this account is merely to hold actual share accounts. Create various share accounts making sure to enter the Account_ID of Etrade into the Account_Parent_ID fields.
The process of selling shares is still the same though I have removed the now redundant "tbl_Post_Shares_Traded" table as this information can be accounted for within the posting table. I have also removed reference to 'buy and sell' as this can be determined from the amount posted.
I've referenced currency exchange above but I haven't yet thoroughly run it through the schema. Also still to consider 'end of day' prices for shares.
This of course is still a work in progress.
Steve.