8.0 add account cash discount compute ape

cc/ @adrienpeiffer 

PR to support internal review. Do not merge.
Use simplified copyright header everywhere (remove lines 7 to 14).