Generate invoices and store in postgresql database.