fixes #170 (Hopefully this is time this is for real)

Modified assertion in test testRegressionFor170 so that it makes sense and fixes code to make sure the (correct) test pass.
The short story is that it is somehow complicated because we need to support cases where any form of existing invoices with any form
of billing events (forming the proposed events) should trigger a correct invoice.