Share Transfer

#1
I purchase some security on the behalf of my friend as he had no dmat account. Now he open dmat account and want to tranfer the same. But what is the stock price to calculate capital gain. Is it the price when purchase or the price on the date when transfered.
And what about the purchaser. is any thing for him regarding tax calculation