A new project has an amount. It is always related to a client.One client can have many projects. And he may pay in steps for a particular project.In order to keep track of client payments, I've created a table namely client_ledger which contains information about date, time, amount, mode of payment & related project.But then in one of the software screens, I have to reports pertaining to a client's debit & credit.So there are 2 things that can be done :Either I can get the total amount of all projects of that client and his total payments & then can show how much balance is left to be paid.Or if I'd created an entry in the client_ledger table for DR, then as soon as a project is created, an entry is made in the table for DR and subsequent payments receivedwill be CRed into the data-base. In this case, if a project's amount is modified/edited later, then either the original DR entry has to be modified, or a new CR entry followed by the new project amount's DR entry should be made.Which of these processes should be followed ?
Should a DR & CR entry both be created or a single-entry accounting is fine
design patterns;database design