1
Vote

Debit and Credit don't balance

description

According to accounting practices all debits and credits should add up to zero (zero balance check).
 
In BaseAccount.cs method Credit look like this:
public decimal Credit(decimal amount, ITransaction transaction)
    {
        VerifyIsPositive(amount);
        if (Type == AccountType.ASSET
            || Type == AccountType.EXPENSE 
            || Type == AccountType.SUSPENSE)
        {
            return Modify(-amount);
        }
        else // LIABILITY or INCOME
        {
            return Modify(amount);
        }
}
 
It should rather look like this:
public decimal Credit(decimal amount, ITransaction transaction)
    {
        VerifyIsPositive(amount);
        return Modify(-amount);
    }
 
The same should be applied to the Debit method leaving the method looking like this:
public decimal Debit(decimal amount, ITransaction transaction)
    {
        VerifyIsPositive(amount);
        return Modify(amount);
    }
 
This will result in Credit == - and Debit == + as is defined by accounting principals and all accounts should also pass the zero balance test if this is implimented.
 
The spreadsheet will give smaple data on the above mentioned issue.

file attachments

comments