CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Reporting on price set options
Pages: [1]

Author Topic: Reporting on price set options  (Read 1137 times)

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Reporting on price set options
September 20, 2011, 02:20:10 pm
I have an event set up using price sets.  One of the price set fields is called "session slot", which uses check boxes.   So the person registering for the event can choose one  or more of 6 "session slots":  "session A" , "session B", "session C', "session D", "session E" and "session F"
 
After a lot of people have registered, how can I get a report/search results showing how many people are coming to each session slot? ie how many are coming to session A, how many are coming to session B, etc.

When I use the "Event Participant Report(List)", I have adjusted the report criteria so that it includes the columns for "Fee Level" and "Fee Amount".  However, the report jams all the sessions someone has signed up for into a single table cell. Also the "Fee Level" and "Fee Amount" fields are not available in the "Set Filters" area.

Any ideas?
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Reporting on price set options
September 20, 2011, 05:07:23 pm
is the custom search http://my.outdoorsnz.org.nz/civicrm/contact/search/custom?csid=9&reset=1 any help?
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Reporting on price set options
September 20, 2011, 05:49:22 pm
This works  for this situation. Thanks for the tip.
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Reporting on price set options
September 25, 2011, 11:06:47 am
I spoke too soon.  For many events it is throwing an SQL error.   What I am seeing in my investigation:

In the "fill table" function, it is trying to insert a record as follows:
UPDATE civicrm_temp_custom_9287411d26ba39089ba07e4e179a58aa
SET price_field_78 = 1,price_field_79 = 1,price_field_80 = 1,price_field_81 = 1,price_field_83 = 1,price_field_84 = 1,price_field_85 = 1,price_field_106 = 1,price_field_107 = 1,price_field_108 = 1
WHERE participant_id = 78

Yet the field "price_field_83" does not exist in the temp table.  I looked at the code for how the temp table is getting created, but nothing jumped out.

Any ideas?
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Reporting on price set options
September 25, 2011, 03:17:06 pm
Made some progress:
The issue is occuring because the API call:
 require_once 'CRM/Price/BAO/Set.php';
 $priceSet = CRM_Price_BAO_Set::getSetDetail( $dao->price_set_id );

only returns checkbox options that are currently enabled, even though there is data for participants who previously registered using a check box option that was enabled at the time.    If I re-enable the checkbox value, then the downstream SQL works.

Seems like the API should be changed to return all possible options, even those that are disabled.
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Reporting on price set options
September 25, 2011, 08:33:56 pm

most of the code is interested in only the currently active elements, and hence the current behavior.

however with reporting, u want all the pricesets (in case they were used in the past etc). Might be good to extend the function so the default stays what it is currently (is_active = 1), but you can send in a parameter whereby it ignores the is_active field. The custom search can then call this function asking for all price sets

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Reporting on price set options
September 28, 2011, 01:21:34 pm
I changed some API code, but am not sure the of the implications.

I updated the file "CRM/Price/BAO/Field.php"

In the section:
public static function getOptions( $fieldId, $inactiveNeeded = false, $reset = false )
    {
        static $options = array();
       
        if ( $reset || empty( $options[$fieldId] ) ) {
            $values = array( );
            require_once 'CRM/Price/BAO/FieldValue.php';
          CRM_Price_BAO_FieldValue::getValues( $fieldId, $values, 'weight',  $inactiveNeeded );
            $options[$fieldId] = $values;
        }


I changed the following line of code, the original line:
  CRM_Price_BAO_FieldValue::getValues( $fieldId, $values, 'weight', ! $inactiveNeeded );

The new line of code:
  CRM_Price_BAO_FieldValue::getValues( $fieldId, $values, 'weight',  $inactiveNeeded );
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Reporting on price set options
September 28, 2011, 02:16:48 pm

hmm, that will have an implication on ALL the functions that call getOptions right now

since u need this for the customSearch, why dont u add a parameter to getSetDetail (inactiveNeeded defaults to false) which is then passed onto getOptions

the custom search can then call getSetDetail with it set to true

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Reporting on price set options

This forum was archived on 2017-11-26.