8.0 add account cash discount compute ape

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