This is exactly the same question as Orthogonal Projection of $ z $ onto the Affine set $ \left\{ x \mid A x = b \right\} $ except I want to project on only a half affine space instead of a full affine space.
The parameters $A$ and $b$ of the problem are as in the linked question : from this question we know that a projection of $z$ onto the affine subspace $\{x\mid Ax=b\}$ is given by :
$$x =z-A^T (AA^T)^{-1}(Az-b)$$
( we suppose here that $A$ has more columns than rows and is full rank, as in the quoted question).
What about the projection onto the half-space ?
What if I want the projections of $z$ onto the affine half-space or the full affine space, but regarding another scalar product than the canonical one, say the one related to a bilinear symmetric definite positive endomorphism given by a matrix $P$.