Fix Bug where Payment Balance is sometimes miscalculated
authoreileen <emcnaughton@wikimedia.org>
Fri, 14 Feb 2020 22:03:08 +0000 (11:03 +1300)
committereileen <emcnaughton@wikimedia.org>
Mon, 16 Mar 2020 05:04:38 +0000 (18:04 +1300)
commit4924bfe960e6f65edda8ad514e02e62ab497eb2f
tree6ab19df7c22d3ef8f5e036a5bcd96ea40bea6966
parentffdf4f946a31d2e29c86cb44eb205a383705dc12
Fix Bug where Payment Balance is sometimes miscalculated

I observed that when this function is called without the mystical  the paymentBalance is miscalculated

The payment balance is calculated as the Contribution Total less the amount paid (for less queries the
total is passed into getContributionBalance & used if passed in). We were passing in the Balance
as the total causing the balance to be calculated as the Balance less any amount paid.

From what I can tell this function has been honed & cleaned up but because the parameter never made much sense
the impact of different variants was not really tested. This removes & fixes
CRM/Contribute/BAO/Contribution.php