your friend will have 60 days grace period.if he can file a H-1b application before 31st,July. he will be fine.I think at most a few weeks the 20,000 quota will be availabe.