@Pierre ********
Not quite true. The number of days is dependent on office. Some like Bangkok, Chiang Mai, Phuket, etc allow 45 days prior. Most allow 30. Some like Jomtien, Samui and Koh Phangan only allow 7 days prior.
Some offices require you to fill STM2 and STM9 as well. They’re not difficult to do and will be on hand at the office if needed.