Skip to content

Commit

Permalink
Cast result of getContributionBalance to float to match comment block.
Browse files Browse the repository at this point in the history
Without this it is possible for it to return 'null' which is not useful / in keeping. I did a bit of an audit &
did not find places where this would cause an === comparison to fail
  • Loading branch information
eileenmcnaughton committed Oct 26, 2019
1 parent cb4793e commit ee080cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CRM/Contribute/BAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -4166,7 +4166,7 @@ public static function getContributionBalance($contributionId, $contributionTota
$contributionTotal = CRM_Price_BAO_LineItem::getLineTotal($contributionId);
}

return CRM_Utils_Money::subtractCurrencies(
return (float) CRM_Utils_Money::subtractCurrencies(
$contributionTotal,
CRM_Core_BAO_FinancialTrxn::getTotalPayments($contributionId, TRUE) ?: 0,
CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', $contributionId, 'currency')
Expand Down

0 comments on commit ee080cf

Please sign in to comment.