I guess we don't know what the actual figures are and are having to make assumptions plus we don't know what his % royalties are or what his contract says. But unless my understanding is completely out of date;
IF he got a £20 million advance he's got to sell a ridiculous amount of books before receiving extra royalties (which are presumably what he's agreed to give to charity?) If his contract says for e.g. he'll get 10% for every hardback at full price (£28?) he'd technically get £2.80 per book, but if being sold half price (which a lot of the sales seem to be) he might only get 5% or 70p per book. In which case he's got to sell a lot of books before that £20 million is paid back!
All those figures are made up but they do show that it's not as simple as wow, he's sold 400 000 books, he's made a fortune. It's more he made a fortune from the advance, the question is will the publisher make their money back. I guess the real test is how well it sells in the US, that's when the charity could make something from the royalties.