By default, the "Check reference used" field on Stock information - Default tab  (Setup ribbon) is not selected (not ticked). This will not check if any matching references exists in the "Your reference" field of the "Document entry" screen for any open / unposted documents for the same document type. 

If you activate (tick) the "Check reference used" option, a warning message, is displayed:   

"The reference has been used in a other document! Please check your input for duplicates!

Click OK twice to save and exit the "Document entry" screen.