Hello Everyone,
I'd like to implement an accounting system with my programs and would like some input from someone more experienced than myself! Any advice of how you design compared to what I'm doing would be greatly, greatly appreciated.
Requirements: Accounts Receivable, Accounts Payable, General Ledger(Double-Entry), Company, Division. I need to be able to post and match partial/full payments/receipts to AP/AR. I need to see beginning balance(monthly) and monthly closings while updating the new beginning balance. And there's alot more but I need to get a solid core accounting design first with the minimums and work from there. I want to start off on the right foot first though and would enjoy any opinions! So here's what I'm thinking so far based on what I've seen and read. Please note the table and fieldnames are for clarity and not to be construed as my actual naming conventions
tblMainAccout
ActId int No Duplicates
ActNum int No Duplicates
ActName char No Nulls
ActBal money No Nulls Default 0
FK_ActTypeID -normal balance Debit/Credit
FK_ActCodeID -Asset,Liability,Revenue,Expense,Equity
The SubAccount table will be updated by the SubAccount monthly. After the update that's the only exact point in time they are identical in that total debits/credits = the subaccount total debits/credits. New transactions for the month are only updated to the tblsubaccount and this table will contain the current balace at any point in time. I think this way I can get a beginning and current ActBalance without having to recalculate, easier reporting, and just a checks and balance system that I may verify at any given point... etc. even though it violates normalization.
tblSubAccout
ActId int NO Duplicates
ActNum int No Duplicates
ActName char No Nulls
ActBal money
FK_ActType -normal balance Debit/Credit?
FK_ActCode -Asset, Liability,Revenue,Expense,Equity
How I see it is..The MainAccount[ActNum] field can contain only numbers in a valid range for the chart of accounts say 10000000 - 9999999. All Account numbers added to the MainAccount will be added to the SubAccount table also. The difference being in the sub account table, additional actnum (like in AP VendorAccount#, in AR CustomerAccount#, JC/job costing#, etc) can be added outside(and inside for subsidiary G/L accounts) of this range but in a child relationship with the actnum being the sum of all child balances.
So I guess you could say the SubAccount is the current detail(and at month-end exact detail) of the MainAccount. With me? I'm still trying to picture this myself.
Now for the transactions that make up the ActBal. I'm thinking like an invoicing system where an invoice object is made up of a headertable and so I create one for the accounting transaction.
tblTransactionHeader
PK_HeaderId int
Date -DateTime/Transaction Date
Code -Journal Code-AP,AR,JC(JobCost),PR(PayRoll),GJ(GenJournal)
Reversing -Boolean
Description varchar
In the most simple transaction, there should be at least two items (one debit and one credit) that update their respective accounts. The relationship will be one HeaderId to many ItemId's. So I have table like this.
tblTransactionItems
PK_TransactionItemID int
FK_HeaderID int
Amount money
DueDate date/time Nulls allowed
FK_tblSubAccount/ActID
FK_tblSubAccount/ActID
So now I can add multiple-account transactions for one accounting process such as Sales. For example a non-inventory credit sale of $10 with 5% tax. Credit ActId for Sales $10, ActId for SalesTax Payable $.50, Debit ActId for Accounts Receivable $10.50. Three transaction items related to one Transaction Header. Let's say the very next transaction is a payment received from the customer for $10. I would create a new transaction with the two items- debit to the cash ActID and a credit to the customers Acccounts Receivable ActID (which should be a child of a Parent Accounts Recievable SubAcount/ActId) each for $10. After a few sales assume the customer pays taxes on some sales and not others, by looking at the data so far I have no Idea which transaction matches with the others. If other words, which payment is paying off which debt? And on the Payables side which debt is being exausted by which payment.
So an additional table for the core accounting design would be a table that matches payments to debts whether AP or AR like so..
tblTransactionMatching
FK_TransactionItemID/Payment
FK_TransactionItemID/Debt
Amount Money >0
Entries in this table would follow: For AP the FK_TransactionItemID/Payment would point to the current TransactionItem for cash going out and FK_TransactionID/Debt would be a historical TransactionItemID for the accrued debt. The amount is the portion of debt being extinguished; For AR the FK_TransactionItemID/Payment would be the current TransactionItem for cash coming in and FK_TransactionID/Debt would be a historical TransactionItemID
Does this sound like a solid core design or close to other industry standard core accounting designs? If so/not do you have any suggestions?
How would I implement multiple companies that have any number of divisions without having to create individual MainAccount and SubAccount tables for each?
Any suggestions or discussions are welcomed and encouraged. Thanks.
I'd like to implement an accounting system with my programs and would like some input from someone more experienced than myself! Any advice of how you design compared to what I'm doing would be greatly, greatly appreciated.
Requirements: Accounts Receivable, Accounts Payable, General Ledger(Double-Entry), Company, Division. I need to be able to post and match partial/full payments/receipts to AP/AR. I need to see beginning balance(monthly) and monthly closings while updating the new beginning balance. And there's alot more but I need to get a solid core accounting design first with the minimums and work from there. I want to start off on the right foot first though and would enjoy any opinions! So here's what I'm thinking so far based on what I've seen and read. Please note the table and fieldnames are for clarity and not to be construed as my actual naming conventions
tblMainAccout
ActId int No Duplicates
ActNum int No Duplicates
ActName char No Nulls
ActBal money No Nulls Default 0
FK_ActTypeID -normal balance Debit/Credit
FK_ActCodeID -Asset,Liability,Revenue,Expense,Equity
The SubAccount table will be updated by the SubAccount monthly. After the update that's the only exact point in time they are identical in that total debits/credits = the subaccount total debits/credits. New transactions for the month are only updated to the tblsubaccount and this table will contain the current balace at any point in time. I think this way I can get a beginning and current ActBalance without having to recalculate, easier reporting, and just a checks and balance system that I may verify at any given point... etc. even though it violates normalization.
tblSubAccout
ActId int NO Duplicates
ActNum int No Duplicates
ActName char No Nulls
ActBal money
FK_ActType -normal balance Debit/Credit?
FK_ActCode -Asset, Liability,Revenue,Expense,Equity
How I see it is..The MainAccount[ActNum] field can contain only numbers in a valid range for the chart of accounts say 10000000 - 9999999. All Account numbers added to the MainAccount will be added to the SubAccount table also. The difference being in the sub account table, additional actnum (like in AP VendorAccount#, in AR CustomerAccount#, JC/job costing#, etc) can be added outside(and inside for subsidiary G/L accounts) of this range but in a child relationship with the actnum being the sum of all child balances.
So I guess you could say the SubAccount is the current detail(and at month-end exact detail) of the MainAccount. With me? I'm still trying to picture this myself.
Now for the transactions that make up the ActBal. I'm thinking like an invoicing system where an invoice object is made up of a headertable and so I create one for the accounting transaction.
tblTransactionHeader
PK_HeaderId int
Date -DateTime/Transaction Date
Code -Journal Code-AP,AR,JC(JobCost),PR(PayRoll),GJ(GenJournal)
Reversing -Boolean
Description varchar
In the most simple transaction, there should be at least two items (one debit and one credit) that update their respective accounts. The relationship will be one HeaderId to many ItemId's. So I have table like this.
tblTransactionItems
PK_TransactionItemID int
FK_HeaderID int
Amount money
DueDate date/time Nulls allowed
FK_tblSubAccount/ActID
FK_tblSubAccount/ActID
So now I can add multiple-account transactions for one accounting process such as Sales. For example a non-inventory credit sale of $10 with 5% tax. Credit ActId for Sales $10, ActId for SalesTax Payable $.50, Debit ActId for Accounts Receivable $10.50. Three transaction items related to one Transaction Header. Let's say the very next transaction is a payment received from the customer for $10. I would create a new transaction with the two items- debit to the cash ActID and a credit to the customers Acccounts Receivable ActID (which should be a child of a Parent Accounts Recievable SubAcount/ActId) each for $10. After a few sales assume the customer pays taxes on some sales and not others, by looking at the data so far I have no Idea which transaction matches with the others. If other words, which payment is paying off which debt? And on the Payables side which debt is being exausted by which payment.
So an additional table for the core accounting design would be a table that matches payments to debts whether AP or AR like so..
tblTransactionMatching
FK_TransactionItemID/Payment
FK_TransactionItemID/Debt
Amount Money >0
Entries in this table would follow: For AP the FK_TransactionItemID/Payment would point to the current TransactionItem for cash going out and FK_TransactionID/Debt would be a historical TransactionItemID for the accrued debt. The amount is the portion of debt being extinguished; For AR the FK_TransactionItemID/Payment would be the current TransactionItem for cash coming in and FK_TransactionID/Debt would be a historical TransactionItemID
Does this sound like a solid core design or close to other industry standard core accounting designs? If so/not do you have any suggestions?
How would I implement multiple companies that have any number of divisions without having to create individual MainAccount and SubAccount tables for each?
Any suggestions or discussions are welcomed and encouraged. Thanks.