From: Rohan Katkar Date: Tue, 19 Aug 2014 16:11:44 +0000 (+0530) Subject: Fix for CRM-15136 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a38dd72d028744f99c344b7fbe336059aea1791e;p=civicrm-core.git Fix for CRM-15136 --- diff --git a/CRM/Report/Form/Event/Income.php b/CRM/Report/Form/Event/Income.php index 0f6323c053..b22e4d8726 100644 --- a/CRM/Report/Form/Event/Income.php +++ b/CRM/Report/Form/Event/Income.php @@ -187,7 +187,6 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { $roleRows[$roleDAO->event_id][$participantRole[$roleId]]['total'] += $roleDAO->participant; $roleRows[$roleDAO->event_id][$participantRole[$roleId]]['amount'] += $roleDAO->amount; } - $roleRows[$roleDAO->event_id][$participantRole[$roleId]]['amount'] = CRM_Utils_Money::format($roleRows[$roleDAO->event_id][$participantRole[$roleId]]['amount'], $currency[$roleDAO->event_id]); } foreach ($roleRows as $eventId => $roleInfo) { @@ -195,6 +194,9 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { if (isset($roleInfo[$roleName])) { $roleRows[$eventId][$roleName]['round'] = round(($roleRows[$eventId][$roleName]['total'] / $count[$eventId]) * 100, 2); } + if (!empty($roleRows[$eventId][$roleName])) { + $roleRows[$eventId][$roleName]['amount'] = CRM_Utils_Money::format($roleRows[$eventId][$roleName]['amount'], $currency[$eventId]); + } } }