吃午饭了, should 了 be right after 吃？ I saw this sentence from a text book:

你吃午饭了没有？
Have you had lunch yet?


Does the 了 have to be right after the verb 吃 though?

你吃了午饭没有？ 
Have you had lunch yet? 


I learned that 了 with verb represents tense, only when 了 is with verb.
However in the sentence given the 了 is after object of 吃, which is 午饭。

EDIT


吃（Verb) + 了 + 午饭（Noun) = Past tense, Correct.
吃 (Verb) + 午饭（Noun) + 了 = NOT Past tense.


I believe that the text book should've used the first one to indicate the past tense, unless the text book has some error, because it does say something like this.

你吃午饭了没有？ ： PAST TENSE


EDIT 2

As I wrote some comments under, I think I should make an additional edit here again.

There are a lot of articles about the usage of 了 I've read many times since I started learning Chinese.

But I'm not really curious about what 了 works here, but whether the translation of 了 is correct or not because this one looks quite suspicious to me.

I believe it is NOT correct to consider it a completion of a specific action, when 了 is used at the end of the sentence.

I believe it is correct to consider it a completion of a specific action, when 了 is used next to the verb and only next to the verb.

From that understanding, I believe it is NOT correct to translate 你吃午饭了没有 into "Have you eaten lunch?" because 了 is not used next to the verb, rather at the end of the sentence.

Am I right about it? or is there anything I am missing?
First of all, 
“吃午饭了” is usually used for "someone" to ask "someone" to have a lunch. Besides, it also can be meant that you already ate the lunch. 

While "吃了午饭 ” just mean that you already ate the lunch. 

Plus, there is no such thing like "吃了午饭没有“ It should be "你吃午饭了吗？” The "吗” is used for asking something.