I recently had a customer pay an amount that included a credit on one of their entities & debits from another entity. At the moment this is not possible and processing a Contra transaction is just a waste of time.
Unfortunately the database cannot manage this scenario given the table relationship between payments and customers (names).