CRM-15237 also fix e-notices on event summary report
authorEileen McNaughton <eileen@fuzion.co.nz>
Fri, 5 Sep 2014 02:07:08 +0000 (14:07 +1200)
committerEileen McNaughton <eileen@fuzion.co.nz>
Fri, 5 Sep 2014 02:07:08 +0000 (14:07 +1200)
CRM/Report/Form/Event/IncomeCountSummary.php
tests/phpunit/api/v3/ReportTemplateTest.php

index cd3ba9a4055b131ed0565daa84ea27f5aab98e13..db26a789985e5d7db4d1ae98c3b5b97a3c39dd2f 100644 (file)
@@ -67,6 +67,7 @@ class CRM_Report_Form_Event_IncomeCountSummary extends CRM_Report_Form_Event {
             'required' => TRUE,
           ),
           'id' => array(
+            'title' => 'Event ID',
             'no_display' => TRUE,
             'required' => TRUE,
           ),
@@ -268,6 +269,7 @@ class CRM_Report_Form_Event_IncomeCountSummary extends CRM_Report_Form_Event {
     $dao = CRM_Core_DAO::executeQuery($sql);
 
     if ($dao->fetch()) {
+      $avg = 0;
       if ($dao->count && $dao->amount) {
         $avg = $dao->amount / $dao->count;
       }
@@ -281,7 +283,7 @@ class CRM_Report_Form_Event_IncomeCountSummary extends CRM_Report_Form_Event {
         'title' => 'Total Income',
         'type' => CRM_Utils_Type::T_MONEY,
       );
-      $statistics['counts']['avg   '] = array(
+      $statistics['counts']['avg'] = array(
         'value' => $avg,
         'title' => 'Average',
         'type' => CRM_Utils_Type::T_MONEY,
index add5c2b5f3265c5ce43530e7680bb64f3678d5ef..5ed5c0ae8bc888fd028740b3b831b01824e1388c 100644 (file)
@@ -181,7 +181,6 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase {
         'contribute/lybunt' => 'same as sybunt - fatals on force url & test identifies why',
         'event/income' => 'I do no understant why but error is Call to undefined method CRM_Report_Form_Event_Income::from() in CRM/Report/Form.php on line 2120',
         'contact/relationship' => '(see contribute/repeat), property declaration issue, Undefined property: CRM_Report_Form_Contact_Relationship::$relationType in /Contact/Relationship.php(486):',
-        'event/incomesummary' => 'Undefined index: title, Report/Form/Event/IncomeCountSummary.php(187)',
         'logging/contact/summary' => '(likely to be test releated) probably logging off Undefined index: Form/Contact/LoggingSummary.php(231): PHP',
         'logging/contact/detail' => '(likely to be test releated) probably logging off  DB Error: no such table',
         'logging/contribute/summary' => '(likely to be test releated) probably logging off DB Error: no such table',