In the event that a person forgets to daven, the possibility exists of their making tashlumim the next time they do so: if they forgot to daven maariv, they daven twice at shacharis; if they forgot to daven shacharis, they daven twice at mincha; if they forgot to daven mincha, they daven twice at maariv. In each of these circumstances, the first time that they daven it should be for the time that they are davening, and the second time should be for the one that they missed. If they daven in the wrong order, the first one does not count and they will need to daven a third time.
So, for example, if a person forgot to daven maariv, they need to daven shacharis the next morning and then follow it with the shemona esrei of maariv the night before. If they accidentally davened the maariv shemona esrei first, it doesn't count, such that after they have finished davening shacharis they are still going to need to daven the maariv shemona esrei.
[Source for the above]
But what happens if this is, for example, Shabbes? On Shabbes, one not only davens shacharis but afterwards davens mussaf. When should they make up for the forgotten maariv?
- Since mussaf, at least in theory, can be davened all day (source), should tashlumim take precedence over it?
- Alternatively, should mussaf follow shacharis as it usually does and tashlumim come afterwards?
Another way to phrase this question is as follows:
If a person forgot to daven maariv on erev shabbes, then made up for it by davening tashlumim the following morning right after shacharis, do they need to daven a fourth time after they have finished mussaf? What is the correct order of tashlumim on a shabbes or a yontef?