The nonisentropic generalisation of the classical theory of Riemann invariants