Unified theoretical description of the thermodynamical properties of spin crossover with magnetic interactions