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 CiviReport (Moderator: Dave Greenberg) »
  • display currency and amount in two separate columns
Pages: [1]

Author Topic: display currency and amount in two separate columns  (Read 1051 times)

Philippe

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
  • CiviCRM version: latest
  • CMS version: Drupal 6
  • MySQL version: 5
  • PHP version: 5
display currency and amount in two separate columns
November 23, 2012, 02:10:08 am
Hi,
I need to display the currency and amount in two separate columns in the Donor Detail Report,
Any help would be great.
Many thanks

Philippe

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: display currency and amount in two separate columns
November 23, 2012, 03:47:46 am
hi phillipe,

not sure if you are a coder or not, but at the moment, i think that the only way to do this is to edit the report template and expose the currency as a column.

so if you aren't a coder, you can either have a go or find someone who is to do this for you (it is a trivial addition if you know how)

in this file http://svn.civicrm.org/civicrm/trunk/CRM/Report/Form/Contribute/Detail.php

you should be able to add a currency label in the $this->_columns array in this file, i suspect in the civicrm_contribution sub array.   have a look at some other reports and the book / wiki pages on customising reports for more details on how you would do this.

michael
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

Philippe

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
  • CiviCRM version: latest
  • CMS version: Drupal 6
  • MySQL version: 5
  • PHP version: 5
Re: display currency and amount in two separate columns
November 23, 2012, 07:02:12 am
Thank you Michael,
I have edited Detail.php as follows
  'civicrm_contribution' =>
                   array( 'dao'     => 'CRM_Contribute_DAO_Contribution',
                          'fields'  =>
                          array(
                                 'contribution_id' => array(
                                                            'name' => 'id',
                                                            'no_display' => true,
                                                            'required'   => true,
                                                ),
                                 'contribution_type_id' => array( 'title'   => ts('Contribution Type'),
                                                                  'default' => true,
                                                                ),
                                'payment_instrument_id' => array( 'title'   => ts('Payment Type'),
                                                                            ),
                                 'trxn_id'              => null,
                                 'receive_date'         => array( 'default' => true ),
                                 'receipt_date'         => null,
                                 'fee_amount'           => null,
                                 'net_amount'           => null,
            'currency'           => null,
            'total_amount'           => null,
                           
                                 ),

I now have two columns, Currency and Total Amount. Currency  is showing fine, however total_amount still appears as € 45.00
With the Euro or Dollar symbol, I only want the amount .
I can't figure out where it is configured that the total amount should show with the currency symbol.
Any ideas where I should look to edit this?

Many thanks

Philippe

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: display currency and amount in two separate columns
November 26, 2012, 04:02:06 am
ah, i do remember having to do something similar before.

Try searching in CRM/Report/Form.php for 'money'  You'll see two references to CRM_Utils_Type::T_MONEY and also to CRM_Utils_Money::format().

That should give you a better understanding of how it is put together.

If you can find your way to the place where CiviReport is formatting that column, you might be able to add some params to CRM_Utils_Money::format that stop it printing the currency character - I not positive but I think that is how I did it last time...
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • display currency and amount in two separate columns

This forum was archived on 2017-11-26.