General practice dispute in Scotland ends with £531m funding boost