Fix sales order number determination