@dhyasama/totem-models 7.20.1 → 7.21.1
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/.npmignore +14 -0
- package/lib/Financials.js +18 -10
- package/package-lock.json +1927 -0
- package/package.json +1 -1
package/.npmignore
ADDED
package/lib/Financials.js
CHANGED
|
@@ -316,10 +316,14 @@ module.exports = function(mongoose, config) {
|
|
|
316
316
|
var now = new Date();
|
|
317
317
|
|
|
318
318
|
var query = self.find({
|
|
319
|
-
"snapshots
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
319
|
+
"snapshots": {
|
|
320
|
+
$elemMatch: {
|
|
321
|
+
"notifications.company.sendTo.email": { $ne: null },
|
|
322
|
+
"notifications.company.initial.sendOn": { $lte: now },
|
|
323
|
+
"notifications.company.initial.sentOn": null,
|
|
324
|
+
"submittedOn": null
|
|
325
|
+
}
|
|
326
|
+
}
|
|
323
327
|
});
|
|
324
328
|
|
|
325
329
|
query.exec(function(err, result) {
|
|
@@ -332,7 +336,7 @@ module.exports = function(mongoose, config) {
|
|
|
332
336
|
|
|
333
337
|
snapshots = _.filter(snapshots, function(snapshot) {
|
|
334
338
|
|
|
335
|
-
var bool = !!snapshot.notifications.company.sendTo;
|
|
339
|
+
var bool = !!snapshot.notifications.company.sendTo.email;
|
|
336
340
|
bool = bool && snapshot.notifications.company.initial.sendOn < now;
|
|
337
341
|
bool = bool && !snapshot.notifications.company.initial.sentOn;
|
|
338
342
|
|
|
@@ -352,10 +356,14 @@ module.exports = function(mongoose, config) {
|
|
|
352
356
|
var now = new Date();
|
|
353
357
|
|
|
354
358
|
var query = self.find({
|
|
355
|
-
"snapshots
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
+
"snapshots": {
|
|
360
|
+
$elemMatch: {
|
|
361
|
+
"notifications.company.sendTo.email": { $ne: null },
|
|
362
|
+
"notifications.company.reminder.sendOn": { $lte: now },
|
|
363
|
+
"notifications.company.reminder.sentOn": null,
|
|
364
|
+
"submittedOn": null
|
|
365
|
+
}
|
|
366
|
+
}
|
|
359
367
|
});
|
|
360
368
|
|
|
361
369
|
query.exec(function(err, result) {
|
|
@@ -368,7 +376,7 @@ module.exports = function(mongoose, config) {
|
|
|
368
376
|
|
|
369
377
|
snapshots = _.filter(snapshots, function(snapshot) {
|
|
370
378
|
|
|
371
|
-
var bool = !!snapshot.notifications.company.sendTo;
|
|
379
|
+
var bool = !!snapshot.notifications.company.sendTo.email;
|
|
372
380
|
bool = bool && snapshot.notifications.company.reminder.sendOn < now;
|
|
373
381
|
bool = bool && !snapshot.notifications.company.reminder.sentOn;
|
|
374
382
|
|