I came to conclusion that cash flow statement should not be looking at underlying accounts behind receipts / payments linked to invoices.
Mostly because it adds another layer of complexity and makes it more difficult to see where the figures are coming from for very little marginal benefit.
I will go ahead with @WSD original idea and that is to allow users to pick cash flow statement group on individual receipts and payments to override default classification. This means when you are drilling-down to transactions from cash flow statement, it will be easy to recategorize individual receipts or payments if they belong elsewhere on cash flow statement.