@dhyasama/totem-models 7.46.0 → 7.48.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.
- package/lib/Financials.js +16 -8
- package/lib/LimitedPartner.js +1 -1
- package/package.json +1 -1
package/lib/Financials.js
CHANGED
|
@@ -287,19 +287,27 @@ module.exports = function(mongoose, config) {
|
|
|
287
287
|
}
|
|
288
288
|
});
|
|
289
289
|
|
|
290
|
-
query.
|
|
290
|
+
query.populate('organization', 'name');
|
|
291
291
|
|
|
292
|
-
|
|
293
|
-
snapshots = _.flatten(snapshots);
|
|
292
|
+
query.exec(function(err, results) {
|
|
294
293
|
|
|
295
|
-
snapshots =
|
|
294
|
+
var snapshots = [];
|
|
296
295
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
bool = bool && !snapshot.reviewedOn;
|
|
296
|
+
_.each(results, function(result) {
|
|
297
|
+
_.each(result.snapshots, function(snapshot) {
|
|
300
298
|
|
|
301
|
-
|
|
299
|
+
var bool = snapshot.managedServices;
|
|
300
|
+
bool = bool && snapshot.submittedOn;
|
|
301
|
+
bool = bool && !snapshot.reviewedOn;
|
|
302
|
+
|
|
303
|
+
if(bool) {
|
|
304
|
+
snapshots.push({
|
|
305
|
+
organization: result.organization.name,
|
|
306
|
+
snapshot: snapshot
|
|
307
|
+
});
|
|
308
|
+
}
|
|
302
309
|
|
|
310
|
+
});
|
|
303
311
|
});
|
|
304
312
|
|
|
305
313
|
if (err) { return cb(err, null); }
|
package/lib/LimitedPartner.js
CHANGED
|
@@ -454,7 +454,7 @@ module.exports = function(mongoose, config) {
|
|
|
454
454
|
query.exec(cb);
|
|
455
455
|
};
|
|
456
456
|
|
|
457
|
-
query = self.find({'customer': customerId, 'name': lpName
|
|
457
|
+
query = self.find({'customer': customerId, 'name': lpName}, self.getReadFilterKeys(role));
|
|
458
458
|
getLps();
|
|
459
459
|
|
|
460
460
|
};
|