I agree with you that the current way FA is dealing with reference number is weird and doesn't work really well.
(my answer is a bit long, but there is a practical solution at the end ;-))
In most countries, invoice number have to be sequencial, so the tax man can spot "missing" invoices more easily.
FA used auto id from the database and that works fine. However, that doesn't give much freedom to the user which prefers a sexier invoice number.
This is why we have also a reference number, it's a free form field use to reference the invoice. The only constraint is it, has to be unique.
In theory you enter whatever you want, like using the current month and add the sequencial number within the month or anything else.
In practice, it doesn't work because you quickly endup with the problem you have, how do I know what is the reference number or if 2 peoples are entering an invoice at the same time what stop them to use the same ?
FA provides us with last reference number to solve this, however it only works if your reference number is a number but doesn't if you are trying to follow a pattern.
Morever, it even doesn't work with number, because we have the bug you just described. Trying to fix this bug will be equivalent to have an incremental number in the database, which already what the invoice number is.
The question is, if we are forced to use sequencial reference number (and there is no real choice in FA) what not then just using the invoice id ? That would will work, avoid the bug above and don't get people confused between invoice id and invoice ref.
What would be really nice in FA would be
1 - to have an option to use the invoice id as a reference number.
2 - Or have a way to specify reference number pattern so you could do things similar to a printf and use date, user etc ... This solution should be able to use emulate option 1.
In the mean time , what you can do is, if all your users are in the office, have them speaking to each other to avoid this problem
or use a physical reference number generator (to do FA jobs") : buy a couple of raffle book, give one to each user and ask them to use the number of the ticket as reference number. If they are not in the same city are buying themselves the raffle book, to be sure to avoid "collision" as them to add the city initial to the reference number.
/Elax