From: eileen Date: Mon, 18 Feb 2019 01:17:37 +0000 (+1300) Subject: Remove multiple currency handling as it seems to make it format worse X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=bfac1665003fb083b4e1ab9087727d985c9118ab;p=civicrm-core.git Remove multiple currency handling as it seems to make it format worse --- diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index db917cd470..7c4d39a275 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -6554,7 +6554,7 @@ AND displayRelType.is_active = 1 $summary['total']['amount'][] = CRM_Utils_Money::format($dao->total_amount, $dao->currency); $summary['total']['avg'][] = CRM_Utils_Money::format($dao->total_avg, $dao->currency); } - $summary['total']['currencyCount'] = count($summary['total']['amount']); + if (!empty($summary['total']['amount'])) { $summary['total']['amount'] = implode(', ', $summary['total']['amount']); $summary['total']['avg'] = implode(', ', $summary['total']['avg']); diff --git a/templates/CRM/Contribute/Page/ContributionTotals.tpl b/templates/CRM/Contribute/Page/ContributionTotals.tpl index 3e5576d8df..5f03596a72 100644 --- a/templates/CRM/Contribute/Page/ContributionTotals.tpl +++ b/templates/CRM/Contribute/Page/ContributionTotals.tpl @@ -41,16 +41,9 @@ {if $contributionSummary } {if $contributionSummary.total.amount} - {if $contributionSummary.total.currencyCount gt 1} - {ts}Total{/ts} – {$contributionSummary.total.amount} -   {ts}# Completed{/ts} – {$contributionSummary.total.count} - - {ts}Avg{/ts} – {$contributionSummary.total.avg} - {else} - {ts}Total{/ts} – {$contributionSummary.total.amount} -   {ts}# Completed{/ts} – {$contributionSummary.total.count} -   {ts}Avg{/ts} – {$contributionSummary.total.avg} - {/if} + {ts}Total{/ts} – {$contributionSummary.total.amount} +   {ts}# Completed{/ts} – {$contributionSummary.total.count} +   {ts}Avg{/ts} – {$contributionSummary.total.avg} {/if} {if $contributionSummary.cancel.amount}   {ts}Cancelled/Refunded{/ts} – {$contributionSummary.cancel.amount} diff --git a/tests/phpunit/CRM/Contact/BAO/QueryTest.php b/tests/phpunit/CRM/Contact/BAO/QueryTest.php index dc0cc0afff..507069f784 100644 --- a/tests/phpunit/CRM/Contact/BAO/QueryTest.php +++ b/tests/phpunit/CRM/Contact/BAO/QueryTest.php @@ -734,7 +734,6 @@ civicrm_relationship.is_active = 1 AND 'avg' => '$ 233.33', 'amount' => '$ 1,400.00', 'count' => 6, - 'currencyCount' => 1, ], 'cancel' => [ 'count' => 2,