Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/core#1682 - Invalid currency on sending offline membership receipt. #16943

Merged
merged 1 commit into from
Apr 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions CRM/Member/Form/Membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ public function setDefaultValues() {
public function buildQuickForm() {

$this->buildQuickEntityForm();
$this->assign('currency', CRM_Core_BAO_Country::defaultCurrencySymbol());
$this->assign('currency_symbol', CRM_Core_BAO_Country::defaultCurrencySymbol());
$isUpdateToExistingRecurringMembership = $this->isUpdateToExistingRecurringMembership();
// build price set form.
$buildPriceSet = FALSE;
Expand Down Expand Up @@ -1617,8 +1617,7 @@ public function submit() {
}

if (!empty($lineItem[$this->_priceSetId])) {
$invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
$invoicing = $invoiceSettings['invoicing'] ?? NULL;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contribution_invoice_settings is a deprecated setting, the correct value of invoicing can be directly obtained from Civi::settings()->get('invoicing');

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eileenmcnaughton looks like in your sweep missed one

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seamuslee001 yep - I made it so that still works rather than replacing them all

$invoicing = Civi::settings()->get('invoicing');
$taxAmount = FALSE;
$totalTaxAmount = 0;
foreach ($lineItem[$this->_priceSetId] as & $priceFieldOp) {
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Member/Form/Membership.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
var taxRates = {/literal}{$taxRates}{literal};
var taxTerm = {/literal}{$taxTerm|@json_encode}{literal};
var taxRate = taxRates[allMemberships[memType]['financial_type_id']];
var currency = {/literal}{$currency|@json_encode}{literal};
var currency = {/literal}{$currency_symbol|@json_encode}{literal};
var taxAmount = (taxRate/100)*allMemberships[memType]['total_amount_numeric'];
taxAmount = isNaN (taxAmount) ? 0:taxAmount;
if (term) {
Expand Down