Sander, Vishwas,
Had a chat with john woodlock on this one to talk through it.
I guess one of the problems with the current approach is the journal entries table has this column called 'transaction_id' which is a varchar(50). It is not a unique column.
Probably the least effort approach would be still to retain the m_loan_transaction and m_savings_transaction tables and the inseting of manual accounting transactions directly into the acc_gl_journal_entry table but instead of having one 'transaction_id' column, would be possible to use three columns to represetn loan_transaction_id, savings_transaction_id, manual_entry_id?
The result should make it easier to query back to transaction tables without the needs for 'entity_type' concept.
If you wanted to have a secondary column for display purposes that still did the 'prepending' of something to the transaction id to differentiate transaction from loan/savings e.g. Could be a 'L' or a 'S' as opposed to a '1' or '0'.
|