[REF] spare a query
getInvoiceNumber returns NULL if the 'invoicing' setting is disabled, by checking slightly earlier
we can skip a query if it is not
Upgrade fix: Copy code to upgrade script rather than call a function.
The function will change as we fix the setting but we want the upgrade function to work off the old setting
Test fix: Use hard coded invoicePrefix
We know what it is - if it were not set right then the test would not pick it up because it is comparing
based on the assumption it is - using the string is more reliable