Skip to content

Commit

Permalink
Remove multiple currency handling as it seems to make it format worse
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Feb 18, 2019
1 parent e5a1daf commit 2d8edca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CRM/Contact/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -6554,7 +6554,7 @@ protected function addBasicStatsToSummary(&$summary, $where, $from) {
$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']);
Expand Down
13 changes: 3 additions & 10 deletions templates/CRM/Contribute/Page/ContributionTotals.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,9 @@
{if $contributionSummary }
<tr>
{if $contributionSummary.total.amount}
{if $contributionSummary.total.currencyCount gt 1}
<th class="contriTotalLeft right">{ts}Total{/ts} &ndash; {$contributionSummary.total.amount}</th>
<th class="left contriTotalRight"> &nbsp; {ts}# Completed{/ts} &ndash; {$contributionSummary.total.count}</th>
</tr><tr>
<th class="contriTotalLeft">{ts}Avg{/ts} &ndash; {$contributionSummary.total.avg}</th>
{else}
<th class="contriTotalLeft right">{ts}Total{/ts} &ndash; {$contributionSummary.total.amount}</th>
<th class="right"> &nbsp; {ts}# Completed{/ts} &ndash; {$contributionSummary.total.count}</th>
<th class="right contriTotalRight"> &nbsp; {ts}Avg{/ts} &ndash; {$contributionSummary.total.avg}</th>
{/if}
<th class="contriTotalLeft right">{ts}Total{/ts} &ndash; {$contributionSummary.total.amount}</th>
<th class="right"> &nbsp; {ts}# Completed{/ts} &ndash; {$contributionSummary.total.count}</th>
<th class="right contriTotalRight"> &nbsp; {ts}Avg{/ts} &ndash; {$contributionSummary.total.avg}</th>
{/if}
{if $contributionSummary.cancel.amount}
<th class="disabled right contriTotalRight"> &nbsp; {ts}Cancelled/Refunded{/ts} &ndash; {$contributionSummary.cancel.amount}</th>
Expand Down

0 comments on commit 2d8edca

Please sign in to comment.