Skip to content

Commit

Permalink
Enotice fixes in campaign report
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Jul 23, 2016
1 parent b78230e commit 7ab16c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,16 @@ function alterIsPledge($value) {
function alterDisplay(&$rows) {
parent::alterDisplay($rows);

$move = $this->_columnHeaders['progress_still_to_raise'];
unset($this->_columnHeaders['progress_still_to_raise']);
$this->_columnHeaders['progress_still_to_raise'] = $move;
if (isset($this->_columnHeaders['progress_still_to_raise'])) {
$move = $this->_columnHeaders['progress_still_to_raise'];
unset($this->_columnHeaders['progress_still_to_raise']);
$this->_columnHeaders['progress_still_to_raise'] = $move;
}

$runningTotalRaised = $runningTotalLeft = 0;
$grandTotalRaised = $grandTotalLeft = 0;
foreach ($rows as $index => $row) {
if (is_numeric($row['civicrm_campaign_campaign_goal_revenue'])) {
if (isset($row['civicrm_campaign_campaign_goal_revenue']) && is_numeric($row['civicrm_campaign_campaign_goal_revenue'])) {
$runningTotalRaised += $row['civicrm_campaign_campaign_goal_revenue'];
$runningTotalLeft += $row['progress_still_to_raise'];
}
Expand Down
2 changes: 1 addition & 1 deletion CRM/Extendedreport/Form/Report/ExtendedReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ function storeGroupByArray() {
}
}
$this->calculateStatsFields();
$this->isForceGroupBy = (!empty($this->_statFields) && !$this->_noGroupBY);
$this->isForceGroupBy = (!empty($this->_statFields) && !$this->_noGroupBY && isset($this->_aliases[$this->_baseTable]));
// if a stat field has been selected then do a group by - this is not in parent
if ($this->isForceGroupBy && empty($this->_groupByArray)) {
$this->_groupByArray[] = $this->_aliases[$this->_baseTable] . ".id";
Expand Down

0 comments on commit 7ab16c3

Please sign in to comment.