diff --git a/apps/myaccount/i18n/en-US.json b/apps/myaccount/i18n/en-US.json index baebeecf8..7724d2ca7 100644 --- a/apps/myaccount/i18n/en-US.json +++ b/apps/myaccount/i18n/en-US.json @@ -208,6 +208,7 @@ "__comment": "UI-1248: Work on transactions to fix the way they're displayed", "__version": "3.19", + "refundText": "(Refund)", "codes": { "1001": "Per Minute Call", "1002": "Sub-Account Per Minute Call", @@ -225,11 +226,13 @@ "5000": "Recurring", "5001": "Monthly Recurring", "5002": "Monthly Recurring (Pro-rated)", - "9999": "Unknown" + "9999": "Unknown Refund", + "0": "Unknown" }, "errorStatuses": { "voided": "Voided", - "declined": "Declined" + "declined": "Declined", + "processor_declined": "Declined" } } } diff --git a/apps/myaccount/submodules/transactions/transactions.css b/apps/myaccount/submodules/transactions/transactions.css index 5b1ae6f12..1ad87c1e7 100644 --- a/apps/myaccount/submodules/transactions/transactions.css +++ b/apps/myaccount/submodules/transactions/transactions.css @@ -40,6 +40,10 @@ margin-bottom: 15px; } +.transactions-content-wrapper .list-transactions .transaction.refund { + color: #22A5FF; +} + .transactions-content-wrapper .list-transactions .transaction > *:not(.expandable) { line-height: 65px; height: 65px; diff --git a/apps/myaccount/submodules/transactions/transactions.js b/apps/myaccount/submodules/transactions/transactions.js index ab2c1642f..9f90e8992 100644 --- a/apps/myaccount/submodules/transactions/transactions.js +++ b/apps/myaccount/submodules/transactions/transactions.js @@ -89,9 +89,9 @@ define(function(require){ parent.find('.expandable').hide(); - parent.find('.start-date .value').html(data.billingStartDate); - parent.find('.end-date .value').html(data.billingEndDate); - parent.find('.total-amount .value').html(self.i18n.active().currencyUsed + data.amount); + parent.find('.billing-date.start').html(data.billingStartDate); + parent.find('.billing-date.end').html(data.billingEndDate); + parent.find('.total-amount').html(self.i18n.active().currencyUsed + data.amount); }); }); }, @@ -133,7 +133,13 @@ define(function(require){ arrayCharges.push(v); if(v.approved) { - defaults.amount += parseFloat(v.amount); + // All the codes that are in the 5xx and above are refunds + if(v.code % 1000 > 500) { + defaults.amount -= parseFloat(v.amount); + } + else { + defaults.amount += parseFloat(v.amount); + } } } }); @@ -154,25 +160,6 @@ define(function(require){ ); }, - transactionsGetMonthly: function(from, to, success, error) { - var self = this; - - monster.request({ - resource: 'myaccount.transactions.getMonthly', - data: { - accountId: self.accountId, - from: from, - to: to - }, - success: function(data, status) { - success && success(data, status); - }, - error: function(data, status) { - error && error(data, status); - } - }); - }, - transactionsGetCharges: function(from, to, success, error) { var self = this; diff --git a/apps/myaccount/views/transactions-list.html b/apps/myaccount/views/transactions-list.html index c7a6b3a2c..4697f0616 100644 --- a/apps/myaccount/views/transactions-list.html +++ b/apps/myaccount/views/transactions-list.html @@ -1,6 +1,5 @@ {{#each listTransactions}} -
- {{debug this}} +
{{#compare this.type '===' 'charges'}}
@@ -30,13 +29,12 @@ {{/unless}} {{ this.friendlyName }} - {{#unless this.approved}}  ({{ this.errorMessage }}) {{/unless}}
{{ this.friendlyCreated }}
-
{{ ../../i18n.currencyUsed }}{{ this.amount }}
+
{{ ../../i18n.currencyUsed }}{{#if this.isARefund}}-{{/if}}{{ this.amount }}