For many years we worked on fixed price projects, almost exclusively. There were on-going monthly support contracts with many clients but when starting on new projects we would always estimate up front, agree to a fixed price on the entire piece of work and bill accordingly.
This would mean a deposit of 50%, and 50% on when the project was finished, regardless of how long the project took. Projects would sometimes span 4-6 months with no cash flow until the app was released. This can work well with a large cash injection at the start of the work, but can easily be derailed for a multitude of reasons.