Moved functionality to generate derived invoices to accountsync class