The vendor test uses a fixed business name, so every run adds another vendor carrying it and the picker offers all of them. selectVendor required exactly one match and failed once a second run existed, taking TC-NLD-PO-001..003 with it. The Supplier ID recorded alongside the name is what separates the duplicates.
Also waits for the purchase order search to come back before reading rows. The search refetches the list on keyup, so fill() alone leaves the previous response on screen; the info line reports when the new one has been applied.
Drops the supplied Reference No approach and uniqueReference() with it -- orders are now told apart by comparing the references on file before and after the order is raised.
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com