Added ability to retrieve invoice pdf and invoices can be emailed when inserting