From 7baf6261a190a088c2cea8607cb1e81f7ec40992 Mon Sep 17 00:00:00 2001 From: yashodha Date: Wed, 13 Mar 2013 14:56:47 +0530 Subject: [PATCH] CRM-9394 --- CRM/Report/Form/Event/Income.php | 12 +++++++----- templates/CRM/Report/Form/Event/Income.tpl | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CRM/Report/Form/Event/Income.php b/CRM/Report/Form/Event/Income.php index 2928e246f2..5b5a3298c5 100644 --- a/CRM/Report/Form/Event/Income.php +++ b/CRM/Report/Form/Event/Income.php @@ -120,7 +120,7 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { "; $eventDAO = CRM_Core_DAO::executeQuery($sql); - + $currency = array(); while ($eventDAO->fetch()) { $eventSummary[$eventDAO->event_id]['Title'] = $eventDAO->event_title; $eventSummary[$eventDAO->event_id]['Max Participants'] = $eventDAO->max_participants; @@ -129,6 +129,7 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { $eventSummary[$eventDAO->event_id]['Event Type'] = $eventDAO->event_type; $eventSummary[$eventDAO->event_id]['Event Income'] = CRM_Utils_Money::format($eventDAO->total, $eventDAO->currency); $eventSummary[$eventDAO->event_id]['Registered Participant'] = "{$eventDAO->participant} ({$activeparticipnatStutusLabel})"; + $currency[$eventDAO->event_id] = $eventDAO->currency; } $this->assign_by_ref('summary', $eventSummary); @@ -154,8 +155,8 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { SELECT civicrm_participant.role_id as ROLEID, COUNT( civicrm_participant.id ) as participant, SUM(civicrm_participant.fee_amount) as amount, - civicrm_participant.event_id as event_id - + civicrm_participant.event_id as event_id, + civicrm_participant.fee_currency as currency FROM civicrm_participant WHERE civicrm_participant.event_id IN ( {$eventID}) AND @@ -178,6 +179,7 @@ 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) { @@ -187,7 +189,7 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { } } } - + $rows['Role'] = $roleRows; //Count the Participant by status ID for Event @@ -210,7 +212,7 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { while ($statusDAO->fetch()) { $statusRows[$statusDAO->event_id][$participantStatus[$statusDAO->STATUSID]]['total'] = $statusDAO->participant; $statusRows[$statusDAO->event_id][$participantStatus[$statusDAO->STATUSID]]['round'] = round(($statusDAO->participant / $count[$statusDAO->event_id]) * 100, 2); - $statusRows[$statusDAO->event_id][$participantStatus[$statusDAO->STATUSID]]['amount'] = $statusDAO->amount; + $statusRows[$statusDAO->event_id][$participantStatus[$statusDAO->STATUSID]]['amount'] = CRM_Utils_Money::format($statusDAO->amount, $currency[$statusDAO->event_id]); } $rows['Status'] = $statusRows; diff --git a/templates/CRM/Report/Form/Event/Income.tpl b/templates/CRM/Report/Form/Event/Income.tpl index 5c8c2e335c..7aae70f32e 100644 --- a/templates/CRM/Report/Form/Event/Income.tpl +++ b/templates/CRM/Report/Form/Event/Income.tpl @@ -72,7 +72,7 @@ {$role} {$row.total} {$row.round} - {$row.amount|crmMoney} + {$row.amount} {/foreach} {/if} -- 2.25.1