You can have references with the same number if you want.
However if a warning is not coming up that a reference number has already been used, check in theSetup tab of Debtors and make sure that the box for Warn if Duplicate Invoice Number is Used is ticked.