Fix for CRM-15136
authorRohan Katkar <rohan.katkar@webaccess.co.in>
Tue, 19 Aug 2014 16:11:44 +0000 (21:41 +0530)
committerRohan Katkar <rohan.katkar@webaccess.co.in>
Tue, 19 Aug 2014 16:11:44 +0000 (21:41 +0530)
CRM/Report/Form/Event/Income.php

index 0f6323c053d6fd7eb41c3fa656541440d250a291..b22e4d8726feaf9c5cd681e231108588f067b73f 100644 (file)
@@ -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]);
+        }
       }
     }