Maximum principal for a monthly budget

Invert the French payment formula: given a monthly budget, a term and an all-in rate (12-month Euribor + spread), how large can the loan be?

Key: banks also apply affordability rules, insurance and fees. This is the algebra only.