Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/145231
Change subject: WIP (FR #1771) Never send tax letter in virtual currency ...................................................................... WIP (FR #1771) Never send tax letter in virtual currency Change-Id: Ic130f50334826ed010d2ad97af554da1a083bc04 --- M sites/all/modules/thank_you/thank_you.module 1 file changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/31/145231/1 diff --git a/sites/all/modules/thank_you/thank_you.module b/sites/all/modules/thank_you/thank_you.module index ef6dc91..2f2fa81 100644 --- a/sites/all/modules/thank_you/thank_you.module +++ b/sites/all/modules/thank_you/thank_you.module @@ -301,6 +301,15 @@ return false; } + $amount = $custom_values['original_amount']; + $currency = $custom_values['original_currency']; + + // Use settlement currency if the original currency is virtual, for tax reasons. + if ( $custom_values['original_currency'] === 'BTC' ) { + $amount = $contribution['gross']; + $currency = $contribution['currency']; + } + $tags = civicrm_api3( 'EntityTag', 'getdetails', array( 'entity_table' => 'civicrm_contribution', 'entity_id' => $contribution_id @@ -322,8 +331,8 @@ $locale = wmf_common_locale_civi_to_mediawiki( $locale ); $params = array( - 'amount' => $custom_values['original_amount'], - 'currency' => $custom_values['original_currency'], + 'amount' => $amount, + 'currency' => $currency, 'first_name' => $contact['first_name'], 'from_name' => variable_get( 'thank_you_from_name', 'Wikimedia Foundation' ), 'from_address' => variable_get( 'thank_you_from_address', 'don...@wikimedia.org' ), -- To view, visit https://gerrit.wikimedia.org/r/145231 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic130f50334826ed010d2ad97af554da1a083bc04 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: Awight <awi...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits