Translation:Shulchan Aruch/Orach Chaim/268
1. The Laws Governing One Who Errs in the Shabbos Prayers, 13 Seifim: We say Vayechulu during Ma'ariv.
2. If one errs and begins to say the weekday prayer (Amidah), one finishes that blessing wherein he realized he erred and then begins the Shabbat prayer. It does not matter if he remembers in the blessing 'Atah Chonen' or if he remembers in one of the other blessings, whether in the Evening Prayer or the Morning prayer, Musaf or Minchah. There are those who say that in Musaf, one pauses even in the middle of the blessing.
3. If one is certain that it is a weekday and he begins the weekday amidah, and immediately when he says the first letter he realizes, before he says 'Chonen' that he is saying the weekday prayer, he finishes that prayer. However, if he knew that it is Shabbat and without the appropriate intention begins the word 'atah', even if he is in the morning prayer where we do not open with 'atah', he does not finish the blessing 'atah chonen' because it is considered as an error in the prayer of Shabbat, whether this or that. RAMA: Because he can say 'atah kidashta' or 'atah echad' (Terumat Hadeshen Siman 14).
4. He who prays the weekday prayer on Shabbat and does not go back and say the Shabbat prayer, has not fulfilled his oligation, and if he is reminded and mentions 'shel shabbat' during the Shmoneh Esrei, even though he did not designate a separate blessing for Shabbos, he fulfills his obligation. RAMA: In Musaf, even though he only says 'ונעשה לפניך את חובותינו' during the tamid offerings of the day and the sacrifice of Musaf, he has fulfilled his obligation. (Beis Yosef Siman 286 in the name of the Rosh, perek Mi Shemetu)
5. If one errs and prays the weekday prayer during Shabbat and does not mention Shabbat, if he left the place where he stood in prayer he goes back to the beginning, and if he did not leave his place, even if he finished his prayer, he must return only to the beginning of the blessing for Shabbos (and regarding the Chazan that forgets the blessing for Shabbat in the morning prayer, see above Siman 126).
6. If one errs in the amidah of Shabbat and recites one in the midst of the other, he does not return (to the beginning). And there are those who say that if he recited the amidah for Musaf or another prayer during Musaf he goes back.
7. We go back to say 'Vayechulu' when Yom Tov falls on Shabbat because we do not say it in the amidah, and also one who does not know how to recite it may fulfill his obligation [by listening to its recitation], and he says it loud while standing.
8. And the chazan says one blessing from the seven, and one praying alone does not say it. RAMA: Meaning? If one praying alone wants to be stringent on himself one may say it without an opening and closing (blessing) and such is our custom for the congregation to say it with the chazan without an opening or closing (Avudraham and Kol Bo).
9. When Yom Tov falls on Shabbat we do not mention Yom Tov in the seven blessings (meaning, in the blessings kel elyon and koneh, etc.)
10. We do not say one blessing that encapsulates the seven [blessings of the Shemoneh Esreh] in the house of newlyweds or mourners because there is not a reason for others to come and to [potentially] be injured [on the way to come to a mitzvah] [See Pesachim 8a].
11. During the Shabbat after Yom Tov we say the one blessing that encapsulates the seven.
12. One must not talk when 'Vayechulu' is being said nor when the chazan says the one blessing that encapsulates the seven.
13. If one prays the weekday amidah and does not mention Shabbat, or if one does not pray at all and hears from the chazan the one blessing that encapsulates the seven from the beginning to the end, he has fulfilled his obligation.