In my opinion, your book is assigning a black-and-white tense to every scenario, which isn't how English works. On corner cases like these, either one works. It really doesn't matter which one you use, but in spoken English at least, A) is more common than B). B) sounds a little less conversational, a little more formal.
Of course, if that flight was a month ago, you wouldn't use B). Interestingly, A) can still be used even when the flight is only mostly over!
Situations and what to say:
- Before the flight: "Will you/Are you going to have a good flight?" (we don't usually say those, since there's no good way to respond because it hasn't happened yet)
- During the flight: "Are you having a good flight (so far)?"
- At the end of the flight: "Did you have/Have you had a good flight?" (asking about what's already happened)
- Recently after the flight: "Did/Have" (but more often "did")
- A long time after the flight: "Did you have a good flight?"