Truly accounting is not complex, it is always a Debit or a Credit, :) yes if it is an account of the debit tendency (eg. a customer) all debits are added, debits like Sale Invoices and all credits are subtracted, credits like Payment Received. On the other hand an account of credit tendency (eg. a supplier, an employee) all credits are added, credits like Purchase Bills, Pay Slips and all debits are subtracted, debits like Payment Made and Allowances Given.
If all your transactions have a date, that is half the problem solved. Next decide what tendency are the account for which calculation is done. I had the impression you are talking about an account where it is generally payable by the company that would make the account with a credit tendency, if so, add all the payments and allowances and debit (subtract) all the transactions that raise the reason for making the payments and allowances.
Hope it helps.