SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Database Design for Accounting Package Database.


Database Design for Accounting Package Database.

Author
Message
mandar.dasgupta
mandar.dasgupta
Grasshopper
Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)

Group: General Forum Members
Points: 24 Visits: 51
Hello everyone i am developing an accounts package for my company using Sql Server 2008 and VB.Net.

I need some help regarding the database design.

I have the following tables

AccountsGroupMaster

GroupId int
GroupName nvarchar(50)
ParentGroupId int
CatId int
PrimaryGroup bit
CreatedByUser nvarchar(50)
CreatedOn datetime

The above table will store the Groups for the accounts eg: Current Assets etc.

Accounts Table

AccCode nvarchar(6)
AccountName nvarchar(30)
ParentAcc nvarchar(6)
GroupId int

The above table stores the Accounts/Ledgers .
VoucherMain

VoucherNo bigint
VoucherDate datetime
DebitCredit int (0 for Credit 1 for Debit)
AccCode nvarchar(6) (Account Code to be debited/Credited)
UserID nvarchar(30)

VoucherDetails

VoucherNo bigint
SlNo int
AccCode nvarchar(6) (Debit this account if account in VoucherMain credited/ Credit this account if account in VoucherMain Debited)
Amount decimal(18, 2)
Narration nvarchar(MAX)



The above two tables store the transactions.The above two tables linked by the VoucherNo columns


Now my question is whether i should maintain all the bank accounts in the accounts table or should i have a separate table for the bank accounts.
As each bank account should have its respective ledgers.

Please help me in the design of this database.
thanks
mandar.dasgupta
mandar.dasgupta
Grasshopper
Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)

Group: General Forum Members
Points: 24 Visits: 51
Help needed,,,,,,please
PaulB-TheOneAndOnly
PaulB-TheOneAndOnly
SSChampion
SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)

Group: General Forum Members
Points: 13523 Visits: 4639
mandar.dasgupta (7/27/2013)
...Now my question is whether i should maintain all the bank accounts in the accounts table


'course you should.

_____________________________________
Pablo (Paul) Berzukov

Author of Understanding Database Administration available at Amazon and other bookstores.

Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
mandar.dasgupta
mandar.dasgupta
Grasshopper
Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)

Group: General Forum Members
Points: 24 Visits: 51
Thanks PaulB.

I have worked a little more and i showed it to our Accounts Head and he was reasonbly satisfied with it. However i ran into a little bit of trouble regarding vouchers with multiple debits and multiple credits.

My design takes care of Single Debit and multiple credits and single Credit and multiple debits.But i cant be sure in case of multiple debits and multiple credits.

eg.
VoucherMain

VoucherNo VoucherDate DrCr VType AccCode
2 2013-07-23 Credit 1 000002

VoucherDetails
VoucherNo SlNo AccCode Amount Narration
2 1 000005 6000.00 Purchase of table.
2 2 000012 5000.00 Purchase of drinks


In the above example the account/Ledger with code 000002 is credited with
Rs.11000 and the account/Ledger with code 000005 is debited with 6000
and the account/Ledger with code 000012 is debited with 5000.
The DrCr column specifies wether to credit or debit the account in VoucherMain table and the opposite happens to the accounts in the VoucherDetails Table.

The tables are linked with the voucherNo column.

So the above design is capable of handling single debit multiple credits
or single credit multiple debits.

I cant be sure about the multiple debits and multiple credit situation please suggest.
PaulB-TheOneAndOnly
PaulB-TheOneAndOnly
SSChampion
SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)

Group: General Forum Members
Points: 13523 Visits: 4639
mandar.dasgupta (8/3/2013)
Thanks PaulB.

I have worked a little more and i showed it to our Accounts Head and he was reasonbly satisfied with it. However i ran into a little bit of trouble regarding vouchers with multiple debits and multiple credits.

My design takes care of Single Debit and multiple credits and single Credit and multiple debits.But i cant be sure in case of multiple debits and multiple credits.

eg.
VoucherMain

VoucherNo VoucherDate DrCr VType AccCode
2 2013-07-23 Credit 1 000002

VoucherDetails
VoucherNo SlNo AccCode Amount Narration
2 1 000005 6000.00 Purchase of table.
2 2 000012 5000.00 Purchase of drinks


In the above example the account/Ledger with code 000002 is credited with
Rs.11000 and the account/Ledger with code 000005 is debited with 6000
and the account/Ledger with code 000012 is debited with 5000.
The DrCr column specifies wether to credit or debit the account in VoucherMain table and the opposite happens to the accounts in the VoucherDetails Table.

The tables are linked with the voucherNo column.

So the above design is capable of handling single debit multiple credits
or single credit multiple debits.

I cant be sure about the multiple debits and multiple credit situation please suggest.



I see no reason why table VoucherDetails couldn't describe multiple debits and credits.

_____________________________________
Pablo (Paul) Berzukov

Author of Understanding Database Administration available at Amazon and other bookstores.

Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search