accounting: support more cases of grouping internal invoices
The logic to guess groupable lines was considering source of destination side of an accounting transaction depending on preferences. This was not good, for two reasons:
- with internal transactions we want to consider both the source and the destination
- if user preferences are mis-configured, grouping would not work.
switch to a logic where we consider both source and destination sides to prevent these problems.