8.0 add account cash discount compute ape

cc/ @adrienpeiffer 

PR to support internal review. Do not merge.
not necessary for 8.0