MT#5879 Make email invoices query simplier.

Remove redundant link through contract_balances to contracts.