MT#5879 generate_invoices changes according to is_active flag removal.

Relative to changes 18b86b3ffde6 MT#5879 Remove template active as logic changed to
invoice per customer.
Is prepared to work with config from templates.