Getting a haircut-when?
If one has long hair it is a Mitzvah to cut it [any day prior to Shabbos] in order so one not enter into Shabbos in disgrace. Furthermore, it is a Mitzvah Min Hamuvchar to cut the hair specifically on Erev Shabbos and not beforehand. If however one will not have time to get a haircut on Erev Shabbos then he is to do so on Thursday.
When should one have a haircut on Erev Shabbos?
It is permitted to get a haircut throughout the entire Erev Shabbos, even past the time of Mincha. This applies even if one is giving a professional haircut and is doing so in exchange for payment, as it is recognizable to all that the haircut is being done in honor of Shabbos.
Midday: [Despite the above ruling] the Arizal would refrain from cutting his hair after midday, and hence would only take a haircut before midday on Erev Shabbos. Based on this, some Poskim rule one is to beware to take a haircut prior to midday. Others however rule that doing so is not required, and so is implied to be the opinion of Admur. Furthermore, some rule one is to try to have a haircut specifically past midday so it be recognizable he is doing so in honor of Yom Tov. Even according to the above stringent opinion, if one did not take a haircut prior to midday he may do so afterwards, although there are some that are stringent in such a case not to take a haircut.
 In order so it be evident that one is doing so for the honor of Shabbos. [ibid] If one has a valid reason for requiring a haircut during the week then he is not required to wait until Erev Shabbos. [Mahari Tzemach brought in Birkei Yosef 232/3; Kaf Hachaim 232/15]
 Due to being involved in the Shabbos preparations. [ibid]
As one is to proximate the haircut as much as possible to Shabbos in order so it be evident that it is being done for the sake of Shabbos. [ibid] There is no custom against cutting the hair on Thursday, as there is with nails, being that hair grows back the same day as it is cut. [Kuntrus Achron 260/1] However the Taz [260/1] rules that hair also begins growing back on the 3rd day as do nails and one is to thus avoid cutting them on Thursday. The Kaf Hachaim 260/15 argues on this ruling.
Admur 251/4; See Chapter 2 for the full details of this subject!
The reason: See Chapter 2 for the full details of this subject!
Custom of the Arizal brought in M”A 251/5
 Custom of the Arizal brought in M”A 251/5; Gr”a brought in AruchHashulchan 251/3; Kitzur Shulchan Aruch 128/15; Mateh Efraim 581/50; Mateh Efraim 625/11 “It is a Mitzvah Min Hamuvchar…”; Alef Lamagen 581/108 “Is a Mitzvah Min Hamuvchar”; KafHachaim 260/13; 581/80 [proper to be stringent]
 So rules also Aruch Hashulchan 251/3; Alef Lamagen 581/108 rules that the above ruling to take a haircut prior to midday is a Mitzvah Min Hamuvchar and if one did not do so beforehand then he may do so until Mincha Ketana. [Vetzaruch Iyun Gadol on the wording “Mincha Ketana” as everyone agrees a haircut may be taken the entire day.
The Magen Avraham 251/5 records that the Arizal would not get a haircut past the time of Mincha Gedola [midday], based on Kabalistic reasons. Admur omitted this custom of the Arizal in 251. See Shaareiy Halacha Uminhag 1/130 that the Rebbe concludes regarding the time of cutting nails, which is similar to the time of the cutting of the hair, that he did not receive a directive in how to follow. The Aruch Hashulchan ibid states that the Gra is stringent against allowing haircuts past midday, although this is not the wordly custom.
 Based on Aruch Hashulchan 260/6; See also 251/3
Mateh Efraim 625/11 “It is a Mitzvah Min Hamuvchar…”; Alef Lamagen 581/108 rules that the above ruling to take a haircut prior to midday is a Mitzvah Min Hamuvchar and if one did not do so beforehand then he may do so until Mincha Ketana. [Vetzaruch Iyun Gadol on the wording “Mincha Ketana” as everyone agrees a haircut may be taken the entire day.]
Mateh Efraim ibid based on Arizal that would refrain from cutting his hair after midday.