changed generate_order_number method for insure that generated numbers never finish #5102
Fix broken specs from order number refactoring, and improve performance. Fixes #5102