Debit balance and credit balance in ledger formula. Add an extra table for the Category Name and Category Type.