@dhyasama/totem-models 8.33.0 → 8.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -100,21 +100,21 @@ module.exports = function(mongoose, config) {
100
100
  LimitedPartner.virtual('totalCommitment').get(function () {
101
101
  var self = this;
102
102
  return _.reduce(self.transactions, function(memo, transaction) {
103
- return memo + ((transaction.type === 'commitment' && transaction.amount > 0) ? transaction.amount : 0);
103
+ return memo + ((transaction.type === 'commitment' && Math.abs(transaction.amount) > 0) ? transaction.amount : 0);
104
104
  }, 0);
105
105
  });
106
106
 
107
107
  LimitedPartner.virtual('totalContribution').get(function () {
108
108
  var self = this;
109
109
  return _.reduce(self.transactions, function(memo, transaction) {
110
- return memo + ((transaction.type === 'contribution' && transaction.amount > 0) ? transaction.amount : 0);
110
+ return memo + ((transaction.type === 'contribution' && Math.abs(transaction.amount) > 0) ? transaction.amount : 0);
111
111
  }, 0);
112
112
  });
113
113
 
114
114
  LimitedPartner.virtual('totalDistribution').get(function () {
115
115
  var self = this;
116
116
  return _.reduce(self.transactions, function(memo, transaction) {
117
- return memo + ((transaction.type === 'distribution' && transaction.amount > 0) ? transaction.amount : 0);
117
+ return memo + ((transaction.type === 'distribution' && Math.abs(transaction.amount) > 0) ? transaction.amount : 0);
118
118
  }, 0);
119
119
  });
120
120
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "8.33.0",
3
+ "version": "8.34.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",