EP-113: Generate an invoice number and store it into the database.