Accounting for Developers (Part 1)

Towhid Raihan
SoftifyBD
Published in
3 min readOct 3, 2020

Hello, Today I am going to write something about accounting. As a developer when I was going to create an accounting application I was searching for resources here and there. But I didn’t find any developer friendly documentation anywhere which encouraged me to write something about it. So no more talk let’s see the business logic implementation of an accounting application —

Here in the picture, this is our database design. The journey will be started from AccountType which is a property of Accounts Table. I am using it as an integer because the value of this property is static (Asset, Income, Expense, Liabilities and Equity). I am managing it with an enumeration type.

Database Design

The next stages are Accounts and SubAccounts tables. So the steps will be like: We will create Accounts under Account Types and Sub Accounts under Accounts. I am giving an example here:

Chart of Accounts

In the above picture we can see Sub Accounts Cash On Hand, Bkash and Rocket under Account Cash which is under account type Asset. This view is called Chart of Accounts. You can get many resources about Chart of Accounts on internet.

Well these were the configuration level of our application. Now we will move to the core part of accounting named Transactions. We are using three tables to manage accounting transactions. The first one is TransactionTypes which can be Journal, Income, Expense etc. Then every time when a transaction will be done one row will be added to Transaction table and two or more rows will be added to GeneralLedgerEntries Table regarding that transaction. Lets see it with a simple example: Suppose a product is been sold for $1000 which was paid on cash. So the journal will be like the below picture and we will generate a row in Transactions Table and two rows in GeneralLedgerEntries Table, one is under Sub Account Cash On Hand, GeneralLedgerEntryType Debit(Enumeration Type), the Amount will be 1000 and another row for SubAccount Sale, GeneralLedgerEntryType Credit and Amount will be 1000.

Transaction Entry

Remember, for every transaction we have to ensure that in GeneralLedgerEntries the summation of the amount of all Debit type rows and the summation of the amount of all Credit type rows have to be same. Otherwise the system will be lost there.

To be continue…

--

--