Skip to content

Commit

Permalink
UI-1248: Unknown refund should properly be displayed negatively
Browse files Browse the repository at this point in the history
  • Loading branch information
JRMaitre committed Mar 13, 2015
1 parent aa1035a commit 531d5a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/myaccount/views/transactions-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{{/if}}
</div>
<div class="date">{{ this.friendlyCreated }}</div>
<div class="price">{{ ../../i18n.currencyUsed }}{{ this.amount }}</div>
<div class="price">{{ ../../i18n.currencyUsed }}{{#if this.isARefund}}-{{/if}}{{ this.amount }}</div>
</div>
</div>
{{else}}
Expand Down
10 changes: 8 additions & 2 deletions js/lib/monster.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,18 @@ define(function(require){
transaction.amount = parseFloat(transaction.amount).toFixed(2);

if(transaction.hasOwnProperty('code')) {
if(transaction.code === 9999 || transaction.code % 1000 < 500) {
if(transaction.code % 1000 < 500) {
transaction.friendlyName = app.i18n.active().transactions.codes[transaction.code];
}
else {
transaction.isARefund = true;
transaction.friendlyName = app.i18n.active().transactions.codes[transaction.code - 500] + ' ' + app.i18n.active().transactions.refundText;

if(transaction.code === 9999) {
transaction.friendlyName = app.i18n.active().transactions.codes[transaction.code];
}
else {
transaction.friendlyName = app.i18n.active().transactions.codes[transaction.code - 500] + ' ' + app.i18n.active().transactions.refundText;
}
}
}

Expand Down

0 comments on commit 531d5a5

Please sign in to comment.