accounting: better strategy for grouping reference of internal invoices

Make sure we don't set grouping reference on lines that have a valid
group only for source (or destination) but not for the other side.
in 0 seconds, using 0 compute credits, and was queued for 0 seconds