Thermodynamical foundations of large inelastic deformations of solid bodies including damage