Spain: a convention on net income, and an 80% loan-to-value standard
Spain sets no statutory ratio. Ley 5/2019 obliges a lender to carry out a solvency assessment before granting a mortgage, but it publishes no number to pass, so the figure shown here, total loan payments below about a third of net income, is a market convention and is marked as one.
The constraint that does bite is on the other side of the transaction. Spanish lenders generally advance at most 80% of the lower of the purchase price and the valuation. Like the income convention, that 80% is standard bank practice rather than a figure in the statute, but it is applied so widely on a primary residence that it behaves like one. The phrase "the lower of" is the trap. If the bank's valuer comes in below the agreed price, the loan shrinks against the valuation while the price you owe the seller does not, and the difference has to come out of your own money on top of the deposit you had already planned for.
So a Spanish purchase usually fails on the deposit before it fails on the ratio. Clearing debts improves what the solvency assessment will bear, but nothing about your income ratio moves the 80% ceiling.
Income is assessed after tax. Enter take-home pay: applying a third-of-income convention to a gross salary would overstate what a Spanish bank will lend by roughly the size of your tax bill, and the valuation gap will already be doing enough damage.