MT#5879 Generate and/or send invoices script. Seems as working.

Testing is in progress.