I think in that cases, the company should have some kind of authentic record that could prove them right in case if they have indeed donated money to a charity organisation. Companies get exempted from paying taxes when they, indeed, donate money to welfare organisations.
The problem is that some of them go about it in an illegal way just to avoid paying taxes and trying to have their books cooked up in a way that it will present something that look realistic which is something that is very wrong.