The analysis of the collective risk model is a classical problem in the actuarial literature. The main feature studied is the probability that an insurance company will incur bankruptcy, given the initial capital and the premium inflow rate. The model was first introduced a hundred years ago as a compound Poisson model. Fifty years later, the exponential time was replaced with a renewal time and different properties were identified. Few years ago, the influence of financial mathematics, enriched the model with either Brownian motion or geometric Brownian motion that would represent either perturbations on the premiums rate or returns from a risky investment. For the analysis of the probability of ruin, integro-differential equations were written based on a specific time distribution and a given investment strategy. We have derived an equation for any renewal time distributions and any investment strategy. We can show that any previously obtained equations can be seen as a particular case of this equation and new higher order integro-differential equations can be derived for renewal time distributions with investments modeled by stochastic processes.