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 CiviContribute (Moderator: Donald Lobo) »
  • Adding Currency
Pages: [1]

Author Topic: Adding Currency  (Read 2569 times)

FredJones

  • Guest
Adding Currency
July 31, 2007, 12:04:15 pm
On the Contribution  the View page,as in: http://beitnatan2.o/index.php? q=civicrm/contact/view/contribution&reset=1&id=608&cid=3258&action=view&context=contri bution&selectedChild=contribute  I have the TPL but where is the DB file list? I want to add currency to the list.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Adding Currency
July 31, 2007, 12:19:22 pm
please check CRM/Contribute/Form/ContributionView.php

Quote
approx. line 56
CRM_Contribute_BAO_Contribution::getValues( $params, $values, $ids );   this function fetches the values from db.

kurund
Found this reply helpful? Support CiviCRM

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Adding Currency
August 01, 2007, 12:54:11 am
Quote from: FredJones on July 31, 2007, 12:04:15 pm
I want to add currency to the list.

We keep the currencies in the civicrm_currency table (built based on the xml/templates/civicrm_data.tpl file’s contents, but that’s a developer info). If any currencies are missing, please file an issue in our issue tracker; we’d love to add them to CiviCRM on our end as well.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

FredJones

  • Guest
Re: Adding Currency
August 01, 2007, 12:57:28 am
Kurund, I see that code, but I don't see how to ask that code to ALSO fetch the currency field.

Piotr, let me clarify if I may. I have customized my CiviCRM code to allow users to input a currency for donations via a dropdown. It is now stored correctly in the DB, in each Donation record. In the table view (the overview) I also have it appearing now correctly. What I am trying to do now is to get the currency to appear in the single donation view, as mentioned above. The DB fetch seems to NOT get this field and I don't see how to add it.

Thanks.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Adding Currency
August 01, 2007, 05:53:58 am
When you call this function : CRM_Contribute_BAO_Contribution::getValues( $params, $values, $ids );

$values array will contains values from civicrm_contribution table for that contribution.

kurund

Found this reply helpful? Support CiviCRM

FredJones

  • Guest
Re: Adding Currency
August 01, 2007, 06:02:07 am
Quote from: Kurund Jalmi on August 01, 2007, 05:53:58 am
When you call this function : CRM_Contribute_BAO_Contribution::getValues( $params, $values, $ids );

$values array will contains values from civicrm_contribution table for that contribution.

OK, I am getting closer. If I add:

print_r($values);
 
to that file then I DO see currency:

Array ( [id] => 608 [domain_id] => 1 [contact_id] => 3258 [contribution_contact_id] => 3258 [contribution_type_id] => 6 [receive_date] => 2007-07-31 00:00:00 [total_amount] => 11.00 [currency] => CAD [is_test] => 0 [contribution_status_id] => 1 )

BUT if I add currency to the TPL file (templates\CRM\Contribute\Form\ContributionView.tpl) like this:

{$total_amount|crmMoney:$row.currency} A{$row.currency}A

I just see:

    $ 11.00 AA 

Where is the CAD?

Thanks for your help!

FredJones

  • Guest
Re: Adding Currency
August 01, 2007, 06:47:16 am
Please ignore me. It's {$currency} and it works just fine. I was making a MISTAKE.

Thank you!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Adding Currency

This forum was archived on 2017-11-26.