Does prostatitis affect male fertility?

Prostatitis. Generally no effect on fertility since sperm are made in the testes. It is remotely possible if the storage site for semen (seminal vesicles) are scarred from inflammation.
Possibly. Prostatitis may cause an increase in the numbers of inflammatory cells in the ejaculate. This is turn can reduce sperm motility and hurt sperm function.