Implemented creation of invoices for invoice batches

Implemented creation of invoices for invoice batches to fix #1129.